Better locking for client menu.
authorMikael Magnusson <mikachu@comhem.se>
Thu, 28 Feb 2008 01:12:19 +0000 (02:12 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Sat, 11 Oct 2014 00:17:19 +0000 (02:17 +0200)
openbox/client_menu.c

index f34c8ef3f85f9408815a28cac562bddc26da74e0..f3ba870a2e0072b4d598f54891d50a68430bad91 100644 (file)
@@ -78,6 +78,10 @@ static gboolean client_menu_update(ObMenuFrame *frame, gpointer data)
         ObClient *c = frame->client;
 
         if (e->type == OB_MENU_ENTRY_TYPE_NORMAL) {
+            if (c->locked) {
+                *en = FALSE;
+                continue;
+            }
             switch (e->id) {
             case CLIENT_ICONIFY:
                 *en = c->functions & OB_CLIENT_FUNC_ICONIFY;
@@ -121,9 +125,6 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
     if (!c)
         return;
 
-    if (c->locked)
-        return;
-
     if (!config_focus_under_mouse)
         ignore_start = event_start_ignore_all_enters();
 
@@ -221,9 +222,6 @@ static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
 
     g_assert(c);
 
-    if (c->locked)
-        return;
-
     if (!config_focus_under_mouse)
         ignore_start = event_start_ignore_all_enters();
 
@@ -296,9 +294,6 @@ static void send_to_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
 {
     g_assert(c);
 
-    if (c->locked)
-        return;
-
     client_set_desktop(c, e->id, FALSE, FALSE);
     if (f && c->desktop != screen_desktop && c->desktop != DESKTOP_ALL)
         /* the client won't even be on the screen anymore, so hide the menu */