Merge lp:~robert-ancell/unity-greeter/focus-crash into lp:unity-greeter

Proposed by Robert Ancell
Status: Merged
Approved by: Robert Ancell
Approved revision: 1114
Merged at revision: 1114
Proposed branch: lp:~robert-ancell/unity-greeter/focus-crash
Merge into: lp:unity-greeter
Diff against target: 36 lines (+13/-11)
1 file modified
src/unity-greeter.vala (+13/-11)
To merge this branch: bzr merge lp:~robert-ancell/unity-greeter/focus-crash
Reviewer Review Type Date Requested Status
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+204738@code.launchpad.net

Commit message

Handle a window being destroyed after we get the map event and try and focus it

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/unity-greeter.vala'
--- src/unity-greeter.vala 2013-11-08 18:07:31 +0000
+++ src/unity-greeter.vala 2014-02-04 17:00:31 +0000
@@ -304,19 +304,21 @@
304 var display = Gdk.x11_lookup_xdisplay (xevent.xmap.display);304 var display = Gdk.x11_lookup_xdisplay (xevent.xmap.display);
305 var xwin = xevent.xmap.window;305 var xwin = xevent.xmap.window;
306 var win = Gdk.X11Window.foreign_new_for_display (display, xwin);306 var win = Gdk.X11Window.foreign_new_for_display (display, xwin);
307307 if (win != null)
308 /* Check to see if this window is our onboard window, since we don't want to focus it. */
309 X.Window keyboard_xid = 0;
310 if (main_window.menubar.keyboard_window != null)
311 keyboard_xid = Gdk.X11Window.get_xid (main_window.menubar.keyboard_window.get_window ());
312
313 if (xwin != keyboard_xid && win.get_type_hint() != Gdk.WindowTypeHint.NOTIFICATION)
314 {308 {
315 win.focus (Gdk.CURRENT_TIME);309 /* Check to see if this window is our onboard window, since we don't want to focus it. */
316310 X.Window keyboard_xid = 0;
317 /* Make sure to keep keyboard above */
318 if (main_window.menubar.keyboard_window != null)311 if (main_window.menubar.keyboard_window != null)
319 main_window.menubar.keyboard_window.get_window ().raise ();312 keyboard_xid = Gdk.X11Window.get_xid (main_window.menubar.keyboard_window.get_window ());
313
314 if (xwin != keyboard_xid && win.get_type_hint() != Gdk.WindowTypeHint.NOTIFICATION)
315 {
316 win.focus (Gdk.CURRENT_TIME);
317
318 /* Make sure to keep keyboard above */
319 if (main_window.menubar.keyboard_window != null)
320 main_window.menubar.keyboard_window.get_window ().raise ();
321 }
320 }322 }
321 }323 }
322 else if (xevent.type == X.EventType.UnmapNotify)324 else if (xevent.type == X.EventType.UnmapNotify)

Subscribers

People subscribed via source and target branches