Work on reload..
This commit is contained in:
parent
aef863b066
commit
c7e05fced8
31
src/client.c
31
src/client.c
@ -583,21 +583,30 @@ client_new(Window w, XWindowAttributes *wa, bool scan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
client_update_props(struct client *c)
|
client_update_props(struct client *c, Flags f)
|
||||||
{
|
{
|
||||||
long g[4] = { c->geo.x, c->geo.y, c->geo.w, c->geo.h };
|
if(f & CPROP_LOC)
|
||||||
|
{
|
||||||
|
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_TAG"), XA_CARDINAL, 32,
|
||||||
|
PropModeReplace, (unsigned char*)&(c->tag->id), 1);
|
||||||
|
|
||||||
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_TAG"), XA_CARDINAL, 32,
|
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_SCREEN"), XA_CARDINAL, 32,
|
||||||
PropModeReplace, (unsigned char*)&(c->tag->id), 1);
|
PropModeReplace, (unsigned char*)&(c->screen->id), 1);
|
||||||
|
}
|
||||||
|
|
||||||
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_SCREEN"), XA_CARDINAL, 32,
|
if(f & CPROP_FLAG)
|
||||||
PropModeReplace, (unsigned char*)&(c->screen->id), 1);
|
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_FLAGS"), XA_CARDINAL, 32,
|
||||||
|
PropModeReplace, (unsigned char*)&(c->flags), 1);
|
||||||
|
|
||||||
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_FLAGS"), XA_CARDINAL, 32,
|
if(f & CPROP_GEO)
|
||||||
PropModeReplace, (unsigned char*)&(c->flags), 1);
|
{
|
||||||
|
long g[4] = { (long)c->geo.x, (long)c->geo.y, (long)c->geo.w, (long)c->geo.h };
|
||||||
|
|
||||||
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_GEO"), XA_CARDINAL, 32,
|
XChangeProperty(W->dpy, c->win, ATOM("_WMFS_GEO"), XA_CARDINAL, 32,
|
||||||
PropModeReplace, (unsigned char*)g, 4);
|
PropModeReplace, (unsigned char*)g, 4);
|
||||||
|
putchar(' ');
|
||||||
|
DGEO(c->geo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -695,7 +704,7 @@ client_moveresize(struct client *c, struct geo *g)
|
|||||||
c->flags &= ~CLIENT_DID_WINSIZE;
|
c->flags &= ~CLIENT_DID_WINSIZE;
|
||||||
|
|
||||||
client_frame_update(c, CCOL(c));
|
client_frame_update(c, CCOL(c));
|
||||||
client_update_props(c);
|
client_update_props(c, CPROP_GEO);
|
||||||
client_configure(c);
|
client_configure(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,12 @@ void client_remove(struct client *c);
|
|||||||
void client_free(void);
|
void client_free(void);
|
||||||
void _fac_resize(struct client *c, enum position p, int fac);
|
void _fac_resize(struct client *c, enum position p, int fac);
|
||||||
void client_apply_tgeo(struct tag *t);
|
void client_apply_tgeo(struct tag *t);
|
||||||
void client_update_props(struct client *c);
|
|
||||||
|
#define CPROP_LOC 0x01
|
||||||
|
#define CPROP_FLAG 0x02
|
||||||
|
#define CPROP_GEO 0x04
|
||||||
|
void client_update_props(struct client *c, Flags f);
|
||||||
|
|
||||||
inline void client_fac_hint(struct client *c);
|
inline void client_fac_hint(struct client *c);
|
||||||
|
|
||||||
/* Generated */
|
/* Generated */
|
||||||
|
|||||||
@ -404,7 +404,7 @@ layout_split_integrate(struct client *c, struct client *sc)
|
|||||||
* |_____|----'| -> |_____|__v__|
|
* |_____|----'| -> |_____|__v__|
|
||||||
* ^^^ void
|
* ^^^ void
|
||||||
*/
|
*/
|
||||||
static inline void
|
inline void
|
||||||
layout_fix_hole(struct client *c)
|
layout_fix_hole(struct client *c)
|
||||||
{
|
{
|
||||||
struct client *cr = client_next_with_pos(c, Right);
|
struct client *cr = client_next_with_pos(c, Right);
|
||||||
|
|||||||
@ -33,6 +33,7 @@ void layout_save_set(struct tag *t);
|
|||||||
void layout_free_set(struct tag *t);
|
void layout_free_set(struct tag *t);
|
||||||
void layout_split_integrate(struct client *c, struct client *sc);
|
void layout_split_integrate(struct client *c, struct client *sc);
|
||||||
void layout_split_arrange_closed(struct client *ghost);
|
void layout_split_arrange_closed(struct client *ghost);
|
||||||
|
inline void layout_fix_hole(struct client *c);
|
||||||
void uicb_layout_vmirror(Uicb cmd);
|
void uicb_layout_vmirror(Uicb cmd);
|
||||||
void uicb_layout_hmirror(Uicb cmd);
|
void uicb_layout_hmirror(Uicb cmd);
|
||||||
void uicb_layout_rotate_left(Uicb cmd);
|
void uicb_layout_rotate_left(Uicb cmd);
|
||||||
|
|||||||
@ -106,7 +106,7 @@ tag_client(struct tag *t, struct client *c)
|
|||||||
ewmh_set_wm_state(c->win, IconicState);
|
ewmh_set_wm_state(c->win, IconicState);
|
||||||
}
|
}
|
||||||
|
|
||||||
client_update_props(c);
|
client_update_props(c, CPROP_LOC);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insert in new tag list before
|
* Insert in new tag list before
|
||||||
|
|||||||
49
src/wmfs.c
49
src/wmfs.c
@ -181,16 +181,17 @@ wmfs_grab_keys(void)
|
|||||||
static void
|
static void
|
||||||
wmfs_scan(void)
|
wmfs_scan(void)
|
||||||
{
|
{
|
||||||
XWindowAttributes wa;
|
|
||||||
Window usl, usl2, *w = NULL;
|
|
||||||
Atom rt;
|
|
||||||
struct geo g;
|
struct geo g;
|
||||||
struct tag *t;
|
struct tag *t;
|
||||||
struct client *c;
|
struct client *c;
|
||||||
struct screen *s;
|
struct screen *s;
|
||||||
int i, n, rf, tag = -1, screen = -1, flags = -1;
|
int i, n, rf;
|
||||||
|
int tag = -1, screen = -1, flags = -1;
|
||||||
unsigned long ir, il;
|
unsigned long ir, il;
|
||||||
long *ret;
|
long *ret;
|
||||||
|
XWindowAttributes wa;
|
||||||
|
Window usl, usl2, *w = NULL;
|
||||||
|
Atom rt;
|
||||||
|
|
||||||
SLIST_INIT(&W->h.client);
|
SLIST_INIT(&W->h.client);
|
||||||
|
|
||||||
@ -201,19 +202,6 @@ wmfs_scan(void)
|
|||||||
|
|
||||||
if(!wa.override_redirect && wa.map_state == IsViewable)
|
if(!wa.override_redirect && wa.map_state == IsViewable)
|
||||||
{
|
{
|
||||||
if(XGetWindowProperty(W->dpy, w[i], ATOM("_WMFS_GEO"), 0, 32,
|
|
||||||
False, XA_CARDINAL, &rt, &rf, &ir, &il,
|
|
||||||
(unsigned char**)&ret)
|
|
||||||
== Success && ret)
|
|
||||||
{
|
|
||||||
g.x = ret[0];
|
|
||||||
g.y = ret[1];
|
|
||||||
g.w = ret[2];
|
|
||||||
g.h = ret[3];
|
|
||||||
|
|
||||||
XFree(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(XGetWindowProperty(W->dpy, w[i], ATOM("_WMFS_TAG"), 0, 32,
|
if(XGetWindowProperty(W->dpy, w[i], ATOM("_WMFS_TAG"), 0, 32,
|
||||||
False, XA_CARDINAL, &rt, &rf, &ir, &il,
|
False, XA_CARDINAL, &rt, &rf, &ir, &il,
|
||||||
(unsigned char**)&ret)
|
(unsigned char**)&ret)
|
||||||
@ -241,23 +229,36 @@ wmfs_scan(void)
|
|||||||
XFree(ret);
|
XFree(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(XGetWindowProperty(W->dpy, w[i], ATOM("_WMFS_GEO"), 0, 32,
|
||||||
|
False, XA_CARDINAL, &rt, &rf, &ir, &il,
|
||||||
|
(unsigned char**)&ret)
|
||||||
|
== Success && ret)
|
||||||
|
{
|
||||||
|
g.x = ret[0];
|
||||||
|
g.y = ret[1];
|
||||||
|
g.w = ret[2];
|
||||||
|
g.h = ret[3];
|
||||||
|
|
||||||
|
DGEO(g);
|
||||||
|
XFree(ret);
|
||||||
|
}
|
||||||
|
|
||||||
c = client_new(w[i], &wa, true);
|
c = client_new(w[i], &wa, true);
|
||||||
|
|
||||||
c->tgeo = g;
|
|
||||||
|
|
||||||
if(flags != -1)
|
if(flags != -1)
|
||||||
c->flags = flags;
|
c->flags = flags;
|
||||||
|
|
||||||
if(tag != -1 && screen != -1)
|
if(tag != -1 && screen != -1)
|
||||||
{
|
{
|
||||||
c->screen = screen_gb_id(screen);
|
c->screen = screen_gb_id(screen);
|
||||||
|
|
||||||
TAILQ_FOREACH(t, &c->screen->tags, next)
|
TAILQ_FOREACH(t, &c->screen->tags, next)
|
||||||
if(t->id == tag)
|
if(t->id == tag)
|
||||||
{
|
{
|
||||||
c->flags |= CLIENT_IGNORE_LAYOUT;
|
c->flags |= CLIENT_IGNORE_LAYOUT;
|
||||||
tag_client(t, c);
|
tag_client(t, c);
|
||||||
|
client_moveresize(c, &g);
|
||||||
client_get_name(c);
|
client_get_name(c);
|
||||||
client_focus(c);
|
/*client_focus(c);*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,7 +266,10 @@ wmfs_scan(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*SLIST_FOREACH(c, &W->h.client, next)
|
/*SLIST_FOREACH(c, &W->h.client, next)
|
||||||
client_moveresize(c, &c->tgeo);*/
|
client_moveresize(c, &c->tgeo);
|
||||||
|
|
||||||
|
SLIST_FOREACH(c, &W->h.client, next)
|
||||||
|
layout_fix_hole(c);*/
|
||||||
|
|
||||||
XFree(w);
|
XFree(w);
|
||||||
}
|
}
|
||||||
@ -336,6 +340,7 @@ wmfs_quit(void)
|
|||||||
while(!SLIST_EMPTY(&W->h.client))
|
while(!SLIST_EMPTY(&W->h.client))
|
||||||
{
|
{
|
||||||
c = SLIST_FIRST(&W->h.client);
|
c = SLIST_FIRST(&W->h.client);
|
||||||
|
client_update_props(c, CPROP_LOC | CPROP_FLAG | CPROP_GEO);
|
||||||
client_remove(c);
|
client_remove(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
wmfsrc2
2
wmfsrc2
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
[key] mod = {"Super"} key = "Return" func = "spawn" cmd = "xterm" [/key]
|
[key] mod = {"Super"} key = "Return" func = "spawn" cmd = "xterm" [/key]
|
||||||
[key] mod = {"Control", "Alt"} key = "q" func = "quit" [/key]
|
[key] mod = {"Control", "Alt"} key = "q" func = "quit" [/key]
|
||||||
[key] mod = {"Control", "Alt"} key = "r" func = " reload" [/key]
|
[key] mod = {"Control", "Alt"} key = "r" func = "reload" [/key]
|
||||||
[key] mod = {"Super"} key = "1" func = "tag_set" cmd = "1" [/key]
|
[key] mod = {"Super"} key = "1" func = "tag_set" cmd = "1" [/key]
|
||||||
[key] mod = {"Super"} key = "2" func = "tag_set" cmd = "2" [/key]
|
[key] mod = {"Super"} key = "2" func = "tag_set" cmd = "2" [/key]
|
||||||
[key] mod = {"Super"} key = "3" func = "tag_set" cmd = "3" [/key]
|
[key] mod = {"Super"} key = "3" func = "tag_set" cmd = "3" [/key]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user