Skip to content

Commit 7861903

Browse files
committed
Implement actual positioning logic
1 parent 03fdf54 commit 7861903

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/ShellClients/PositionedWindow.vala

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ public class Gala.PositionedWindow : Object {
99
public enum Position {
1010
TOP,
1111
BOTTOM,
12-
CENTER;
12+
CENTER,
13+
MONITOR_LABEL;
1314

1415
public static Position from_anchor (Pantheon.Desktop.Anchor anchor) {
1516
if (anchor > 1) {
@@ -71,6 +72,17 @@ public class Gala.PositionedWindow : Object {
7172
x = monitor_geom.x + (monitor_geom.width - window_rect.width) / 2;
7273
y = monitor_geom.y + monitor_geom.height - window_rect.height;
7374
break;
75+
76+
case MONITOR_LABEL:
77+
if (position_data == null || !position_data.is_of_type (VariantType.INT32)) {
78+
warning ("Invalid position data for MONITOR_LABEL");
79+
return;
80+
}
81+
82+
var geom = window.get_workspace ().get_work_area_for_monitor (position_data.get_int32 ());
83+
x = geom.x + 12;
84+
y = geom.y + 12;
85+
break;
7486
}
7587

7688
window.move_frame (false, x, y);

0 commit comments

Comments
 (0)