Added config option to set cc exclusive zone (#321)

This commit is contained in:
Erik Reider 2023-09-27 00:43:54 +02:00 committed by GitHub
parent 0d368c2f07
commit 90688d0fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -68,6 +68,13 @@ config file to be able to detect config errors
description: Layer of control center window relative to normal windows. ++
background is below all windows, overlay is above all windows.
*control-center-exclusive-zone* ++
type: bool ++
default: true ++
description: Whether or not the control center should follow the ++
compositors exclusive zones. An example would be setting it to ++
*false* to cover your panel/dock.
*notification-2fa-action* ++
type: bool ++
default: true ++

View File

@ -467,6 +467,10 @@ namespace SwayNotificationCenter {
get; set; default = Layer.TOP;
}
public bool control_center_exclusive_zone {
get; set; default = true;
}
/** Categories settings */
public OrderedHashTable<Category> categories_settings {
get;

View File

@ -75,6 +75,11 @@
"default": "none",
"enum": ["background", "bottom", "top", "overlay", "none"]
},
"control-center-exclusive-zone": {
"type": "boolean",
"description": "Whether or not the control center should follow the compositors exclusive zones. An example would be setting it to \"false\" to cover your panel/dock.",
"default": true
},
"notification-2fa-action": {
"type": "boolean",
"description": "If each notification should display a 'COPY \"1234\"' action",

View File

@ -270,6 +270,9 @@ namespace SwayNotificationCenter {
/** Resets the UI positions */
private void set_anchor () {
if (swaync_daemon.use_layer_shell) {
// Set the exlusive zone
int exclusive_zone = ConfigModel.instance.control_center_exclusive_zone ? 0 : 100;
GtkLayerShell.set_exclusive_zone (this, exclusive_zone);
// Grabs the keyboard input until closed
bool keyboard_shortcuts = ConfigModel.instance.keyboard_shortcuts;
#if HAVE_LATEST_GTK_LAYER_SHELL