X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkmain.c;h=f5b4c5a520fcab8e9317930f1a416597990c8b45;hb=32825a66ac8e65bf98cafed26a339fa1f31eddd4;hp=c9f91736b7d5e0e275ea3f81ee62234ae3bdfea4;hpb=793748eaddd4675e9e3289c67ae27d6098882db0;p=~andy%2Fgtk diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index c9f91736b..f5b4c5a52 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -128,7 +128,7 @@ #include "gtkwidgetprivate.h" #include "gtkwindowprivate.h" -#include "a11y/gailutil.h" +#include "a11y/gtkaccessibility.h" /* Private type definitions */ @@ -669,9 +669,6 @@ gettext_initialization (void) #endif } -/* XXX: Remove me after getting rid of gail */ -extern void _gtk_accessibility_init (void); - static void do_post_parse_initialization (int *argc, char ***argv) @@ -712,9 +709,6 @@ do_post_parse_initialization (int *argc, _gtk_register_resource (); - /* do what the call to gtk_type_init() used to do */ - g_type_init (); - _gtk_accel_map_init (); /* Set the 'initialized' flag. @@ -1158,9 +1152,9 @@ gtk_main (void) if (g_main_loop_is_running (main_loops->data)) { - GDK_THREADS_LEAVE (); + gdk_threads_leave (); g_main_loop_run (loop); - GDK_THREADS_ENTER (); + gdk_threads_enter (); gdk_flush (); } @@ -1172,11 +1166,15 @@ gtk_main (void) if (gtk_main_loop_level == 0) { + /* Keep this section in sync with gtk_application_shutdown() */ + /* Try storing all clipboard data we have */ _gtk_clipboard_store_all (); /* Synchronize the recent manager singleton */ _gtk_recent_manager_sync (); + + _gtk_accessibility_shutdown (); } } @@ -1235,9 +1233,9 @@ gtk_events_pending (void) { gboolean result; - GDK_THREADS_LEAVE (); + gdk_threads_leave (); result = g_main_context_pending (NULL); - GDK_THREADS_ENTER (); + gdk_threads_enter (); return result; } @@ -1258,9 +1256,9 @@ gtk_events_pending (void) gboolean gtk_main_iteration (void) { - GDK_THREADS_LEAVE (); + gdk_threads_leave (); g_main_context_iteration (NULL, TRUE); - GDK_THREADS_ENTER (); + gdk_threads_enter (); if (main_loops) return !g_main_loop_is_running (main_loops->data); @@ -1282,9 +1280,9 @@ gtk_main_iteration (void) gboolean gtk_main_iteration_do (gboolean blocking) { - GDK_THREADS_LEAVE (); + gdk_threads_leave (); g_main_context_iteration (NULL, blocking); - GDK_THREADS_ENTER (); + gdk_threads_enter (); if (main_loops) return !g_main_loop_is_running (main_loops->data); @@ -1441,8 +1439,7 @@ rewrite_event_for_grabs (GdkEvent *event) * * * Find the widget which got the event. If the widget can't be determined - * the event is thrown away unless it belongs to a INCR transaction. In that - * case it is passed to gtk_selection_incr_event(). + * the event is thrown away unless it belongs to a INCR transaction. * * * Then the event is pushed onto a stack so you can query the currently @@ -1557,7 +1554,7 @@ gtk_main_do_event (GdkEvent *event) * This is the key to implementing modality. */ if (!grab_widget || - (gtk_widget_is_sensitive (event_widget) && + ((gtk_widget_is_sensitive (event_widget) || event->type == GDK_SCROLL) && gtk_widget_is_ancestor (event_widget, grab_widget))) grab_widget = event_widget; @@ -1699,7 +1696,12 @@ gtk_main_do_event (GdkEvent *event) window = gtk_widget_get_toplevel (grab_widget); if (GTK_IS_WINDOW (window)) - gtk_window_set_mnemonics_visible (GTK_WINDOW (window), mnemonics_visible); + { + if (mnemonics_visible) + _gtk_window_set_auto_mnemonics_visible (GTK_WINDOW (window)); + else + gtk_window_set_mnemonics_visible (GTK_WINDOW (window), FALSE); + } } } /* else fall through */ @@ -2108,7 +2110,7 @@ gtk_grab_remove (GtkWidget *widget) /** * gtk_device_grab_add: * @widget: a #GtkWidget - * @device: a #GtkDevice to grab on. + * @device: a #GdkDevice to grab on. * @block_others: %TRUE to prevent other devices to interact with @widget. * * Adds a GTK+ grab on @device, so all the events on @device and its @@ -2238,7 +2240,7 @@ gtk_invoke_key_snoopers (GtkWidget *grab_widget, GSList *slist; gint return_val = FALSE; - return_val = _gail_util_key_snooper (grab_widget, (GdkEventKey *) event); + return_val = _gtk_accessibility_key_snooper (grab_widget, (GdkEventKey *) event); slist = key_snoopers; while (slist && !return_val) @@ -2432,7 +2434,15 @@ propagate_event_down (GtkWidget *widget, widget = (GtkWidget *)l->data; if (!gtk_widget_is_sensitive (widget)) - handled_event = TRUE; + { + /* stop propagating on SCROLL, but don't handle the event, so it + * can propagate up again and reach its handling widget + */ + if (event->type == GDK_SCROLL) + break; + else + handled_event = TRUE; + } else handled_event = _gtk_widget_captured_event (widget, event); }