Commit 15e86473 authored by Erik Reider's avatar Erik Reider

Fixed Layer shell Protocol error when cover screen is disabled

Older versions of gtk4-layer-shell produce a Wayland protocol error
parent f0268d71
...@@ -408,14 +408,16 @@ namespace SwayNotificationCenter { ...@@ -408,14 +408,16 @@ namespace SwayNotificationCenter {
// Set whether the control center should cover the whole screen or not // Set whether the control center should cover the whole screen or not
bool cover_screen = ConfigModel.instance.layer_shell_cover_screen; bool cover_screen = ConfigModel.instance.layer_shell_cover_screen;
if (cover_screen) {
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, cover_screen); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, cover_screen);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, cover_screen); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, cover_screen);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.RIGHT, cover_screen); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.RIGHT, cover_screen);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, cover_screen); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, cover_screen);
if (!ConfigModel.instance.layer_shell_cover_screen) { } else {
switch (pos_x) { switch (pos_x) {
case PositionX.LEFT: case PositionX.LEFT:
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, true);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.RIGHT, false);
break; break;
case PositionX.CENTER: case PositionX.CENTER:
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, true);
...@@ -423,6 +425,7 @@ namespace SwayNotificationCenter { ...@@ -423,6 +425,7 @@ namespace SwayNotificationCenter {
break; break;
default: default:
case PositionX.RIGHT: case PositionX.RIGHT:
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, false);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.RIGHT, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.RIGHT, true);
break; break;
} }
...@@ -434,12 +437,14 @@ namespace SwayNotificationCenter { ...@@ -434,12 +437,14 @@ namespace SwayNotificationCenter {
default: default:
case PositionY.TOP: case PositionY.TOP:
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, false);
break; break;
case PositionY.CENTER: case PositionY.CENTER:
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, true);
break; break;
case PositionY.BOTTOM: case PositionY.BOTTOM:
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, false);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, true);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment