]> Dogcows Code - chaz/openbox/blobdiff - openbox/action.c
menus works on some level. add a built-in root menu
[chaz/openbox] / openbox / action.c
index a9c7737af1a3c9d8e668adeb481a9d3f468906a8..2d228423974003ce2118fd5b51b9ae17804a6a53 100644 (file)
@@ -1,13 +1,13 @@
 #include "client.h"
 #include "focus.h"
+#include "menu.h"
 #include "stacking.h"
 #include "frame.h"
+#include "framerender.h"
 #include "screen.h"
 #include "action.h"
 #include "dispatch.h"
 #include "openbox.h"
-#include "engine.h"
-#include "render/render.h"
 
 #include <glib.h>
 
@@ -16,10 +16,6 @@ Action *action_new(void (*func)(union ActionData *data))
     Action *a = g_new0(Action, 1);
     a->func = func;
 
-    /* deal with pointers */
-    if (func == action_execute)
-        a->data.execute.path = NULL;
-
     return a;
 }
 
@@ -30,6 +26,8 @@ void action_free(Action *a)
     /* deal with pointers */
     if (a->func == action_execute || a->func == action_restart)
         g_free(a->data.execute.path);
+    else if (a->func == action_showmenu)
+        g_free(a->data.showmenu.name);
 
     g_free(a);
 }
@@ -649,10 +647,10 @@ static void popup_coords(char *format, int a, int b, gboolean hide)
         char *text;
 
         text = g_strdup_printf(format, a, b);
-        engine_size_label(text, TRUE, TRUE, &s);
+        framerender_size_popup_label(text, &s);
         XMoveResizeWindow(ob_display, coords,
                           10, 10, s.width, s.height);
-        engine_render_label(coords, &s, text, TRUE, TRUE);
+        framerender_popup_label(coords, &s, text);
         g_free(text);
 
         XMapWindow(ob_display, coords);
@@ -709,7 +707,10 @@ void action_exit(union ActionData *data)
 
 void action_showmenu(union ActionData *data)
 {
-    g_message(__FUNCTION__);
+    if (data->showmenu.name) {
+        menu_show(data->showmenu.name, data->showmenu.x, data->showmenu.y,
+                  data->showmenu.c);
+    }
 }
 
 static void popup_cycle(Client *c, gboolean hide)
@@ -733,12 +734,12 @@ static void popup_cycle(Client *c, gboolean hide)
 
         a = screen_area(c->desktop);
 
-        engine_size_label(c->title, TRUE, TRUE, &s);
+        framerender_size_popup_label(c->title, &s);
         XMoveResizeWindow(ob_display, coords,
                           a->x + (a->width - s.width) / 2,
                           a->y + (a->height - s.height) / 2,
                           s.width, s.height);
-        engine_render_label(coords, &s, c->title, TRUE, TRUE);
+        framerender_popup_label(coords, &s, c->title);
 
         XMapWindow(ob_display, coords);
     }
This page took 0.024738 seconds and 4 git commands to generate.