mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
Prevent crash when toggling auto-attract on a drawer with clip disabled
toggleAutoAttractCallback needs to check whether there are clips before iterating through them (or it crashes WM!). The extra test is needed because now drawers can auto-attract as well. Before drawers, only clips could auto-attract, so testing wPreferences.flags.noclip was pointless.
This commit is contained in:
committed by
Carlos R. Mafra
parent
4d74b18987
commit
40231016f9
11
src/dock.c
11
src/dock.c
@@ -619,10 +619,13 @@ static void toggleAutoAttractCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
if (dock->type == WM_DRAWER) {
|
if (dock->type == WM_DRAWER) {
|
||||||
/* The newly auto-attracting dock is a drawer: disable any clip and
|
/* The newly auto-attracting dock is a drawer: disable any clip and
|
||||||
* previously attracting drawer */
|
* previously attracting drawer */
|
||||||
int i;
|
|
||||||
for (i = 0; i < w_global.workspace.count; i++)
|
if (!wPreferences.flags.noclip) {
|
||||||
w_global.workspace.array[i]->clip->attract_icons = False;
|
int i;
|
||||||
/* dock menu will be updated later, when opened */
|
for (i = 0; i < w_global.workspace.count; i++)
|
||||||
|
w_global.workspace.array[i]->clip->attract_icons = False;
|
||||||
|
/* dock menu will be updated later, when opened */
|
||||||
|
}
|
||||||
|
|
||||||
if (scr->attracting_drawer != NULL)
|
if (scr->attracting_drawer != NULL)
|
||||||
scr->attracting_drawer->attract_icons = False;
|
scr->attracting_drawer->attract_icons = False;
|
||||||
|
|||||||
Reference in New Issue
Block a user