diff -Naur pwm-1.0/draw.h pwm-1.0-p10/draw.h --- pwm-1.0/draw.h 2003-11-14 14:36:46.000000000 +0100 +++ pwm-1.0-p10/draw.h 2003-11-14 14:34:32.000000000 +0100 @@ -32,6 +32,8 @@ typedef struct _WGRData{ /* configurable data */ XFontStruct *font, *menu_font; + int menu_pos_x; + int menu_pos_y; int border_width; int bevel_width; diff -Naur pwm-1.0/function.c pwm-1.0-p10/function.c --- pwm-1.0/function.c 2003-11-14 14:36:46.000000000 +0100 +++ pwm-1.0-p10/function.c 2003-11-14 14:34:33.000000000 +0100 @@ -335,14 +335,14 @@ static void show_menu_handler(WThing *thing, WFunction *func, WFuncArg arg) { WMenuData *mdata; - int x, y; + int x = GRDATA->menu_pos_x, y = GRDATA->menu_pos_y; mdata=lookup_menudata(ARG_TO_STRING(arg)); if(mdata==NULL) return; - get_pointer_rootpos(&x, &y); + /*get_pointer_rootpos(&x, &y);*/ show_menu(mdata, thing, x, y, FALSE); } diff -Naur pwm-1.0/menu.c pwm-1.0-p10/menu.c --- pwm-1.0/menu.c 2003-11-14 14:36:46.000000000 +0100 +++ pwm-1.0-p10/menu.c 2003-11-14 15:00:07.000000000 +0100 @@ -182,7 +182,9 @@ if(parent==NULL){ x-=w/2; + if (x < 0) x = 1; y+=th/(flags&WMENU_NOTITLE ? 2 : -2 ); + if (y < 0) y = 1; }else if(!(flags&WMENU_NOTITLE)){ y-=th; } @@ -213,9 +215,10 @@ XSelectInput(wglobal.dpy, win, MENU_MASK); XSaveContext(wglobal.dpy, win, wglobal.win_context, (XPointer)menu); - if(parent==NULL) + if(parent==NULL) { add_winobj((WWinObj*)menu, WORKSPACE_STICKY, LVL_MENU); - else + set_focus((WThing*)menu); + } else add_winobj_above((WWinObj*)menu, (WWinObj*)parent); map_winobj((WWinObj*)menu); @@ -898,7 +901,7 @@ int dx=0, dy=0; /* first entry - show title as well */ - if(entry<=0) + if(entry<0) /* XXX was <= */ ey=0; else ey=menu->title_height+CF_MENU_V_SPACE+entry*menu->entry_height; diff -Naur pwm-1.0/readconfig.c pwm-1.0-p10/readconfig.c --- pwm-1.0/readconfig.c 2003-11-14 14:36:47.000000000 +0100 +++ pwm-1.0-p10/readconfig.c 2003-11-14 14:34:33.000000000 +0100 @@ -587,7 +587,19 @@ return TRUE; } + + +static bool opt_screen_menu_pos(Tokenizer *tokz, int n, Token *toks) +{ + if(tmp_screen==NULL) + return TRUE; + GRDATA->menu_pos_x=TOK_LONG_VAL(&(toks[1])); + GRDATA->menu_pos_y=TOK_LONG_VAL(&(toks[2])); + + return TRUE; +} + static int opt_screen_border_w(Tokenizer *tokz, int n, Token *toks) { @@ -1049,6 +1061,7 @@ static ConfOpt screen_opts[]={ {"menu_font", "s", opt_screen_menu_font, NULL}, + {"menu_pos", "ll", opt_screen_menu_pos, NULL}, {"font", "s", opt_screen_font, NULL}, {"border_w", "ll", opt_screen_border_w, NULL}, {"bar_w", "ldl", opt_screen_bar_w, NULL},