From 515eb652c7a8a132f3b389d111a6233e14a19f6a Mon Sep 17 00:00:00 2001 From: "Torrance, Douglas" Date: Wed, 18 Jan 2023 11:42:59 +0000 Subject: [PATCH] Update the dock position when "KeepDockOnPrimaryHead" is changed --- src/defaults.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/defaults.c b/src/defaults.c index 00c05d2c..469809f1 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -154,6 +154,7 @@ static WDECallbackUpdate setModifierKeyLabels; static WDECallbackConvert getCursor; static WDECallbackUpdate setCursor; +static WDECallbackUpdate updateDock ; /* * Tables to convert strings to enumeration values. @@ -522,7 +523,8 @@ WDefaultEntry optionList[] = { {"IgnoreGtkHints", "NO", NULL, &wPreferences.ignore_gtk_decoration_hints, getBool, NULL, NULL, NULL}, {"KeepDockOnPrimaryHead", "NO", NULL, - &wPreferences.keep_dock_on_primary_head, getBool, NULL, NULL, NULL}, + &wPreferences.keep_dock_on_primary_head, getBool, updateDock, + NULL, NULL}, /* style options */ @@ -3485,3 +3487,15 @@ static int setCursor(WScreen * scr, WDefaultEntry * entry, void *tdata, void *ex return 0; } + +static int updateDock(WScreen * scr, WDefaultEntry * entry, + void *tdata, void *extra_data) { + (void) entry; + (void) tdata; + (void) extra_data; + + if (scr->dock) + wDockSwap(scr->dock); + + return 0; +}