Scan: Check _WMFS_TAG and _WMFS_SCREEN when scan() to place correctly every client.
This commit is contained in:
parent
2ae33ef544
commit
8e10f82c23
@ -402,8 +402,9 @@ client_map(Client *c)
|
||||
/** Manage a client with a window and his attributes
|
||||
* \param w Cient's futur Window
|
||||
* \param wa XWindowAttributes pointer, Window w attributes
|
||||
* \return The managed client
|
||||
*/
|
||||
void
|
||||
Client*
|
||||
client_manage(Window w, XWindowAttributes *wa)
|
||||
{
|
||||
Client *c, *t = NULL;
|
||||
@ -476,11 +477,12 @@ client_manage(Window w, XWindowAttributes *wa)
|
||||
setwinstate(c->win, NormalState);
|
||||
ewmh_get_client_list();
|
||||
ewmh_manage_window_type(c);
|
||||
arrange(c->screen);
|
||||
client_set_wanted_tag(c);
|
||||
client_update_attributes(c);
|
||||
|
||||
return;
|
||||
arrange(c->screen);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
/** Move and Resize a client
|
||||
|
||||
49
src/wmfs.c
49
src/wmfs.c
@ -192,13 +192,38 @@ scan(void)
|
||||
uint i, n;
|
||||
XWindowAttributes wa;
|
||||
Window usl, usl2, *w = NULL;
|
||||
Atom rt;
|
||||
int rf, tag = -1, screen = -1;
|
||||
ulong ir, il;
|
||||
uchar *ret;
|
||||
Client *c;
|
||||
|
||||
if(XQueryTree(dpy, ROOT, &usl, &usl2, &w, &n))
|
||||
for(i = 0; i < n; ++i)
|
||||
if(XGetWindowAttributes(dpy, w[i], &wa)
|
||||
&& !(wa.override_redirect || XGetTransientForHint(dpy, w[i], &usl))
|
||||
&& wa.map_state == IsViewable)
|
||||
client_manage(w[i], &wa);
|
||||
{
|
||||
if(XGetWindowProperty(dpy, w[i], ATOM("_WMFS_TAG"), 0, 32,
|
||||
False, XA_CARDINAL, &rt, &rf, &ir, &il, &ret) == Success)
|
||||
tag = *ret;
|
||||
|
||||
if(XGetWindowProperty(dpy, w[i], ATOM("_WMFS_SCREEN"), 0, 32,
|
||||
False, XA_CARDINAL, &rt, &rf, &ir, &il, &ret) == Success)
|
||||
screen = *ret;
|
||||
|
||||
c = client_manage(w[i], &wa);
|
||||
|
||||
if(tag != -1)
|
||||
c->tag = tag;
|
||||
if(screen != -1)
|
||||
c->screen = screen;
|
||||
|
||||
arrange(c->screen);
|
||||
}
|
||||
|
||||
if(ret)
|
||||
XFree(ret);
|
||||
|
||||
XFree(w);
|
||||
arrange(screen_get_sel());
|
||||
@ -212,12 +237,12 @@ scan(void)
|
||||
void
|
||||
uicb_reload(uicb_t cmd)
|
||||
{
|
||||
|
||||
XSetErrorHandler(errorhandlerdummy);
|
||||
|
||||
XftFontClose(dpy, font);
|
||||
infobar_destroy();
|
||||
|
||||
init_conf();
|
||||
init();
|
||||
scan();
|
||||
|
||||
@ -240,21 +265,21 @@ check_wmfs_running(void)
|
||||
ulong ir, il;
|
||||
uchar *ret;
|
||||
|
||||
XGetWindowProperty(dpy, ROOT, ATOM("_WMFS_RUNNING"), 0L, 4096,
|
||||
False, XA_CARDINAL, &rt, &rf, &ir, &il, &ret);
|
||||
XGetWindowProperty(dpy, ROOT, ATOM("_WMFS_RUNNING"), 0L, 4096,
|
||||
False, XA_CARDINAL, &rt, &rf, &ir, &il, &ret);
|
||||
|
||||
if(!ret)
|
||||
{
|
||||
XFree(ret);
|
||||
if(!ret)
|
||||
{
|
||||
XFree(ret);
|
||||
|
||||
fprintf(stderr, "Wmfs is not running. ( _WMFS_RUNNING not present)\n");
|
||||
fprintf(stderr, "Wmfs is not running. ( _WMFS_RUNNING not present)\n");
|
||||
|
||||
return False;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
XFree(ret);
|
||||
XFree(ret);
|
||||
|
||||
return True;
|
||||
return True;
|
||||
}
|
||||
|
||||
/** Execute an uicb function
|
||||
|
||||
@ -141,7 +141,7 @@ void client_hide(Client *c);
|
||||
void client_kill(Client *c);
|
||||
Bool ishide(Client *c, int screen);
|
||||
void client_map(Client *c);
|
||||
void client_manage(Window w, XWindowAttributes *wa);
|
||||
Client* client_manage(Window w, XWindowAttributes *wa);
|
||||
void client_moveresize(Client *c, XRectangle geo, Bool r);
|
||||
void client_maximize(Client *c);
|
||||
void client_size_hints(Client *c);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user