This commit is contained in:
phillbush 2020-05-15 23:08:05 -03:00
parent 7fbd1c5ed0
commit 09c13122cc
2 changed files with 8 additions and 1 deletions

View File

@ -345,6 +345,7 @@ static void
calcmenu(struct Menu *menu)
{
XWindowChanges changes;
XSizeHints sizeh;
struct Item *item;
/* calculate items positions and menu height */
@ -392,6 +393,12 @@ calcmenu(struct Menu *menu)
changes.y = menu->y;
XConfigureWindow(dpy, menu->win, CWHeight | CWX | CWY, &changes);
/* set window manager size hints */
sizeh.flags = PMaxSize | PMinSize;
sizeh.min_width = sizeh.max_width = menu->w;
sizeh.min_height = sizeh.max_height = menu->h;
XSetWMNormalHints(dpy, menu->win, &sizeh);
/* calculate positions of submenus */
for (item = menu->list; item != NULL; item = item->next) {
if (item->submenu != NULL)

View File

@ -1,6 +1,6 @@
#!/bin/sh
cat <<EOF | ./xmenu | xargs sh -c
cat <<EOF | ./xmenu -w | xargs sh -c
Applications
Web Browser firefox
Image editor gimp