[gtk+/sdk/2965: 2/30] main: don't grab offscreen widgets



commit 5685cf61a8b637cc55e770ed56c32fb4b58aa416
Author: Cody Russell <bratsche gnome org>
Date:   Fri May 9 14:02:37 2014 -0700

    main: don't grab offscreen widgets
    
    Taken from Debian

 gtk/gtkmain.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index f50025e..cb7f585 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -2068,9 +2068,14 @@ gtk_grab_add (GtkWidget *widget)
 {
   GtkWindowGroup *group;
   GtkWidget *old_grab_widget;
+  GtkWidget *toplevel;
 
   g_return_if_fail (widget != NULL);
 
+  toplevel = gtk_widget_get_toplevel (widget);
+  if (toplevel && gdk_window_get_window_type (gtk_widget_get_window (toplevel)) == GDK_WINDOW_OFFSCREEN)
+    return;
+
   if (!gtk_widget_has_grab (widget) && gtk_widget_is_sensitive (widget))
     {
       _gtk_widget_set_has_grab (widget, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]