]> Dogcows Code - chaz/openbox/blobdiff - openbox/menuframe.c
fix no more crashing in the client menu.
[chaz/openbox] / openbox / menuframe.c
index 476f33733bce6130f0161161276ceda1470e68a1..a2760aa17881ec8f6c2cf6d1b74043c728748543 100644 (file)
@@ -43,7 +43,6 @@ GList *menu_frame_visible;
 static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry,
                                               ObMenuFrame *frame);
 static void menu_entry_frame_free(ObMenuEntryFrame *self);
-static void menu_frame_render(ObMenuFrame *self);
 static void menu_frame_update(ObMenuFrame *self);
 static gboolean menu_entry_frame_submenu_timeout(gpointer data);
 
@@ -616,7 +615,7 @@ static gint menu_entry_frame_get_height(ObMenuEntryFrame *self,
     return h;
 }
 
-static void menu_frame_render(ObMenuFrame *self)
+void menu_frame_render(ObMenuFrame *self)
 {
     gint w = 0, h = 0;
     gint tw, th; /* temps */
@@ -924,6 +923,9 @@ static gboolean menu_frame_show(ObMenuFrame *self)
 
     menu_frame_visible = g_list_prepend(menu_frame_visible, self);
 
+    if (self->menu->show_func)
+        self->menu->show_func(self, self->menu->data);
+
     return TRUE;
 }
 
@@ -1006,6 +1008,9 @@ void menu_frame_hide(ObMenuFrame *self)
     if (!it)
         return;
 
+    if (self->menu->hide_func)
+        self->menu->hide_func(self, self->menu->data);
+
     if (self->child)
         menu_frame_hide(self->child);
 
@@ -1164,13 +1169,16 @@ void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state, Time time)
         gpointer data = self->frame->menu->data;
         GSList *acts = self->entry->data.normal.actions;
         ObClient *client = self->frame->client;
+        ObMenuFrame *frame = self->frame;
 
         /* release grabs before executing the shit */
-        if (!(state & ControlMask))
+        if (!(state & ControlMask)) {
             menu_frame_hide_all();
+            frame = NULL;
+        }
 
         if (func)
-            func(entry, state, data, time);
+            func(entry, frame, client, state, data, time);
         else
             action_run(acts, client, state, time);
     }
This page took 0.020943 seconds and 4 git commands to generate.