1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Made the menus be mapped on the center of the screen when invoked with the

keyboard shortcuts.
This commit is contained in:
dan
2001-04-20 01:22:41 +00:00
parent 656a1c17e4
commit eb11184ef0
3 changed files with 31 additions and 7 deletions

View File

@@ -123,10 +123,21 @@ OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
}
if (switchmenu) {
int newx, newy;
if (!switchmenu->flags.realized)
wMenuRealize(switchmenu);
wMenuMapAt(switchmenu, x-switchmenu->frame->core->width/2, y,
keyboard);
if (keyboard && x==0 && y==0) {
newx = newy = 0;
} else if (keyboard && x==scr->scr_width/2 && y==scr->scr_height/2) {
newx = x - switchmenu->frame->core->width/2;
newy = y - switchmenu->frame->core->height/2;
} else {
newx = x - switchmenu->frame->core->width/2;
newy = y;
}
wMenuMapAt(switchmenu, newx, newy, keyboard);
}
}