Menus may now be shaded like other windows by double clicking on their title bars. Note that, even if animations are enabled, the shade animation seen with other windows does not work for menus.
This fixes Debian bug #72038 [1]: From: Chris Pimlott <pimlo...@null.net> Subject: wmaker: Persistant menus should be shade-able Date: Tue, 19 Sep 2000 14:04:41 -0400 One of the many little things that makes me appreciate Window Maker is that by clicking on the title bar of a menu, it can be made "persistant" so it stays on screen and doesn't dissappear after click or mouseout like normal. I find it useful if I need to run a number of commands in a submenu, or for keeping a list of open windows on screen. The usefulness of this feature could be extended by allowing menus to be shaded (by double-clicking the title) like normal windows, thus collapsing them to take up less space when not needed but still be persistant. Perhaps other commands of windows (like maximizing/ minimizing, resizing) might be considered as well, although personally only shading stands out as particularly useful for menus. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=72038 --- src/menu.c | 16 ++++++++++++++++ src/menu.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/menu.c b/src/menu.c index 83eb804..cc4d737 100644 --- a/src/menu.c +++ b/src/menu.c @@ -182,6 +182,7 @@ WMenu *wMenuCreate(WScreen *screen, const char *title, int main_menu) menu->frame->child = menu; menu->flags.lowered = 0; + menu->flags.shaded = 0; /* create borders */ if (title) { @@ -1114,6 +1115,12 @@ void wMenuUnmap(WMenu * menu) menu->flags.mapped = 0; menu->flags.open_to_left = 0; + if (menu->flags.shaded) { + wFrameWindowResize(menu->frame, menu->frame->core->width, menu->frame->top_width + + menu->entry_height*menu->entry_no + menu->frame->bottom_width - 1); + menu->flags.shaded = 0; + } + for (i = 0; i < menu->cascade_no; i++) { if (menu->cascades[i] != NULL && menu->cascades[i]->flags.mapped && !menu->cascades[i]->flags.buttoned) { @@ -2103,6 +2110,15 @@ static void menuTitleDoubleClick(WCoreWindow * sender, void *data, XEvent * even lower = 1; } changeMenuLevels(menu, lower); + } else { + if (menu->flags.shaded) { + wFrameWindowResize(menu->frame, menu->frame->core->width, menu->frame->top_width + + menu->entry_height*menu->entry_no + menu->frame->bottom_width - 1); + menu->flags.shaded = 0; + } else { + wFrameWindowResize(menu->frame, menu->frame->core->width, menu->frame->top_width - 1); + menu->flags.shaded = 1; + } } } diff --git a/src/menu.h b/src/menu.h index e568a7e..547f051 100644 --- a/src/menu.h +++ b/src/menu.h @@ -99,6 +99,7 @@ typedef struct WMenu { unsigned int jump_back_pending:1; unsigned int inside_handler:1; + unsigned int shaded:1; } flags; } WMenu; -- 2.5.0 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.