Add ewmh_manage_window_type to manage state & others hints without event
This commit is contained in:
parent
146be54b66
commit
c5d95b5999
@ -853,6 +853,7 @@ client_new(Window w, XWindowAttributes *wa, bool scan)
|
||||
client_get_name(c);
|
||||
client_focus(c);
|
||||
client_configure(c);
|
||||
ewmh_manage_window_type(c);
|
||||
}
|
||||
|
||||
return c;
|
||||
|
||||
25
src/ewmh.c
25
src/ewmh.c
@ -169,3 +169,28 @@ ewmh_manage_state(long data[], struct client *c)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ewmh_manage_window_type(struct client *c)
|
||||
{
|
||||
Atom *atom, rf;
|
||||
int f;
|
||||
unsigned long n, il, i;
|
||||
unsigned char *data = NULL;
|
||||
long ldata[5] = { _NET_WM_STATE_ADD };
|
||||
|
||||
/* _NET_WM_STATE at window mangement */
|
||||
if(XGetWindowProperty(W->dpy, c->win, W->net_atom[net_wm_state], 0L, 0x7FFFFFFFL, false,
|
||||
XA_ATOM, &rf, &f, &n, &il, &data) == Success && n)
|
||||
{
|
||||
atom = (Atom*)data;
|
||||
|
||||
for(i = 0; i < n; ++i)
|
||||
{
|
||||
ldata[1] = atom[i];
|
||||
ewmh_manage_state(ldata, c);
|
||||
}
|
||||
|
||||
XFree(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -76,5 +76,6 @@ void ewmh_init(void);
|
||||
void ewmh_set_wm_state(Window w, int state);
|
||||
void ewmh_update_wmfs_props(void);
|
||||
void ewmh_manage_state(long data[], struct client *c);
|
||||
void ewmh_manage_window_type(struct client *c);
|
||||
|
||||
#endif /* EWMH_H */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user