X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/387e72bad6d1573610e6e9e1c48027f4407fa38e..fdf20a26dba64a6d31dead1e1d19b2d755c0af13:/src/gtk/evtloop.cpp diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index 9a5717c06b..c54fa804d2 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -98,7 +98,7 @@ bool wxGUIEventLoop::Pending() const bool wxGUIEventLoop::Dispatch() { - wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") ); // gtk_main_iteration() returns TRUE only if gtk_main_quit() was called return !gtk_main_iteration(); @@ -138,6 +138,13 @@ static void wxgtk_main_do_event(GdkEvent *event, wxGUIEventLoop* evtloop) // categorize the GDK event according to wxEventCategory. // See http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GdkEventType // for more info. + + // NOTE: GDK_* constants which were not present in the GDK2.0 can be tested for + // only at compile-time; when running the program (compiled with a recent GDK) + // on a system with an older GDK lib we can be sure there won't be problems + // because event->type will never assume those values corresponding to + // new event types (since new event types are always added in GDK with non + // conflicting values for ABI compatibility). wxEventCategory cat = wxEVT_CATEGORY_UNKNOWN; switch (event->type) @@ -145,11 +152,12 @@ static void wxgtk_main_do_event(GdkEvent *event, wxGUIEventLoop* evtloop) case GDK_SELECTION_REQUEST: case GDK_SELECTION_NOTIFY: case GDK_SELECTION_CLEAR: +#if GTK_CHECK_VERSION(2,6,0) case GDK_OWNER_CHANGE: +#endif cat = wxEVT_CATEGORY_CLIPBOARD; break; - case GDK_KEY_PRESS: case GDK_KEY_RELEASE: case GDK_BUTTON_PRESS: @@ -188,7 +196,12 @@ static void wxgtk_main_do_event(GdkEvent *event, wxGUIEventLoop* evtloop) case GDK_DRAG_STATUS: case GDK_DROP_START: case GDK_DROP_FINISHED: +#if GTK_CHECK_VERSION(2,8,0) case GDK_GRAB_BROKEN: +#endif +#if GTK_CHECK_VERSION(2,14,0) + case GDK_DAMAGE: +#endif cat = wxEVT_CATEGORY_UI; break;