From: Dana Jansens Date: Sun, 25 Mar 2007 17:26:22 +0000 (+0000) Subject: proper logic for using the menu overlap with middle centered submenus. X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=cbbda7a363e0be925072c77b521af5546b9d5da1;p=chaz%2Fopenbox proper logic for using the menu overlap with middle centered submenus. always center top level menus horizontally under the cursor. why is this not normal behavior..? --- diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 7b86f4d7..0fba250a 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -193,7 +193,7 @@ void menu_frame_place_topmenu(ObMenuFrame *self, gint x, gint y) x = self->client->frame->area.x + self->client->frame->size.left; y = self->client->frame->area.y + self->client->frame->size.top; } else { - x -= ob_rr_theme->mbwidth; + x -= self->area.width / 2; y -= ob_rr_theme->mbwidth + self->title_h; } menu_frame_move(self, x, y); @@ -205,19 +205,20 @@ void menu_frame_place_submenu(ObMenuFrame *self) gint overlap; gint bwidth; - overlap = (config_menu_middle ? 0 : ob_rr_theme->menu_overlap); + overlap = ob_rr_theme->menu_overlap; bwidth = ob_rr_theme->mbwidth; - if (self->direction_right) x = self->parent->area.x + self->parent->area.width - overlap - bwidth; else x = self->parent->area.x - self->area.width + overlap + bwidth; y = self->parent->area.y + self->parent->title_h + - self->parent_entry->area.y + overlap; + self->parent_entry->area.y; if (config_menu_middle) - y = y - (self->area.height - (bwidth * 2) - self->item_h) / 2; + y -= (self->area.height - (bwidth * 2) - self->item_h) / 2; + else + y += overlap; menu_frame_move(self, x, y); }