mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Add client wrapper for XWMHints to support XA_WM_HINTS in PropertyNotify
events; based off a diff from Thomas Adam.
This commit is contained in:
1
calmwm.h
1
calmwm.h
@@ -398,6 +398,7 @@ void client_unhide(struct client_ctx *);
|
|||||||
void client_vmaximize(struct client_ctx *);
|
void client_vmaximize(struct client_ctx *);
|
||||||
void client_vtile(struct client_ctx *);
|
void client_vtile(struct client_ctx *);
|
||||||
void client_warp(struct client_ctx *);
|
void client_warp(struct client_ctx *);
|
||||||
|
void client_wm_hints(struct client_ctx *);
|
||||||
|
|
||||||
void group_alltoggle(struct screen_ctx *);
|
void group_alltoggle(struct screen_ctx *);
|
||||||
void group_autogroup(struct client_ctx *);
|
void group_autogroup(struct client_ctx *);
|
||||||
|
|||||||
18
client.c
18
client.c
@@ -77,7 +77,7 @@ client_init(Window win, struct screen_ctx *sc, int mapped)
|
|||||||
conf_client(cc);
|
conf_client(cc);
|
||||||
|
|
||||||
XGetClassHint(X_Dpy, cc->win, &cc->ch);
|
XGetClassHint(X_Dpy, cc->win, &cc->ch);
|
||||||
cc->wmh = XGetWMHints(X_Dpy, cc->win);
|
client_wm_hints(cc);
|
||||||
client_getmwmhints(cc);
|
client_getmwmhints(cc);
|
||||||
client_wm_protocols(cc);
|
client_wm_protocols(cc);
|
||||||
client_getsizehints(cc);
|
client_getsizehints(cc);
|
||||||
@@ -93,12 +93,6 @@ client_init(Window win, struct screen_ctx *sc, int mapped)
|
|||||||
cc->geom.h = wattr.height;
|
cc->geom.h = wattr.height;
|
||||||
cc->colormap = wattr.colormap;
|
cc->colormap = wattr.colormap;
|
||||||
|
|
||||||
if (cc->wmh != NULL) {
|
|
||||||
if (cc->wmh->flags & InputHint) {
|
|
||||||
if (cc->wmh->input == 1)
|
|
||||||
cc->flags |= CLIENT_INPUT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (wattr.map_state != IsViewable) {
|
if (wattr.map_state != IsViewable) {
|
||||||
client_placecalc(cc);
|
client_placecalc(cc);
|
||||||
client_move(cc);
|
client_move(cc);
|
||||||
@@ -509,6 +503,16 @@ client_wm_protocols(struct client_ctx *cc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
client_wm_hints(struct client_ctx *cc)
|
||||||
|
{
|
||||||
|
if ((cc->wmh = XGetWMHints(X_Dpy, cc->win)) == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((cc->wmh->flags & InputHint) && (cc->wmh->input))
|
||||||
|
cc->flags |= CLIENT_INPUT;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
client_msg(struct client_ctx *cc, Atom proto)
|
client_msg(struct client_ctx *cc, Atom proto)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -186,6 +186,9 @@ xev_handle_propertynotify(XEvent *ee)
|
|||||||
case XA_WM_NAME:
|
case XA_WM_NAME:
|
||||||
client_setname(cc);
|
client_setname(cc);
|
||||||
break;
|
break;
|
||||||
|
case XA_WM_HINTS:
|
||||||
|
client_wm_hints(cc);
|
||||||
|
break;
|
||||||
case XA_WM_TRANSIENT_FOR:
|
case XA_WM_TRANSIENT_FOR:
|
||||||
client_transient(cc);
|
client_transient(cc);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user