]> Dogcows Code - chaz/openbox/blobdiff - plugins/menu/client_menu.c
xinerama support
[chaz/openbox] / plugins / menu / client_menu.c
index 2578129ec393a3933ab959154ebb555e0d0a402c..aa09495ba5bd7fed3f5e5f8c8176914a7d04d249 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "kernel/frame.h"
 
+#include "render/theme.h"
+
 static char *PLUGIN_NAME = "client_menu";
 
 static Menu *send_to_menu;
@@ -45,14 +47,17 @@ void client_menu_show(Menu *self, int x, int y, Client *client)
     g_assert(!self->invalid);
     g_assert(client);
     
-    newy = client->frame->area.y + client->frame->a_focused_title->area.height;
+    newy = MAX(client->frame->area.y + client->frame->size.top, y);
+    newy -= ob_rr_theme->bwidth;
     
-    XMoveWindow(ob_display, self->frame, 
-               MIN(x, screen_physical_size.width - self->size.width), 
-               MIN(newy, screen_physical_size.height - self->size.height));
+    /* XXX do xinerama shit like in menu.c! im not coding it now because
+       this function isnt even being used right now... */
     POINT_SET(self->location, 
-             MIN(x, screen_physical_size.width - self->size.width), 
-             MIN(newy, screen_physical_size.height - self->size.height));
+             MIN(x, screen_physical_size.width - self->size.width -
+                  ob_rr_theme->bwidth * 2), 
+             MIN(newy, screen_physical_size.height - self->size.height -
+                  ob_rr_theme->bwidth * 2));
+    XMoveWindow(ob_display, self->frame, self->location.x, self->location.y);
 
     if (!self->shown) {
        XMapWindow(ob_display, self->frame);
@@ -74,7 +79,7 @@ void plugin_destroy (Menu *m)
 void *plugin_create() /* TODO: need config */
 {
     Menu *m = menu_new_full(NULL, "client-menu", NULL,
-                            client_menu_show, NULL);
+                            /*client_menu_show*/NULL, NULL);
     menu_add_entry(m, menu_entry_new_submenu("Send To Workspace",
                                              send_to_menu));
     send_to_menu->parent = m;
@@ -91,6 +96,8 @@ void *plugin_create() /* TODO: need config */
                                      action_from_string("toggleshade")));
     menu_add_entry(m, menu_entry_new("Omnipresent",
                                      action_from_string("toggleomnipresent")));
+    menu_add_entry(m, menu_entry_new("Decorations",
+                                     action_from_string("toggledecorations")));
     menu_add_entry(m, menu_entry_new_submenu("Layers",
                                              layer_menu));
     layer_menu->parent = m;
This page took 0.026972 seconds and 4 git commands to generate.