]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
Fixed using list of wildcards in filter of wxDocTemplate.
[wxWidgets.git] / src / gtk / window.cpp
index bc032656c6ff470c7995137e56889731fb5054f5..d98386fe20a204b536696ccea1d1e88a3985908e 100644 (file)
 #include "wx/math.h"
 #include <ctype.h>
 
+// FIXME: Due to a hack we use GtkCombo in here, which is deprecated since gtk2.3.0
+#include <gtk/gtkversion.h>
+#if defined(GTK_DISABLE_DEPRECATED) && GTK_CHECK_VERSION(2,3,0)
+#undef GTK_DISABLE_DEPRECATED
+#endif
+
 #include "wx/gtk/private.h"
 #include <gdk/gdkprivate.h>
 #include <gdk/gdkkeysyms.h>
@@ -1835,9 +1841,9 @@ static bool DoSendFocusEvents(wxWindow *win)
 }
 
 extern "C" {
-static gint gtk_window_focus_in_callback( GtkWidget *widget,
-                                          GdkEvent *WXUNUSED(event),
-                                          wxWindow *win )
+static gboolean gtk_window_focus_in_callback( GtkWidget *widget,
+                                              GdkEvent *WXUNUSED(event),
+                                              wxWindow *win )
 {
     DEBUG_MAIN_THREAD
 
@@ -1867,7 +1873,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
     }
 #endif // wxUSE_CARET
 
-    bool ret = FALSE;
+    gboolean ret = FALSE;
 
     // does the window itself think that it has the focus?
     if ( !win->m_hasFocus )
@@ -1877,15 +1883,15 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
 
         (void)DoSendFocusEvents(win);
         
-        ret = TRUE;
+        ret = true;
     }
 
     // Disable default focus handling for custom windows
     // since the default GTK+ handler issues a repaint
     if (win->m_wxwindow)
-        g_signal_stop_emission_by_name (widget, "focus_in_event");
+        return ret;
         
-    return ret;
+    return false;
 }
 }
 
@@ -1894,7 +1900,9 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
 //-----------------------------------------------------------------------------
 
 extern "C" {
-static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
+static gboolean gtk_window_focus_out_callback( GtkWidget *widget,
+                                               GdkEventFocus *gdk_event,
+                                               wxWindowGTK *win )
 {
     DEBUG_MAIN_THREAD
 
@@ -1928,7 +1936,7 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk
     }
 #endif // wxUSE_CARET
 
-    bool ret = FALSE;
+    gboolean ret = FALSE;
 
     // don't send the window a kill focus event if it thinks that it doesn't
     // have focus already
@@ -1941,15 +1949,15 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk
 
         (void)win->GetEventHandler()->ProcessEvent( event );
         
-        ret = TRUE;
+        ret = true;
     }
     
     // Disable default focus handling for custom windows
     // since the default GTK+ handler issues a repaint
     if (win->m_wxwindow)
-        g_signal_stop_emission_by_name (widget, "focus_out_event");
+        return ret;
            
-    return ret;
+    return false;
 }
 }
 
@@ -1958,10 +1966,10 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk
 //-----------------------------------------------------------------------------
 
 extern "C" {
-static
-gint gtk_window_enter_callback( GtkWidget *widget,
-                                GdkEventCrossing *gdk_event,
-                                wxWindowGTK *win )
+static gboolean
+gtk_window_enter_callback( GtkWidget *widget,
+                           GdkEventCrossing *gdk_event,
+                           wxWindowGTK *win )
 {
     DEBUG_MAIN_THREAD
 
@@ -2003,7 +2011,10 @@ gint gtk_window_enter_callback( GtkWidget *widget,
 //-----------------------------------------------------------------------------
 
 extern "C" {
-static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindowGTK *win )
+static gboolean
+gtk_window_leave_callback( GtkWidget *widget,
+                           GdkEventCrossing *gdk_event,
+                           wxWindowGTK *win )
 {
     DEBUG_MAIN_THREAD
 
@@ -2743,10 +2754,20 @@ void wxWindowGTK::PostCreation()
         if (m_focusWidget == NULL)
             m_focusWidget = m_widget;
 
-        g_signal_connect (m_focusWidget, "focus_in_event",
+        if (m_wxwindow)
+        {
+            g_signal_connect (m_focusWidget, "focus_in_event",
                           G_CALLBACK (gtk_window_focus_in_callback), this);
-        g_signal_connect_after (m_focusWidget, "focus_out_event",
+            g_signal_connect (m_focusWidget, "focus_out_event",
                                 G_CALLBACK (gtk_window_focus_out_callback), this);
+        }
+        else
+        {
+            g_signal_connect_after (m_focusWidget, "focus_in_event",
+                          G_CALLBACK (gtk_window_focus_in_callback), this);
+            g_signal_connect_after (m_focusWidget, "focus_out_event",
+                                G_CALLBACK (gtk_window_focus_out_callback), this);
+        }
     }
 
     // connect to the various key and mouse handlers