Merge lp:~mterry/unity-greeter/move-names-after-monitor-switch into lp:unity-greeter

Proposed by Michael Terry
Status: Merged
Approved by: Robert Ancell
Approved revision: 577
Merged at revision: 580
Proposed branch: lp:~mterry/unity-greeter/move-names-after-monitor-switch
Merge into: lp:unity-greeter
Diff against target: 28 lines (+6/-2)
1 file modified
src/greeter-list.vala (+6/-2)
To merge this branch: bzr merge lp:~mterry/unity-greeter/move-names-after-monitor-switch
Reviewer Review Type Date Requested Status
Unity Greeter Development Team Pending
Review via email: mp+124483@code.launchpad.net

Description of the change

This fixes the problem where after switching to a different monitor, the names in the user list would get screwed up, position-wise.

It moves the names after a size allocate. And it also fixes an issue with name allocation, where we weren't taking the existing allocation.x/allocation.y into account. This didn't matter before, but when allocating inside an existing allocation, it does matter. (I'm not entirely sure why GTK does that magic for us when not inside an allocation.)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/greeter-list.vala'
2--- src/greeter-list.vala 2012-09-04 13:35:33 +0000
3+++ src/greeter-list.vala 2012-09-14 17:27:18 +0000
4@@ -464,11 +464,14 @@
5 /* Some entry types may care where they are (e.g. wifi prompt) */
6 entry.position = position;
7
8+ Gtk.Allocation allocation;
9+ get_allocation (out allocation);
10+
11 var child_allocation = Gtk.Allocation ();
12 child_allocation.width = grid_size * BOX_WIDTH - BORDER * 2;
13 entry.get_preferred_height_for_width (child_allocation.width, null, out child_allocation.height);
14- child_allocation.x = get_greeter_box_x ();
15- child_allocation.y = get_position_y (position);
16+ child_allocation.x = allocation.x + get_greeter_box_x ();
17+ child_allocation.y = allocation.y + get_position_y (position);
18 fixed.move (entry, child_allocation.x, child_allocation.y);
19 entry.size_allocate (child_allocation);
20 entry.show ();
21@@ -642,6 +645,7 @@
22 return;
23
24 allocate_greeter_box ();
25+ move_names ();
26 }
27
28 public override bool draw (Cairo.Context c)

Subscribers

People subscribed via source and target branches