~ubuntu-desktop/gnome-keyring/ubuntu

« back to all changes in this revision

Viewing changes to debian/patches/05_grab_tracking.patch

  • Committer: Michael Terry
  • Date: 2012-04-09 18:14:05 UTC
  • mfrom: (72.1.1 ubuntu)
  • Revision ID: michael.terry@canonical.com-20120409181405-vafxo7laiwtjo6at
Tags: 3.2.2-2ubuntu3
debian/patches/05_grab_tracking.patch: track when we ungrabbed the keyboard
because the window state changed so that we only re-grab it when
we had initially ungrabbed it for this reason. (LP: #931958)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: gnome-keyring-3.2.2/ui/gku-prompt-tool.c
 
2
===================================================================
 
3
--- gnome-keyring-3.2.2.orig/ui/gku-prompt-tool.c       2011-11-14 18:27:43.000000000 +0800
 
4
+++ gnome-keyring-3.2.2/ui/gku-prompt-tool.c    2012-04-03 15:45:40.338888289 +0800
 
5
@@ -201,9 +201,15 @@
 
6
            state & GDK_WINDOW_STATE_ICONIFIED ||
 
7
            state & GDK_WINDOW_STATE_FULLSCREEN ||
 
8
            state & GDK_WINDOW_STATE_MAXIMIZED)
 
9
+       {
 
10
+               g_object_set_data (G_OBJECT (win), "grab-disabled", GINT_TO_POINTER (1));
 
11
                ungrab_keyboard (win, (GdkEvent*)event, data);
 
12
-       else
 
13
+       }
 
14
+       else if (g_object_get_data (G_OBJECT (win), "grab-disabled") == GPOINTER_TO_INT (1))
 
15
+       {
 
16
+               g_object_set_data (G_OBJECT (win), "grab-disabled", GINT_TO_POINTER (0));
 
17
                grab_keyboard (win, (GdkEvent*)event, data);
 
18
+       }
 
19
 
 
20
        return FALSE;
 
21
 }
 
22
@@ -465,6 +471,7 @@
 
23
         * When passwords are involved we grab the keyboard so that people
 
24
         * don't accidentally type their passwords in other windows.
 
25
         */
 
26
+       g_object_set_data (G_OBJECT (dialog), "grab-disabled", GINT_TO_POINTER (0));
 
27
        g_signal_connect (dialog, "map-event", G_CALLBACK (grab_keyboard), NULL);
 
28
        g_signal_connect (dialog, "unmap-event", G_CALLBACK (ungrab_keyboard), NULL);
 
29
        g_signal_connect (dialog, "window-state-event", G_CALLBACK (window_state_changed), NULL);