@@ -394,6 +394,11 @@ namespace SwayNotificationCenter {
394394
395395 /* * Resets the UI positions */
396396 private void set_anchor () {
397+ PositionX pos_x = ConfigModel . instance. control_center_positionX;
398+ if (pos_x == PositionX . NONE ) pos_x = ConfigModel . instance. positionX;
399+ PositionY pos_y = ConfigModel . instance. control_center_positionY;
400+ if (pos_y == PositionY . NONE ) pos_y = ConfigModel . instance. positionY;
401+
397402 if (swaync_daemon. use_layer_shell) {
398403 // Set the exlusive zone
399404 int exclusive_zone = ConfigModel . instance. control_center_exclusive_zone ? 0 : 100 ;
@@ -423,6 +428,41 @@ namespace SwayNotificationCenter {
423428 break ;
424429 }
425430 GtkLayerShell . set_layer (this , layer);
431+
432+ // Set whether the control center should cover the whole screen or not
433+ bool cover_screen = ConfigModel . instance. layer_shell_cover_screen;
434+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . TOP , cover_screen);
435+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . LEFT , cover_screen);
436+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . RIGHT , cover_screen);
437+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . BOTTOM , cover_screen);
438+ if (! ConfigModel . instance. layer_shell_cover_screen) {
439+ switch (pos_x) {
440+ case PositionX . LEFT:
441+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . LEFT , true );
442+ break ;
443+ case PositionX . CENTER:
444+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . LEFT , true );
445+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . RIGHT , true );
446+ break ;
447+ default:
448+ case PositionX . RIGHT:
449+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . RIGHT , true );
450+ break ;
451+ }
452+ switch (pos_y) {
453+ default:
454+ case PositionY . TOP:
455+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . TOP , true );
456+ break ;
457+ case PositionY . CENTER:
458+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . TOP , true );
459+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . BOTTOM , true );
460+ break ;
461+ case PositionY . BOTTOM:
462+ GtkLayerShell . set_anchor (this , GtkLayerShell . Edge . BOTTOM , true );
463+ break ;
464+ }
465+ }
426466 }
427467
428468 // Set the box margins
@@ -433,8 +473,6 @@ namespace SwayNotificationCenter {
433473
434474 // Anchor box to north/south edges as needed
435475 Gtk . Align align_x = Gtk . Align . END ;
436- PositionX pos_x = ConfigModel . instance. control_center_positionX;
437- if (pos_x == PositionX . NONE ) pos_x = ConfigModel . instance. positionX;
438476 switch (pos_x) {
439477 case PositionX . LEFT:
440478 align_x = Gtk . Align . START ;
@@ -448,8 +486,6 @@ namespace SwayNotificationCenter {
448486 break ;
449487 }
450488 Gtk . Align align_y = Gtk . Align . START ;
451- PositionY pos_y = ConfigModel . instance. control_center_positionY;
452- if (pos_y == PositionY . NONE ) pos_y = ConfigModel . instance. positionY;
453489 switch (pos_y) {
454490 default:
455491 case PositionY . TOP:
0 commit comments