mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
Restore proper drawer direction when screen was resized
Since 48d4820dee the dock is positioned
dynamically based on the screen midpoint.
The side issue using such method is if in case the screen was temporarily
resized the dock as a chance to be displayed on the other side making
the drawer saved configuration from WMState esp the direction wrong when
wm is started again.
For example, the dock and drawer are displayed on the right of the screen.
Then the screen resolution is downsized temporaily to half or less of
the previous size. The position stored in WMState will be updated and the
direction of the drawer is still opening on the left.
But on next wm start, when reading the conf.
The position of the dock and drawer are corresponding to the
middle or less of the unresized screen. The dock and drawer will be sticked
on the left. But the drawer direction was not updated and still opening
on the left (which is out of the screen).
This commit is contained in:
committed by
Carlos R. Mafra
parent
9831e3f72a
commit
86b7ec1a58
@@ -4926,6 +4926,13 @@ static WDock * drawerRestoreState(WScreen *scr, WMPropList *drawer_state)
|
||||
drawer->icon_array[drawer->icon_count] = aicon;
|
||||
|
||||
if (aicon) {
|
||||
/* don't trust the stored direction sign as the dock is
|
||||
* dynamically positioned depending on the screen size
|
||||
*/
|
||||
if (drawer->screen_ptr->dock->on_right_side)
|
||||
aicon->xindex = -abs(aicon->xindex);
|
||||
else
|
||||
aicon->xindex = abs(aicon->xindex);
|
||||
aicon->dock = drawer;
|
||||
aicon->x_pos = drawer->x_pos + (aicon->xindex * ICON_SIZE);
|
||||
aicon->y_pos = drawer->y_pos + (aicon->yindex * ICON_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user