]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkmain.c
Fix #149547, Markus Lausser:
[~andy/gtk] / gtk / gtkmain.c
index 1af4cb1ebcb90ffa5c3c544cc5b29df462c281ad..55df71e992c22c3611a881e583df3993ae4cbea3 100644 (file)
@@ -24,6 +24,8 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+#include <config.h>
+
 #include "gdkconfig.h"
 
 #include <locale.h>
 
 #include <pango/pango-utils.h> /* For pango_split_file_list */
 
-#include "config.h"
+#include "gtkalias.h"
 #include "gtkintl.h"
 
 #include "gtkaccelmap.h"
 #include "gtkbox.h"
+#include "gtkclipboard.h"
 #include "gtkdnd.h"
 #include "gtkversion.h"
 #include "gtkmain.h"
@@ -607,7 +610,9 @@ gtk_disable_setlocale (void)
   do_setlocale = FALSE;
 }
 
+#ifdef G_PLATFORM_WIN32
 #undef gtk_init_check
+#endif
 
 static void
 default_display_notify_cb (GdkDisplayManager *display_manager)
@@ -655,7 +660,7 @@ display_opened_cb (GdkDisplayManager *display_manager,
 }
 
 /**
- * gdk_parse_args:
+ * gtk_parse_args:
  * @argc: a pointer to the number of command line arguments.
  * @argv: a pointer to the array of command line arguments.
  * 
@@ -663,7 +668,7 @@ display_opened_cb (GdkDisplayManager *display_manager,
  * attributes of GTK+, but does not actually open a connection
  * to a display. (See gdk_display_open(), gdk_get_display_arg_name())
  *
- * Any arguments used by GTK or GDK are removed from the array and
+ * Any arguments used by GTK+ or GDK are removed from the array and
  * @argc and @argv are updated accordingly.
  *
  * You shouldn't call this function explicitely if you are using
@@ -889,7 +894,9 @@ gtk_parse_args (int    *argc,
   return TRUE;
 }
 
+#ifdef G_PLATFORM_WIN32
 #undef gtk_init_check
+#endif
 
 /**
  * gtk_init_check:
@@ -918,7 +925,9 @@ gtk_init_check (int  *argc,
   return gdk_display_open_default_libgtk_only () != NULL;
 }
 
+#ifdef G_PLATFORM_WIN32
 #undef gtk_init
+#endif
 
 /**
  * gtk_init:
@@ -1437,6 +1446,12 @@ gtk_main_do_event (GdkEvent *event)
       return;
     }
 
+  if (event->type == GDK_OWNER_CHANGE)
+    {
+      _gtk_clipboard_handle_event (&event->owner_change);
+      return;
+    }
+
   /* Find the widget which got the event. We store the widget
    *  in the user_data field of GdkWindow's.
    *  Ignore the event if we don't have a widget for it, except
@@ -1681,8 +1696,8 @@ gtk_grab_notify_foreach (GtkWidget *child,
   if (was_grabbed != is_grabbed)
     {
       g_object_ref (child);
-      
-      g_signal_emit_by_name (child, "grab_notify", was_grabbed);
+
+      _gtk_widget_grab_notify (child, was_grabbed);
       
       if (GTK_IS_CONTAINER (child))
        gtk_container_foreach (GTK_CONTAINER (child), gtk_grab_notify_foreach, info);
@@ -2331,8 +2346,17 @@ gtk_propagate_event (GtkWidget *widget,
       while (TRUE)
        {
          GtkWidget *tmp;
-         
-         handled_event = !GTK_WIDGET_IS_SENSITIVE (widget) || gtk_widget_event (widget, event);
+
+         /* Scroll events are special cased here because it
+          * feels wrong when scrolling a GtkViewport, say,
+          * to have children of the viewport eat the scroll
+          * event
+          */
+         if (!GTK_WIDGET_IS_SENSITIVE (widget))
+           handled_event = event->type != GDK_SCROLL;
+         else
+           handled_event = gtk_widget_event (widget, event);
+             
          tmp = widget->parent;
          g_object_unref (widget);