Menu tweaks.

SVN revision: 13465
This commit is contained in:
Kim Woelders 2005-02-22 17:40:15 +00:00
parent b86418c7eb
commit f57da217ee
3 changed files with 18 additions and 13 deletions

View File

@ -1713,8 +1713,6 @@ EWin *FindEwinByPartial(const char *win, int type);
EWin *FindEwinByDecoration(Window win);
Button *FindButton(Window win);
ActionClass *FindActionClass(Window win);
Menu *FindMenu(Window win);
EWin *FindEwinByMenu(Menu * m);
Group **ListWinGroups(EWin * ewin, char group_select, int *num);
EWin **ListWinGroupMembersForEwin(EWin * ewin, int action,
char nogroup, int *num);

View File

@ -164,8 +164,7 @@ HintsSetWindowDesktop(EWin * ewin)
GNOME_SetEwinDesk(ewin);
#endif
#if ENABLE_EWMH
if (ewin->type != EWIN_TYPE_MENU)
EWMH_SetWindowDesktop(ewin);
EWMH_SetWindowDesktop(ewin);
#endif
}
@ -184,8 +183,7 @@ HintsSetWindowState(EWin * ewin)
GNOME_SetHint(ewin);
#endif
#if ENABLE_EWMH
if (ewin->type != EWIN_TYPE_MENU)
EWMH_SetWindowState(ewin);
EWMH_SetWindowState(ewin);
#endif
}

View File

@ -74,6 +74,7 @@ struct _menu
{
char *name;
char *title;
EWin *ewin;
MenuStyle *style;
int num;
MenuItem **items;
@ -132,7 +133,7 @@ UngrabKeyboard(void)
#endif
}
Menu *
static Menu *
FindMenu(Window win)
{
Menu *menu = NULL;
@ -153,7 +154,8 @@ FindMenu(Window win)
return menu;
}
EWin *
#if 0
static EWin *
FindEwinByMenu(Menu * m)
{
EWin *const *ewins;
@ -168,18 +170,24 @@ FindEwinByMenu(Menu * m)
return NULL;
}
#else
#define FindEwinByMenu(m) (m->ewin)
#endif
void
MenuHide(Menu * m)
{
if (m->win)
{
EUnmapWindow(m->win);
EReparentWindow(m->win, VRoot.win, 0, 0);
}
EWin *ewin;
MenuActivateItem(m, NULL);
ewin = FindEwinByMenu(m);
if (ewin)
HideEwin(ewin);
m->ewin = NULL;
if (m->win)
EReparentWindow(m->win, VRoot.win, 0, 0);
m->stuck = 0;
m->shown = 0;
}
@ -322,6 +330,7 @@ MenuShow(Menu * m, char noshow)
ewin = AddInternalToFamily(m->win, m->style->border_name, EWIN_TYPE_MENU, m,
MenuEwinInit);
m->ewin = ewin;
if (ewin)
{
ewin->client.event_mask |= KeyPressMask;