fix creation of emboss object on linux
This commit is contained in:
parent
4e559daece
commit
7b70083c78
1 changed files with 10 additions and 8 deletions
|
@ -4188,13 +4188,17 @@ void Plater::priv::on_right_click(RBtnEvent& evt)
|
|||
}
|
||||
|
||||
if (q != nullptr && menu) {
|
||||
const Vec2d& mouse_position = evt.data.first;
|
||||
wxPoint position(static_cast<int>(mouse_position.x()),
|
||||
static_cast<int>(mouse_position.y()));
|
||||
#ifdef __linux__
|
||||
// For some reason on Linux the menu isn't displayed if position is specified
|
||||
// (even though the position is sane).
|
||||
q->PopupMenu(menu);
|
||||
#else
|
||||
q->PopupMenu(menu, (int)evt.data.first.x(), (int)evt.data.first.y());
|
||||
// For some reason on Linux the menu isn't displayed if position is
|
||||
// specified (even though the position is sane).
|
||||
position = wxDefaultPosition;
|
||||
#endif
|
||||
q->canvas3D()->set_popup_menu_position(mouse_position);
|
||||
q->PopupMenu(menu, position);
|
||||
q->canvas3D()->clear_popup_menu_position();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6835,9 +6839,7 @@ bool Plater::PopupMenu(wxMenu *menu, const wxPoint& pos)
|
|||
SuppressBackgroundProcessingUpdate sbpu;
|
||||
// When tracking a pop-up menu, postpone error messages from the slicing result.
|
||||
m_tracking_popup_menu = true;
|
||||
canvas3D()->set_popup_menu_position(Vec2d(pos.x, pos.y));
|
||||
bool out = this->wxPanel::PopupMenu(menu, pos);
|
||||
canvas3D()->clear_popup_menu_position();
|
||||
bool out = this->wxPanel::PopupMenu(menu, pos);
|
||||
m_tracking_popup_menu = false;
|
||||
if (! m_tracking_popup_menu_error_message.empty()) {
|
||||
// Don't know whether the CallAfter is necessary, but it should not hurt.
|
||||
|
|
Loading…
Add table
Reference in a new issue