* int
* main (int argc, char **argv)
* {
- * /* Initialize i18n support */
- * gtk_set_locale ();
+ * /* Initialize i18n support with bindtextdomain(), etc. */
+ * ...
*
* /* Initialize the widget set */
* gtk_init (&argc, &argv);
#include "gtkwidgetprivate.h"
#include "gtkwindowprivate.h"
-#include "a11y/gailutil.h"
+#include "a11y/gtkaccessibility.h"
/* Private type definitions
*/
{"printing", GTK_DEBUG_PRINTING},
{"builder", GTK_DEBUG_BUILDER},
{"size-request", GTK_DEBUG_SIZE_REQUEST},
+ {"no-css-cache", GTK_DEBUG_NO_CSS_CACHE}
};
#endif /* G_ENABLE_DEBUG */
#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)
_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.
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 ();
}
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 ();
}
}
{
gboolean result;
- GDK_THREADS_LEAVE ();
+ gdk_threads_leave ();
result = g_main_context_pending (NULL);
- GDK_THREADS_ENTER ();
+ gdk_threads_enter ();
return result;
}
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);
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);
* </para></listitem>
* <listitem><para>
* 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.
* </para></listitem>
* <listitem><para>
* Then the event is pushed onto a stack so you can query the currently
* 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;
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 */
/**
* 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
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)
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);
}