Fix spelling of some unused MWM hints; from Sean C. Farley.

While here, flesh out the rest of the MWM hints.
This commit is contained in:
okan 2022-02-26 15:03:42 +00:00
parent 7c22b36a23
commit 5e5221d82d
2 changed files with 34 additions and 23 deletions

View File

@ -309,30 +309,39 @@ struct conf {
/* MWM hints */
struct mwm_hints {
#define MWM_HINTS_ELEMENTS 3L
#define MWM_FLAGS_STATUS (1<<3)
#define MWM_HINTS_ELEMENTS 5L
#define MWM_FLAGS_FUNCTIONS (1<<0)
#define MWM_FLAGS_DECORATIONS (1<<1)
#define MWM_FLAGS_INPUT_MODE (1<<2)
#define MWM_HINTS_FUNCTIONS (1L << 0)
#define MWM_HINTS_DECORATIONS (1L << 1)
#define MWM_HINTS_INPUT_MODE (1L << 2)
#define MWM_HINTS_STATUS (1L << 3)
unsigned long flags;
#define MWM_FUNCS_ALL (1<<0)
#define MWM_FUNCS_RESIZE (1<<1)
#define MWM_FUNCS_MOVE (1<<2)
#define MWM_FUNCS_MINIMIZE (1<<3)
#define MWM_FUNCS_MAXIMIZE (1<<4)
#define MWM_FUNCS_CLOSE (1<<5)
#define MWM_FUNC_ALL (1L << 0)
#define MWM_FUNC_RESIZE (1L << 1)
#define MWM_FUNC_MOVE (1L << 2)
#define MWM_FUNC_MINIMIZE (1L << 3)
#define MWM_FUNC_MAXIMIZE (1L << 4)
#define MWM_FUNC_CLOSE (1L << 5)
unsigned long functions;
#define MWM_DECOR_ALL (1<<0)
#define MWM_DECOR_BORDER (1<<1)
#define MWM_DECOR_RESIZE_HANDLE (1<<2)
#define MWM_DECOR_TITLEBAR (1<<3)
#define MWM_DECOR_MENU (1<<4)
#define MWM_DECOR_MINIMIZE (1<<5)
#define MWM_DECOR_MAXIMIZE (1<<6)
#define MWM_DECOR_ALL (1L << 0)
#define MWM_DECOR_BORDER (1L << 1)
#define MWM_DECOR_RESIZEH (1L << 2)
#define MWM_DECOR_TITLE (1L << 3)
#define MWM_DECOR_MENU (1L << 4)
#define MWM_DECOR_MINIMIZE (1L << 5)
#define MWM_DECOR_MAXIMIZE (1L << 6)
unsigned long decorations;
#define MWM_INPUT_MODELESS 0
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
#define MWM_INPUT_SYSTEM_MODAL 2
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
long inputMode;
#define MWM_TEAROFF_WINDOW (1L << 0)
unsigned long status;
};
enum cwmh {

View File

@ -849,13 +849,15 @@ client_mwm_hints(struct client_ctx *cc)
if (xu_get_prop(cc->win, cwmh[_MOTIF_WM_HINTS],
cwmh[_MOTIF_WM_HINTS], MWM_HINTS_ELEMENTS,
(unsigned char **)&mwmh) == MWM_HINTS_ELEMENTS) {
if (mwmh->flags & MWM_FLAGS_DECORATIONS &&
!(mwmh->decorations & MWM_DECOR_ALL) &&
!(mwmh->decorations & MWM_DECOR_BORDER))
(unsigned char **)&mwmh) <= 0)
return;
if ((mwmh->flags & MWM_HINTS_DECORATIONS) &&
!(mwmh->decorations & MWM_DECOR_ALL)) {
if (!(mwmh->decorations & MWM_DECOR_BORDER))
cc->bwidth = 0;
XFree(mwmh);
}
XFree(mwmh);
}
void