From: Daniel Déchelotte <[email protected]>

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.
---
 src/dock.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/dock.c b/src/dock.c
index 64d4ee3..10a75d2 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -622,11 +622,12 @@ 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 < wks_info.workspace_count; i++)
-                               wks_info.workspaces[i]->clip->attract_icons = 
False;
-                               /* dock menu will be updated later, when opened 
*/
-
+                       if (!wPreferences.flags.noclip) {
+                               int i;
+                               for (i = 0; i < wks_info.workspace_count; i++)
+                                       
wks_info.workspaces[i]->clip->attract_icons = False;
+                                       /* dock menu will be updated later, 
when opened */
+                       }
                        if (scr->attracting_drawer != NULL)
                                scr->attracting_drawer->attract_icons = False;
                        scr->attracting_drawer = dock;
-- 
1.7.10.4


-- 
To unsubscribe, send mail to [email protected].

Reply via email to