Skip to content

Commit c6a68a8

Browse files
committed
Work around X blockage
1 parent 1e8438e commit c6a68a8

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/ShellClients/ShellClientsManager.vala

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,27 @@ public class Gala.ShellClientsManager : Object {
226226

227227
switch (key) {
228228
case "anchor":
229-
int parsed; // Will be used as Pantheon.Desktop.Anchor which is a 4 value enum so check bounds for that
230-
if (int.try_parse (val, out parsed) && 0 <= parsed && parsed <= 3) {
229+
int meta_side_parsed; // Will be used as Meta.Side which is a 4 value bitfield so check bounds for that
230+
if (int.try_parse (val, out meta_side_parsed) && 0 <= meta_side_parsed && meta_side_parsed <= 15) {
231+
//FIXME: Next major release change dock and wingpanel calls to get rid of this
232+
Pantheon.Desktop.Anchor parsed = TOP;
233+
switch ((Meta.Side) meta_side_parsed) {
234+
case BOTTOM:
235+
parsed = BOTTOM;
236+
break;
237+
238+
case LEFT:
239+
parsed = LEFT;
240+
break;
241+
242+
case RIGHT:
243+
parsed = RIGHT;
244+
break;
245+
246+
default:
247+
break;
248+
}
249+
231250
set_anchor (window, parsed);
232251
// We need to set a second time because the intention is to call this before the window is shown which it is on wayland
233252
// but on X the window was already shown when we get here so we have to call again to instantly apply it.

0 commit comments

Comments
 (0)