X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d1efe3fec4393cb2a0da2e68e593b8074790e7b..2e09dc2dc80d5dd5c42a559c4dd4738ed006a276:/src/mgl/window.cpp?ds=sidebyside diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index b9db7ceb62..d2f4633140 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -127,7 +127,7 @@ static void wxCaptureScreenshot(bool activeWindowOnly) } g_displayDC->savePNGFromDC(screenshot.mb_str(), - r.x, r. y, r.width, r.height); + r.x, r. y, r.x+r.width, r.y+r.height); wxMessageBox(_("Screenshot captured: ") + wxString(screenshot)); } @@ -197,7 +197,18 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e) // MGL doesn't generate two subsequent single clicks prior // to a double click, but rather only fires one single click // followed by one double click. wxWindows expects two single - // clicks, so we have to emulate the second one. + // clicks, so we have to synthetize the second one. First + // generate wxEVT_?_DOWN: + event.SetEventType(type); + win->GetEventHandler()->ProcessEvent(event); + + // ...followed by wxEVT_?_UP: + if ( e->message & EVT_LEFTBMASK ) + type = wxEVT_LEFT_UP; + else if ( e->message & EVT_MIDDLEBMASK ) + type = wxEVT_MIDDLE_UP; + else if ( e->message & EVT_RIGHTBMASK ) + type = wxEVT_RIGHT_UP; event.SetEventType(type); win->GetEventHandler()->ProcessEvent(event);