#include "gtkmain.h"
#include <glib.h>
-#include "gdkconfig.h"
+#include "gdk/gdk.h"
#include <locale.h>
#include "gtkselection.h"
#include "gtksettings.h"
#include "gtkwidgetprivate.h"
-#include "gtkwindow.h"
+#include "gtkwindowprivate.h"
#include "gtktooltip.h"
#include "gtkdebug.h"
#include "gtkmenu.h"
-#include "gdk/gdkkeysyms.h"
#ifdef G_OS_WIN32
g_type_init ();
_gtk_accel_map_init ();
- _gtk_rc_init ();
/* Set the 'initialized' flag.
*/
/**
* gtk_get_debug_flags:
*
- * Returns the GTK+ debug flags setting.
+ * Returns the GTK+ debug flags.
+ *
+ * This function is intended for GTK+ modules that want
+ * to adjust their debug output based on GTK+ debug flags.
+ *
+ * Returns: the GTK+ debug flags.
*/
guint
gtk_get_debug_flags (void)
if (device)
grab_widget = gtk_window_group_get_current_device_grab (window_group, device);
- if (!grab_widget && window_group->grabs)
- grab_widget = window_group->grabs->data;
+ if (!grab_widget)
+ grab_widget = gtk_window_group_get_current_grab (window_group);
/* If the grab widget is an ancestor of the event widget
* then we send the event to the original event widget.
case GDK_DELETE:
g_object_ref (event_widget);
- if ((!window_group->grabs || gtk_widget_get_toplevel (window_group->grabs->data) == event_widget) &&
+ if ((!gtk_window_group_get_current_grab (window_group) || gtk_widget_get_toplevel (gtk_window_group_get_current_grab (window_group)) == event_widget) &&
!gtk_widget_event (event_widget, event))
gtk_widget_destroy (event_widget);
g_object_unref (event_widget);
{
/* The app may paint with a previously allocated cairo_t,
which will draw directly to the window. We can't catch cairo
- drap operatoins to automatically flush the window, thus we
+ draw operations to automatically flush the window, thus we
need to explicitly flush any outstanding moves or double
buffering */
gdk_window_flush (event->any.window);
if (!gtk_widget_has_grab (widget) && gtk_widget_is_sensitive (widget))
{
_gtk_widget_set_has_grab (widget, TRUE);
-
+
group = gtk_main_get_window_group (widget);
- if (group->grabs)
- old_grab_widget = (GtkWidget *)group->grabs->data;
- else
- old_grab_widget = NULL;
+ old_grab_widget = gtk_window_group_get_current_grab (group);
g_object_ref (widget);
- group->grabs = g_slist_prepend (group->grabs, widget);
+ _gtk_window_group_add_grab (group, widget);
gtk_grab_notify (group, NULL, old_grab_widget, widget, TRUE);
}
group = gtk_main_get_window_group (NULL);
- if (group->grabs)
- return GTK_WIDGET (group->grabs->data);
- return NULL;
+ return gtk_window_group_get_current_grab (group);
}
void
_gtk_widget_set_has_grab (widget, FALSE);
group = gtk_main_get_window_group (widget);
- group->grabs = g_slist_remove (group->grabs, widget);
-
- if (group->grabs)
- new_grab_widget = (GtkWidget *)group->grabs->data;
- else
- new_grab_widget = NULL;
+ _gtk_window_group_remove_grab (group, widget);
+ new_grab_widget = gtk_window_group_get_current_grab (group);
gtk_grab_notify (group, NULL, widget, new_grab_widget, FALSE);
-
+
g_object_unref (widget);
}
}