Merge lp:~marmuta/unity-greeter/onboard-keep-focus into lp:unity-greeter

Proposed by marmuta
Status: Merged
Merged at revision: 369
Proposed branch: lp:~marmuta/unity-greeter/onboard-keep-focus
Merge into: lp:unity-greeter
Diff against target: 47 lines (+17/-3)
2 files modified
src/unity-greeter.vala (+11/-2)
src/user-list.vala (+6/-1)
To merge this branch: bzr merge lp:~marmuta/unity-greeter/onboard-keep-focus
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+98666@code.launchpad.net

Description of the change

Hi all,
here is a fix for Bug #878184 to allow entering the password with onboard again. I just had to keep the input focus on the passwork entry.
Have a look, please.

To post a comment you must log in.
364. By marmuta

Keep the input focus on prompt_entry when starting Onboard (LP #878184)

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Thanks, will review this next week.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Thanks for that. I can confirm the patch works. It's a bit weird to explicitly focus on the user list if the new window is not focusable, but as it doesn't work without it and the feature is quite important I'll take it as it is. I've pushed with some minor code style changes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-greeter.vala'
2--- src/unity-greeter.vala 2012-03-20 06:48:59 +0000
3+++ src/unity-greeter.vala 2012-03-21 16:13:21 +0000
4@@ -678,13 +678,22 @@
5 }
6 }
7
8- private static Gdk.FilterReturn focus_upon_map (X.Event xevent, Gdk.Event event)
9+ private Gdk.FilterReturn focus_upon_map (X.Event xevent, Gdk.Event event)
10 {
11 if (xevent.type == X.EventType.MapNotify)
12 {
13 var display = Gdk.Display.get_default ();
14 var win = Gdk.X11Window.foreign_new_for_display (display, xevent.xmap.window);
15- win.focus(Gdk.CURRENT_TIME);
16+
17+ /* Focus windows that like to be focused (Onboard doesn't) */
18+ if (win.get_accept_focus())
19+ {
20+ win.focus(Gdk.CURRENT_TIME);
21+ }
22+ else
23+ {
24+ user_list.focus_prompt ();
25+ }
26 }
27 return Gdk.FilterReturn.CONTINUE;
28 }
29
30=== modified file 'src/user-list.vala'
31--- src/user-list.vala 2012-03-14 17:24:15 +0000
32+++ src/user-list.vala 2012-03-21 16:13:21 +0000
33@@ -371,8 +371,13 @@
34 else
35 accessible.set_name (_("Enter password"));
36 }
37+ focus_prompt ();
38+ redraw_login_box ();
39+ }
40+
41+ public void focus_prompt ()
42+ {
43 prompt_entry.grab_focus ();
44- redraw_login_box ();
45 }
46
47 public void show_authenticated (bool successful = true)

Subscribers

People subscribed via source and target branches