]> Dogcows Code - chaz/openbox/blobdiff - openbox/menuframe.c
give different border colors to active and inactive windows. adjust the xml theme...
[chaz/openbox] / openbox / menuframe.c
index 461a2f2a3727948d76f7a4786b0d25ab0430b2d6..5782b7ac25e8a09890f6f4bd510d9cb5bee367a6 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);
 
@@ -90,7 +89,7 @@ ObMenuFrame* menu_frame_new(ObMenu *menu, guint show_from, ObClient *client)
 
     XSetWindowBorderWidth(ob_display, self->window, ob_rr_theme->mbwidth);
     XSetWindowBorder(ob_display, self->window,
-                     RrColorPixel(ob_rr_theme->menu_b_color));
+                     RrColorPixel(ob_rr_theme->menu_border_color));
 
     self->a_title = RrAppearanceCopy(ob_rr_theme->a_menu_title);
     self->a_items = RrAppearanceCopy(ob_rr_theme->a_menu);
@@ -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 */
@@ -690,7 +689,7 @@ static void menu_frame_render(ObMenuFrame *self)
         XMoveWindow(ob_display, e->window, e->area.x-e->border, e->area.y-e->border);
         XSetWindowBorderWidth(ob_display, e->window, e->border);
         XSetWindowBorder(ob_display, e->window,
-                         RrColorPixel(ob_rr_theme->menu_b_color));
+                         RrColorPixel(ob_rr_theme->menu_border_color));
 
 
         text_a = (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
@@ -729,7 +728,7 @@ static void menu_frame_render(ObMenuFrame *self)
             if (e->entry->data.separator.label != NULL) {
                 e->a_text_title->texture[0].data.text.string =
                     e->entry->data.separator.label;
-                tw = RrMinWidth(text_a);
+                tw = RrMinWidth(e->a_text_title);
                 tw = MIN(tw, MAX_MENU_WIDTH);
                 th = ob_rr_theme->menu_title_height +
                     (ob_rr_theme->mbwidth - PADDING) *2;
@@ -912,10 +911,10 @@ static gboolean menu_frame_show(ObMenuFrame *self)
 
     if (menu_frame_visible == NULL) {
         /* no menus shown yet */
-        if (!grab_pointer(TRUE, FALSE, OB_CURSOR_POINTER))
+        if (!grab_pointer(TRUE, TRUE, OB_CURSOR_POINTER))
             return FALSE;
         if (!grab_keyboard(TRUE)) {
-            grab_pointer(FALSE, FALSE, OB_CURSOR_POINTER);
+            grab_pointer(FALSE, TRUE, OB_CURSOR_POINTER);
             return FALSE;
         }
     }
@@ -1024,7 +1023,7 @@ void menu_frame_hide(ObMenuFrame *self)
 
     if (menu_frame_visible == NULL) {
         /* last menu shown */
-        grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
+        grab_pointer(FALSE, TRUE, OB_CURSOR_NONE);
         grab_keyboard(FALSE);
     }
 
@@ -1170,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.022859 seconds and 4 git commands to generate.