diff options
-rw-r--r-- | app/cwm/calmwm.h | 47 | ||||
-rw-r--r-- | app/cwm/client.c | 14 |
2 files changed, 36 insertions, 25 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index a64d75d6f..acd3df58d 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.376 2022/01/27 18:45:10 op Exp $ + * $OpenBSD: calmwm.h,v 1.377 2022/02/26 15:03:42 okan Exp $ */ #ifndef _CALMWM_H_ @@ -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 { diff --git a/app/cwm/client.c b/app/cwm/client.c index 7c1786547..1fa65a40c 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.264 2021/04/22 10:02:55 kn Exp $ + * $OpenBSD: client.c,v 1.265 2022/02/26 15:03:42 okan Exp $ */ #include <sys/types.h> @@ -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 |