1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58: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:
Daniel Déchelotte
2013-10-07 23:49:24 +02:00
committed by Carlos R. Mafra
parent 4d74b18987
commit 40231016f9

View File

@@ -619,10 +619,13 @@ static void toggleAutoAttractCallback(WMenu *menu, WMenuEntry *entry)
if (dock->type == WM_DRAWER) {
/* The newly auto-attracting dock is a drawer: disable any clip and
* previously attracting drawer */
int i;
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 (!wPreferences.flags.noclip) {
int i;
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)
scr->attracting_drawer->attract_icons = False;