2005-05-26 [colin] 1.9.11cvs13
authorColin Leroy <colin@colino.net>
Thu, 26 May 2005 20:14:56 +0000 (20:14 +0000)
committerColin Leroy <colin@colino.net>
Thu, 26 May 2005 20:14:56 +0000 (20:14 +0000)
* src/plugins/pgpmime/passphrase.c
Fix mouse grabbing (bug #557)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/plugins/pgpmime/passphrase.c

index ac4263db09962209151ff0d4f1381176fbf0f7b6..c7e7feca96a30b8209cf9843139f3fc99f047528 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-26 [colin]     1.9.11cvs13
+
+       * src/plugins/pgpmime/passphrase.c
+               Fix mouse grabbing (bug #557)
+
 2005-05-26 [colin]     1.9.11cvs12
 
        * src/prefs_themes.c
index 171d6d3e9928715a021a21fe63f9a50b167c4c7f..f634328f492d52414282529c76ae2dc5b6f755ce 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.213.2.26 -r 1.213.2.27 src/folder.c; cvs diff -u -r 1.207.2.37 -r 1.207.2.38 src/folderview.c; cvs diff -u -r 1.150.2.25 -r 1.150.2.26 src/procmsg.c; cvs diff -u -r 1.395.2.69 -r 1.395.2.70 src/summaryview.c; ) > 1.9.11cvs10.patchset
 ( cvs diff -u -r 1.60.2.13 -r 1.60.2.14 src/prefs_actions.c; cvs diff -u -r 1.12.2.8 -r 1.12.2.9 src/prefs_template.c; cvs diff -u -r 1.2.4.5 -r 1.2.4.6 src/common/template.c; ) > 1.9.11cvs11.patchset
 ( cvs diff -u -r 1.3.2.18 -r 1.3.2.19 src/prefs_themes.c; ) > 1.9.11cvs12.patchset
+( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/plugins/pgpmime/passphrase.c; ) > 1.9.11cvs13.patchset
index 3a8e65c109d3833413ecdde5643333d62d1f0bb6..bad42ebbdc781216afc5414586f6c8467b954faa 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=12
+EXTRA_VERSION=13
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index dc69112e595fa21b458ed244476987c004462b5f..5ac4f2eca4ea98cce529a9e651fbdb6d6f67806a 100644 (file)
@@ -133,28 +133,29 @@ passphrase_mbox (const gchar *desc)
     gtk_widget_show_all(window);
 
     if (grab_all) {
-        /* make sure that window is viewable
-        * FIXME: this is still not enough */
+       int err, cnt = 0;
+try_again:
+       /* make sure that window is viewable */
         gtk_widget_show_now(window);
        gdk_flush();
-#ifdef GDK_WINDOWING_X11
-       gdk_x11_display_grab(gdk_display_get_default());
-#endif /* GDK_WINDOWING_X11 */
-        if (gdk_pointer_grab(window->window, TRUE, 0,
+       while(gtk_events_pending())
+               gtk_main_iteration();
+        if (err = gdk_pointer_grab(window->window, TRUE, 0,
                              window->window, NULL, GDK_CURRENT_TIME)) {
-#ifdef GDK_WINDOWING_X11
-            gdk_x11_display_ungrab(gdk_display_get_default());
-#endif /* GDK_WINDOWING_X11 */
-            g_warning("OOPS: Could not grab mouse\n");
-            gtk_widget_destroy(window);
-            return NULL;
+           if (err == GDK_GRAB_NOT_VIEWABLE && cnt < 10) {
+               /* HACK! */
+               cnt++;
+               g_warning("trying to grab mouse again\n");
+               goto try_again;
+           } else {
+               g_warning("OOPS: Could not grab mouse (%d)\n", err);
+               gtk_widget_destroy(window);
+               return NULL;
+           }
         }
         if (gdk_keyboard_grab(window->window, FALSE, GDK_CURRENT_TIME)) {
             gdk_display_pointer_ungrab(gdk_display_get_default(),
                                       GDK_CURRENT_TIME);
-#ifdef GDK_WINDOWING_X11
-            gdk_x11_display_ungrab(gdk_display_get_default());
-#endif /* GDK_WINDOWING_X11 */
             g_warning("OOPS: Could not grab keyboard\n");
             gtk_widget_destroy(window);
             return NULL;
@@ -167,9 +168,6 @@ passphrase_mbox (const gchar *desc)
         gdk_display_keyboard_ungrab(gdk_display_get_default(),
                                    GDK_CURRENT_TIME);
         gdk_display_pointer_ungrab(gdk_display_get_default(), GDK_CURRENT_TIME);
-#ifdef GDK_WINDOWING_X11
-        gdk_x11_display_ungrab(gdk_display_get_default());
-#endif /* GDK_WINDOWING_X11 */
         gdk_flush();
     }