From b5e89127ca9f2b9d01c521782b6a474b7fcbce22 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Mon, 8 Dec 2014 22:42:39 +0100 Subject: [PATCH] wmaker: add code to explicitly ignore Motif-WM flags we don't want to handle The goal is to explain the reason why we don't do anything about them, so people looking at the code in the future will know why it is this way. The expected side effect is also to silent warnings [-Wunused-macros] from gcc. Signed-off-by: Christophe CURIS --- src/motif.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/motif.c b/src/motif.c index 5fca916b..7eaba31c 100644 --- a/src/motif.c +++ b/src/motif.c @@ -92,6 +92,16 @@ static void setupMWMHints(WWindow *wwin, MWMHints *mwm_hints) WSETUFLAG(wwin, no_resizable, 0); } + if (mwm_hints->decorations & MWM_DECOR_BORDER) { + /* + * WindowMaker is drawing only a discreet 1 pixel border without + * any decoration like a few other X window managers used to do, so + * we assume it is not worth spending the time to add extra + * complexity to handle this special request, considering also that + * the Motif toolkit is not used anymore nowadays. + */ + } + if (mwm_hints->decorations & MWM_DECOR_RESIZEH) WSETUFLAG(wwin, no_resizebar, 0); @@ -101,10 +111,26 @@ static void setupMWMHints(WWindow *wwin, MWMHints *mwm_hints) WSETUFLAG(wwin, no_closable, 0); } + if (mwm_hints->decorations * MWM_DECOR_MENU) { + /* + * WindowMaker does not include a button to display the menu + * for windows, this is done using right mouse button on the + * title bar. As a consequence, we ignore this flag because we + * have nothing to hide. + */ + } + if (mwm_hints->decorations & MWM_DECOR_MINIMIZE) { WSETUFLAG(wwin, no_miniaturize_button, 0); WSETUFLAG(wwin, no_miniaturizable, 0); } + + if (mwm_hints->decorations & MWM_DECOR_MAXIMIZE) { + /* + * WindowMaker does not display a button to maximize windows, + * so we don't need to hide anything more for that flag + */ + } } if (mwm_hints->flags & MWM_HINTS_FUNCTIONS) { @@ -120,6 +146,13 @@ static void setupMWMHints(WWindow *wwin, MWMHints *mwm_hints) if (mwm_hints->functions & MWM_FUNC_RESIZE) WSETUFLAG(wwin, no_resizable, 0); + if (mwm_hints->functions & MWM_FUNC_MOVE) { + /* + * WindowMaker does not allow a window to not be moved, and this + * is a good thing, so we explicitly ignore this flag. + */ + } + if (mwm_hints->functions & MWM_FUNC_MINIMIZE) WSETUFLAG(wwin, no_miniaturizable, 0);