Create WXSendContextMenuEvent() helper function

Put common code from all the different ports into it.

This is not very useful right now, but it will allow to change this
function once, instead of applying the same change to all ports, in the
upcoming commit.
This commit is contained in:
Vadim Zeitlin
2020-01-07 16:33:20 +01:00
parent d52331046c
commit 3a09975465
7 changed files with 19 additions and 37 deletions

View File

@@ -1706,12 +1706,8 @@ gtk_window_button_press_callback( GtkWidget* WXUNUSED_IN_GTK3(widget),
// (a) it's a command event and so is propagated to the parent
// (b) under some ports it can be generated from kbd too
// (c) it uses screen coords (because of (a))
wxContextMenuEvent evtCtx(
wxEVT_CONTEXT_MENU,
win->GetId(),
win->ClientToScreen(event.GetPosition()));
evtCtx.SetEventObject(win);
return win->GTKProcessEvent(evtCtx);
const wxPoint pos = win->ClientToScreen(event.GetPosition());
return win->WXSendContextMenuEvent(pos);
}
return FALSE;