Better locking for client menu.
authorMikael Magnusson <mikachu@comhem.se>
Thu, 28 Feb 2008 01:12:19 +0000 (02:12 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Sat, 8 Mar 2008 16:24:08 +0000 (17:24 +0100)
openbox/client_menu.c

index addee73162c829ee972d847141760602bda2ad7e..6f154705ecb3b66d3d9e0eb8cc085a7fe2c85e10 100644 (file)
@@ -69,6 +69,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;
@@ -111,9 +115,6 @@ static void client_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();
 
@@ -211,9 +212,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();
 
@@ -290,9 +288,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);
     /* the client won't even be on the screen anymore, so hide the menu */
     if (f)