~seyeongkim/unity-greeter/lp1240088

« back to all changes in this revision

Viewing changes to debian/patches/dont-focus-destroyed-window.patch

  • Committer: Robert Ancell
  • Date: 2014-04-30 03:29:19 UTC
  • Revision ID: robert.ancell@canonical.com-20140430032919-efao40vg6l0nnjil
initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: unity-greeter-0.2.9/src/unity-greeter.vala
 
2
===================================================================
 
3
--- unity-greeter-0.2.9.orig/src/unity-greeter.vala     2012-11-21 15:24:50.000000000 +1300
 
4
+++ unity-greeter-0.2.9/src/unity-greeter.vala  2014-04-09 13:57:31.509980391 +1200
 
5
@@ -734,19 +734,21 @@
 
6
             var display = Gdk.x11_lookup_xdisplay (xevent.xmap.display);
 
7
             var xwin = xevent.xmap.window;
 
8
             var win = Gdk.X11Window.foreign_new_for_display (display, xwin);
 
9
-
 
10
-            /* Check to see if this window is our onboard window, since we don't want to focus it. */
 
11
-            X.Window keyboard_xid = 0;
 
12
-            if (main_window.menubar.keyboard_window != null)
 
13
-                keyboard_xid = Gdk.X11Window.get_xid (main_window.menubar.keyboard_window.get_window ());
 
14
-
 
15
-            if (xwin != keyboard_xid && win.get_type_hint() != Gdk.WindowTypeHint.NOTIFICATION)
 
16
+            if (win != null)
 
17
             {
 
18
-                win.focus (Gdk.CURRENT_TIME);
 
19
-
 
20
-                /* Make sure to keep keyboard above */
 
21
+                /* Check to see if this window is our onboard window, since we don't want to focus it. */
 
22
+                X.Window keyboard_xid = 0;
 
23
                 if (main_window.menubar.keyboard_window != null)
 
24
-                    main_window.menubar.keyboard_window.get_window ().raise ();
 
25
+                    keyboard_xid = Gdk.X11Window.get_xid (main_window.menubar.keyboard_window.get_window ());
 
26
+
 
27
+                if (xwin != keyboard_xid && win.get_type_hint() != Gdk.WindowTypeHint.NOTIFICATION)
 
28
+                {
 
29
+                    win.focus (Gdk.CURRENT_TIME);
 
30
+
 
31
+                    /* Make sure to keep keyboard above */
 
32
+                    if (main_window.menubar.keyboard_window != null)
 
33
+                        main_window.menubar.keyboard_window.get_window ().raise ();
 
34
+                }
 
35
             }
 
36
         }
 
37
         else if (xevent.type == X.EventType.UnmapNotify)