Mercurial > mplayer.hg
changeset 35698:e44757ea8f94
Cosmetic: Relocate wsWindowDecoration().
author | ib |
---|---|
date | Sat, 19 Jan 2013 12:53:14 +0000 |
parents | 13f8a04c5524 |
children | 36527758158b |
files | gui/wm/ws.c |
diffstat | 1 files changed, 32 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/wm/ws.c Sat Jan 19 12:45:14 2013 +0000 +++ b/gui/wm/ws.c Sat Jan 19 12:53:14 2013 +0000 @@ -783,6 +783,38 @@ XSetWMNormalHints(wsDisplay, win->WindowID, &size); } +void wsWindowDecoration(wsWindow *win) +{ + Atom wsMotifHints; + struct { + unsigned long flags; + unsigned long functions; + unsigned long decorations; + long input_mode; + unsigned long status; + } wsMotifWmHints; + + wsMotifHints = XInternAtom(wsDisplay, "_MOTIF_WM_HINTS", 0); + + if (wsMotifHints == None) + return; + + memset(&wsMotifWmHints, 0, sizeof(wsMotifWmHints)); + wsMotifWmHints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; + + if (win->Decoration) { + wsMotifWmHints.functions = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE; + + if (!(win->Property & wsMinSize) || !(win->Property & wsMaxSize)) + wsMotifWmHints.functions |= MWM_FUNC_RESIZE; + + wsMotifWmHints.decorations = MWM_DECOR_ALL; + } + + XChangeProperty(wsDisplay, win->WindowID, wsMotifHints, wsMotifHints, 32, + PropModeReplace, (unsigned char *)&wsMotifWmHints, 5); +} + /** * @brief Wait until a window is mapped if its property requires it. * @@ -1001,38 +1033,6 @@ #endif } -void wsWindowDecoration(wsWindow *win) -{ - Atom wsMotifHints; - struct { - unsigned long flags; - unsigned long functions; - unsigned long decorations; - long input_mode; - unsigned long status; - } wsMotifWmHints; - - wsMotifHints = XInternAtom(wsDisplay, "_MOTIF_WM_HINTS", 0); - - if (wsMotifHints == None) - return; - - memset(&wsMotifWmHints, 0, sizeof(wsMotifWmHints)); - wsMotifWmHints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; - - if (win->Decoration) { - wsMotifWmHints.functions = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE; - - if (!(win->Property & wsMinSize) || !(win->Property & wsMaxSize)) - wsMotifWmHints.functions |= MWM_FUNC_RESIZE; - - wsMotifWmHints.decorations = MWM_DECOR_ALL; - } - - XChangeProperty(wsDisplay, win->WindowID, wsMotifHints, wsMotifHints, 32, - PropModeReplace, (unsigned char *)&wsMotifWmHints, 5); -} - void wsWindowShape(wsWindow *win, char *data) { #ifdef CONFIG_XSHAPE