mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-18 12:00:31 +01:00
Keep dock on primary head if KeepDockOnPrimaryHead is YES
This implements a feature request [1] to allow the possibility of keeping the dock on the primary head on a multi-head system. In particular, if the new KeepDockOnPrimaryHead option is set to YES, the dock will either be on the left- or right-hand side of the primary screen. If it is NO, then we get the current behavior, i.e., the dock will either be on the left-hand side of the leftmost head or the right-hand side of the rightmost head. [1] https://github.com/window-maker/wmaker/issues/24 Closes: #24
This commit is contained in:
committed by
Carlos R. Mafra
parent
7639fa1c15
commit
55a816bdbc
21
src/dock.c
21
src/dock.c
@@ -3009,12 +3009,25 @@ static void swapDock(WDock *dock)
|
||||
WAppIcon *btn;
|
||||
int x, i;
|
||||
|
||||
if (dock->on_right_side)
|
||||
x = dock->x_pos = scr->scr_width - ICON_SIZE - DOCK_EXTRA_SPACE;
|
||||
else
|
||||
x = dock->x_pos = DOCK_EXTRA_SPACE;
|
||||
|
||||
if (wPreferences.keep_dock_on_primary_head) {
|
||||
WMRect rect;
|
||||
|
||||
rect = wGetRectForHead(scr, scr->xine_info.primary_head);
|
||||
x = rect.pos.x;
|
||||
if (dock->on_right_side)
|
||||
x += rect.size.width - ICON_SIZE - DOCK_EXTRA_SPACE;
|
||||
else
|
||||
x += DOCK_EXTRA_SPACE;
|
||||
} else {
|
||||
if (dock->on_right_side)
|
||||
x = scr->scr_width - ICON_SIZE - DOCK_EXTRA_SPACE;
|
||||
else
|
||||
x = DOCK_EXTRA_SPACE;
|
||||
}
|
||||
|
||||
swapDrawers(scr, x);
|
||||
dock->x_pos = x;
|
||||
|
||||
for (i = 0; i < dock->max_icons; i++) {
|
||||
btn = dock->icon_array[i];
|
||||
|
||||
Reference in New Issue
Block a user