diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-09-29 15:05:27 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-10-05 17:08:49 +0100 |
commit | 4db7b6845d30408dc519045de2af073f3ba9e6d4 (patch) | |
tree | 4de65d657b5e7a76d183b23d3742d75312a7d43e | |
parent | 111ba21046b700850c5d4106d0c302d19a30e8b3 (diff) |
Handle more motif window decoration hinting
Handle the MWM_DECOR_MINIMIZE, MWM_DECOR_MAXIMIZE and MWM_DECOR_MENU
decoration hints in a _MOTIF_WM_HINTS window property
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r-- | hw/xwin/winmultiwindowwm.c | 18 | ||||
-rw-r--r-- | hw/xwin/winwindow.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 69de2e417..7cabfe038 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1577,6 +1577,8 @@ winDeinitMultiWindowWM (void) #define HINT_SIZEBOX (1l<<2) #define HINT_CAPTION (1l<<3) #define HINT_NOMAXIMIZE (1L<<4) +#define HINT_NOMINIMIZE (1L<<5) +#define HINT_NOSYSMENU (1L<<6) /* These two are used on their own */ #define HINT_MAX (1L<<0) #define HINT_MIN (1L<<1) @@ -1635,6 +1637,16 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) if (mwm_hint->decorations & MwmDecorBorder) hint |= HINT_BORDER; if (mwm_hint->decorations & MwmDecorHandle) hint |= HINT_SIZEBOX; if (mwm_hint->decorations & MwmDecorTitle) hint |= HINT_CAPTION; + if (!(mwm_hint->decorations & MwmDecorMenu)) hint |= HINT_NOSYSMENU; + if (!(mwm_hint->decorations & MwmDecorMinimize)) hint |= HINT_NOMINIMIZE; + if (!(mwm_hint->decorations & MwmDecorMaximize)) hint |= HINT_NOMAXIMIZE; + } + else + { + /* + MwmDecorAll means all decorations *except* those specified by other flag + bits that are set. Not yet implemented. + */ } } if (mwm_hint) XFree(mwm_hint); @@ -1750,6 +1762,12 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) if (hint & HINT_NOMAXIMIZE) style = style & ~WS_MAXIMIZEBOX; + if (hint & HINT_NOMINIMIZE) + style = style & ~WS_MINIMIZEBOX; + + if (hint & HINT_NOSYSMENU) + style = style & ~WS_SYSMENU; + SetWindowLongPtr (hWnd, GWL_STYLE, style); } diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h index d1143cd2d..edab40773 100644 --- a/hw/xwin/winwindow.h +++ b/hw/xwin/winwindow.h @@ -132,6 +132,9 @@ typedef struct _winWMMessageRec{ #define MwmDecorBorder (1l << 1) #define MwmDecorHandle (1l << 2) #define MwmDecorTitle (1l << 3) +#define MwmDecorMenu (1l << 4) +#define MwmDecorMinimize (1l << 5) +#define MwmDecorMaximize (1l << 6) /* This structure only contains 3 elements... the Motif 2.0 structure contains 5... we only need the first 3... so that is all we will define */ |