X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/347918966970177f4ee7b70fcf29041c193d972d..87f086bcbd6791f172e8b176d7155c614235638b:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 9ca920d581..b966d46d21 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -8,15 +8,17 @@ ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "window.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #ifdef __VMS #define XWarpPointer XWARPPOINTER #endif -#include "wx/defs.h" #include "wx/window.h" #include "wx/dcclient.h" #include "wx/frame.h" @@ -255,6 +257,10 @@ wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL; // send any activate events at all static int g_sendActivateEvent = -1; +// hack: we need something to pass to gtk_menu_popup, so we store the time of +// the last click here +static guint32 gs_timeLastClick = 0; + extern bool g_mainThreadLocked; //----------------------------------------------------------------------------- @@ -1582,6 +1588,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, if ( !g_captureWindow ) win = FindWindowForMouseEvent(win, event.m_x, event.m_y); + gs_timeLastClick = gdk_event->time; + /* wxPrintf( wxT("2) OnButtonPress from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) @@ -3854,7 +3862,7 @@ void wxWindowGTK::GtkSendPaintEvents() m_updateRegion.Clear(); } -void wxWindowGTK::Clear() +void wxWindowGTK::ClearBackground() { wxCHECK_RET( m_widget != NULL, wxT("invalid window") ); @@ -4214,7 +4222,7 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y ) #ifdef __WXGTK20__ gtk_get_current_event_time() #else - GDK_CURRENT_TIME + gs_timeLastClick // the time of activation #endif );