Wmfs: Remove all Boolean value in the Client struct: all works with flags and fix multi-head _NET_WM_STATE_FULLSCREEN little placement buf.

This commit is contained in:
Martin Duquesnoy 2009-08-20 17:50:59 +02:00
parent 6db79e381d
commit c97cc8a7db
7 changed files with 110 additions and 86 deletions

View File

@ -364,10 +364,10 @@ client_get_name(Client *c)
void void
client_hide(Client *c) client_hide(Client *c)
{ {
CHECK(!c->hide); CHECK(!(c->flags & HideFlag));
client_unmap(c); client_unmap(c);
c->hide = True; c->flags |= HideFlag;
setwinstate(c->win, IconicState); setwinstate(c->win, IconicState);
return; return;
@ -451,7 +451,7 @@ client_map(Client *c)
{ {
CHECK(c); CHECK(c);
if(c->state_fullscreen) if(c->flags & FSSFlag)
XMapWindow(dpy, c->win); XMapWindow(dpy, c->win);
else else
{ {
@ -463,7 +463,7 @@ client_map(Client *c)
barwin_map_subwin(c->titlebar); barwin_map_subwin(c->titlebar);
} }
XMapSubwindows(dpy, c->frame); XMapSubwindows(dpy, c->frame);
c->unmapped = False; c->flags &= ~UnmapFlag;
} }
return; return;
@ -490,6 +490,7 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
c = emalloc(1, sizeof(Client)); c = emalloc(1, sizeof(Client));
c->win = w; c->win = w;
c->screen = selscreen; c->screen = selscreen;
c->flags = 0;
if(conf.client.place_at_mouse) if(conf.client.place_at_mouse)
{ {
@ -535,8 +536,6 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
for(t = clients; t && t->win != trans; t = t->next); for(t = clients; t && t->win != trans; t = t->next);
if(t) if(t)
c->tag = t->tag; c->tag = t->tag;
if(!c->free)
c->free = (rettrans == Success) || c->hint;
free(t); free(t);
client_attach(c); client_attach(c);
@ -620,7 +619,7 @@ client_moveresize(Client *c, XRectangle geo, Bool r)
if(r) if(r)
client_geo_hints(&geo, c); client_geo_hints(&geo, c);
c->max = False; c->flags &= ~MaxFlag;
c->geo = c->ogeo = geo; c->geo = c->ogeo = geo;
c->screen = screen_get_with_geo(c->geo.x, c->geo.y); c->screen = screen_get_with_geo(c->geo.x, c->geo.y);
@ -645,7 +644,7 @@ client_maximize(Client *c)
{ {
XRectangle geo; XRectangle geo;
if(!c || c->state_fullscreen) if(!c || c->flags & FSSFlag)
return; return;
c->screen = screen_get_with_geo(c->geo.x, c->geo.y); c->screen = screen_get_with_geo(c->geo.x, c->geo.y);
@ -729,8 +728,9 @@ client_size_hints(Client *c)
else else
c->minax = c->maxax = c->minay = c->maxay = 0; c->minax = c->maxax = c->minay = c->maxay = 0;
c->hint = (c->maxw && c->minw && c->maxh && c->minh if(c->maxw && c->minw && c->maxh && c->minh
&& c->maxw == c->minw && c->maxh == c->minh); && c->maxw == c->minw && c->maxh == c->minh)
c->flags |= HintFlag;
return; return;
} }
@ -743,8 +743,8 @@ void
client_swap(Client *c1, Client *c2) client_swap(Client *c1, Client *c2)
{ {
/* Check if no one of these clients are free */ /* Check if no one of these clients are free */
CHECK(!c1->free); CHECK(!(c1->flags & FreeFlag));
CHECK(!c2->free); CHECK(!(c2->flags & FreeFlag));
if(c1 == c2 || (c1->screen == c2->screen && c1->tag != c2->tag)) if(c1 == c2 || (c1->screen == c2->screen && c1->tag != c2->tag))
return; return;
@ -807,6 +807,8 @@ client_set_wanted_tag(Client *c)
void void
client_update_attributes(Client *c) client_update_attributes(Client *c)
{ {
Bool f;
/* For reload use */ /* For reload use */
XChangeProperty(dpy, c->win, ATOM("_WMFS_TAG"), XA_CARDINAL, 32, XChangeProperty(dpy, c->win, ATOM("_WMFS_TAG"), XA_CARDINAL, 32,
PropModeReplace, (uchar*)&(c->tag), 1); PropModeReplace, (uchar*)&(c->tag), 1);
@ -814,8 +816,10 @@ client_update_attributes(Client *c)
XChangeProperty(dpy, c->win, ATOM("_WMFS_SCREEN"), XA_CARDINAL, 32, XChangeProperty(dpy, c->win, ATOM("_WMFS_SCREEN"), XA_CARDINAL, 32,
PropModeReplace, (uchar*)&(c->screen), 1); PropModeReplace, (uchar*)&(c->screen), 1);
f = (c->flags & FreeFlag) ? True : False;
XChangeProperty(dpy, c->win, ATOM("_WMFS_ISFREE"), XA_CARDINAL, 32, XChangeProperty(dpy, c->win, ATOM("_WMFS_ISFREE"), XA_CARDINAL, 32,
PropModeReplace, (uchar*)&(c->free), 1); PropModeReplace, (uchar*)&f, 1);
return; return;
} }
@ -826,7 +830,7 @@ client_update_attributes(Client *c)
void void
client_raise(Client *c) client_raise(Client *c)
{ {
if(!c || c->tile) if(!c || (c->flags & TileFlag))
return; return;
XRaiseWindow(dpy, c->frame); XRaiseWindow(dpy, c->frame);
@ -851,10 +855,10 @@ uicb_client_raise(uicb_t cmd)
void void
client_unhide(Client *c) client_unhide(Client *c)
{ {
CHECK(c->hide); CHECK(c->flags & HideFlag);
client_map(c); client_map(c);
c->hide = False; c->flags &= ~HideFlag;
setwinstate(c->win, NormalState); setwinstate(c->win, NormalState);
return; return;
@ -912,7 +916,7 @@ client_unmap(Client *c)
{ {
CHECK(c); CHECK(c);
if(c->state_fullscreen) if(c->flags & FSSFlag)
XUnmapWindow(dpy, c->win); XUnmapWindow(dpy, c->win);
else else
{ {
@ -924,7 +928,7 @@ client_unmap(Client *c)
XUnmapWindow(dpy, c->frame); XUnmapWindow(dpy, c->frame);
XUnmapSubwindows(dpy, c->frame); XUnmapSubwindows(dpy, c->frame);
c->unmapped = True; c->flags |= UnmapFlag;
} }
return; return;
@ -964,7 +968,7 @@ client_set_screen(Client *c, int s)
arrange(s, True); arrange(s, True);
arrange(os, True); arrange(os, True);
if(!c->tile) if(!(c->flags & TileFlag))
{ {
client_focus(c); client_focus(c);
client_raise(c); client_raise(c);
@ -1009,8 +1013,11 @@ uicb_client_move(uicb_t cmd)
XRectangle geo; XRectangle geo;
int xi = 0, yi = 0; int xi = 0, yi = 0;
if(!sel || sel->tile || sel->max if((sel->flags & TileFlag)
|| sel->lmax || sel->state_fullscreen) || (sel->flags & MaxFlag)
|| (sel->flags & LMaxFlag)
|| (sel->flags & FSSFlag)
|| !sel)
return; return;
geo = sel->geo; geo = sel->geo;
@ -1035,8 +1042,11 @@ uicb_client_resize(uicb_t cmd)
XRectangle geo; XRectangle geo;
int wi = 0, hi = 0; int wi = 0, hi = 0;
if(!sel || sel->tile || sel->max if((sel->flags & TileFlag)
|| sel->lmax || sel->state_fullscreen) || (sel->flags & MaxFlag)
|| (sel->flags & LMaxFlag)
|| (sel->flags & FSSFlag)
|| !sel)
return; return;
geo = sel->geo; geo = sel->geo;

View File

@ -249,10 +249,10 @@ configureevent(XConfigureRequestEvent *ev)
if((c = client_gb_win(ev->window)) if((c = client_gb_win(ev->window))
|| (c = client_gb_win(ev->window))) || (c = client_gb_win(ev->window)))
{ {
CHECK(!c->tile); CHECK(!(c->flags & TileFlag));
CHECK(!c->lmax); CHECK(!(c->flags & LMaxFlag));
CHECK(!c->max); CHECK(!(c->flags & MaxFlag));
CHECK(!c->state_fullscreen); CHECK(!(c->flags & FSSFlag));
} }
if((c= client_gb_win(ev->window))) if((c= client_gb_win(ev->window)))
@ -460,8 +460,10 @@ propertynotify(XPropertyEvent *ev)
default: break; default: break;
case XA_WM_TRANSIENT_FOR: case XA_WM_TRANSIENT_FOR:
XGetTransientForHint(dpy, c->win, &trans); XGetTransientForHint(dpy, c->win, &trans);
if((c->tile || c->max) && (c->hint = (client_gb_win(trans) != NULL))) if((c->flags & TileFlag || c->flags & MaxFlag))
arrange(c->screen, True); if(((c->flags & HintFlag && (client_gb_win(trans) != NULL)))
|| (!(c->flags & HintFlag && (client_gb_win(trans) != NULL))))
arrange(c->screen, True);
break; break;
case XA_WM_NORMAL_HINTS: case XA_WM_NORMAL_HINTS:
client_size_hints(c); client_size_hints(c);
@ -487,7 +489,7 @@ unmapnotify(XUnmapEvent *ev)
if((c = client_gb_win(ev->window)) if((c = client_gb_win(ev->window))
&& ev->send_event && ev->send_event
&& !c->hide) && !(c->flags & HideFlag))
{ {
client_unmanage(c); client_unmanage(c);
XSetErrorHandler(errorhandler); XSetErrorHandler(errorhandler);

View File

@ -287,29 +287,30 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
/* Manage _NET_WM_STATE_FULLSCREEN */ /* Manage _NET_WM_STATE_FULLSCREEN */
if(data_l[1] == net_atom[net_wm_state_fullscreen]) if(data_l[1] == net_atom[net_wm_state_fullscreen])
{ {
if(data_l[0] == _NET_WM_STATE_ADD && !c->state_fullscreen) if(data_l[0] == _NET_WM_STATE_ADD && !(c->flags & FSSFlag))
{ {
c->screen = screen_get_with_geo(c->geo.x, c->geo.y); c->screen = screen_get_with_geo(c->geo.x, c->geo.y);
client_unmap(c); client_unmap(c);
c->unmapped = False; c->flags &= ~UnmapFlag;
XMapWindow(dpy, c->win); XMapWindow(dpy, c->win);
XReparentWindow(dpy, c->win, ROOT, spgeo[c->screen].x, spgeo[c->screen].y); XReparentWindow(dpy, c->win, ROOT, spgeo[c->screen].x, spgeo[c->screen].y);
XResizeWindow(dpy, c->win, spgeo[c->screen].x + spgeo[c->screen].width, XResizeWindow(dpy, c->win,
spgeo[c->screen].y + spgeo[c->screen].height); spgeo[c->screen].width,
spgeo[c->screen].height);
c->tmp_geo = c->geo; c->tmp_geo = c->geo;
if(c->free) if(c->flags & FreeFlag)
c->ogeo = c->geo; c->ogeo = c->geo;
c->state_fullscreen = True; c->flags |= (FSSFlag | MaxFlag);
c->max = True;
client_raise(c); client_raise(c);
client_focus(c); client_focus(c);
} }
else if(data_l[0] == _NET_WM_STATE_REMOVE && c->state_fullscreen) else if(data_l[0] == _NET_WM_STATE_REMOVE && (c->flags & FSSFlag))
{ {
c->state_fullscreen = False; c->flags &= ~(FSSFlag | MaxFlag);
client_map(c); client_map(c);
XReparentWindow(dpy, c->win, c->frame, BORDH, TBARH); XReparentWindow(dpy, c->win, c->frame, BORDH, TBARH);
client_moveresize(c, c->tmp_geo, False); client_moveresize(c, c->tmp_geo, False);
@ -368,8 +369,8 @@ ewmh_manage_window_type(Client *c)
/* MANAGE _NET_WM_WINDOW_TYPE_DIALOG */ /* MANAGE _NET_WM_WINDOW_TYPE_DIALOG */
else if(atom[i] == net_atom[net_wm_window_type_dialog]) else if(atom[i] == net_atom[net_wm_window_type_dialog])
{ {
c->free = True; c->flags |= FreeFlag;
sel->tile = sel->max = sel->lmax = False; c->flags &= ~(TileFlag | MaxFlag | LMaxFlag);
client_moveresize(sel, sel->ogeo, True); client_moveresize(sel, sel->ogeo, True);
client_focus(c); client_focus(c);
tags[selscreen][seltag[selscreen]].layout.func(selscreen); tags[selscreen][seltag[selscreen]].layout.func(selscreen);

View File

@ -69,10 +69,10 @@ freelayout(int screen)
for(c = clients; c; c = c->next) for(c = clients; c; c = c->next)
if(!ishide(c, selscreen) if(!ishide(c, selscreen)
&& c->screen == screen_get_sel() && c->screen == screen_get_sel()
&& !c->max) && !(c->flags & MaxFlag))
{ {
client_moveresize(c, c->ogeo, True); client_moveresize(c, c->ogeo, True);
c->tile = c->lmax = False; c->flags &= ~(TileFlag | LMaxFlag);
} }
ewmh_update_current_tag_prop(); ewmh_update_current_tag_prop();
@ -147,13 +147,9 @@ maxlayout(int screen)
for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i) for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i)
{ {
c->tile = False; c->flags &= ~TileFlag;
c->lmax = True; c->flags |= LMaxFlag;
client_maximize(c); client_maximize(c);
/* Focus the first client
if(!i)
client_focus(c); */
} }
ewmh_update_current_tag_prop(); ewmh_update_current_tag_prop();
@ -169,10 +165,10 @@ maxlayout(int screen)
Client* Client*
tiled_client(int screen, Client *c) tiled_client(int screen, Client *c)
{ {
for(;c && (c->max for(;c && ((c->flags & MaxFlag)
|| c->free || (c->flags & FreeFlag)
|| (c->flags & FSSFlag)
|| c->screen != screen || c->screen != screen
|| c->state_fullscreen
|| ishide(c, screen)); c = c->next); || ishide(c, screen)); c = c->next);
return c; return c;
@ -251,8 +247,8 @@ grid(int screen)
for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i) for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i)
{ {
/* Set client property */ /* Set client property */
c->max = c->lmax = False; c->flags &= ~(MaxFlag | LMaxFlag);
c->tile = True; c->flags |= TileFlag;
++cpcols; ++cpcols;
cgeo.width = (sg.width / cols) - (BORDH * 2); cgeo.width = (sg.width / cols) - (BORDH * 2);
cgeo.height = (sg.height / rows) - BORDH; cgeo.height = (sg.height / rows) - BORDH;
@ -336,8 +332,8 @@ multi_tile(int screen, Position type)
for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i) for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i)
{ {
/* Set client property */ /* Set client property */
c->max = c->lmax = False; c->flags &= ~(MaxFlag | LMaxFlag);
c->tile = True; c->flags |= TileFlag;
/* MASTER */ /* MASTER */
if(i < nmaster) if(i < nmaster)
@ -489,8 +485,8 @@ mirror(int screen, Bool horizontal)
for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i) for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i)
{ {
/* Set client property */ /* Set client property */
c->max = c->lmax = False; c->flags &= ~(MaxFlag | LMaxFlag);
c->tile = True; c->flags |= TileFlag;
if(i < nmaster) if(i < nmaster)
{ {
@ -661,8 +657,12 @@ uicb_tile_switch(uicb_t cmd)
screen_get_sel(); screen_get_sel();
if(!sel || sel->hint || !sel->tile || sel->state_fullscreen) if(!sel
|| (sel->flags & HintFlag)
|| !(sel->flags & TileFlag)
|| (sel->flags & FSSFlag))
return; return;
if((c = sel) == tiled_client(selscreen, clients)) if((c = sel) == tiled_client(selscreen, clients))
CHECK((c = tiled_client(selscreen, c->next))); CHECK((c = tiled_client(selscreen, c->next)));
client_detach(c); client_detach(c);
@ -679,14 +679,14 @@ uicb_tile_switch(uicb_t cmd)
void void
uicb_togglefree(uicb_t cmd) uicb_togglefree(uicb_t cmd)
{ {
if(!sel || sel->screen != screen_get_sel() || sel->state_fullscreen) if(!sel || sel->screen != screen_get_sel() || (sel->flags & FSSFlag))
return; return;
sel->free = !sel->free; sel->flags ^= FreeFlag;
if(sel->free) if((sel->flags & FreeFlag))
{ {
sel->tile = sel->max = sel->lmax = False; sel->flags &= ~(TileFlag | MaxFlag | LMaxFlag);
client_moveresize(sel, sel->ogeo, True); client_moveresize(sel, sel->ogeo, True);
client_raise(sel); client_raise(sel);
} }
@ -707,21 +707,21 @@ uicb_togglefree(uicb_t cmd)
void void
uicb_togglemax(uicb_t cmd) uicb_togglemax(uicb_t cmd)
{ {
if(!sel || ishide(sel, selscreen) || sel->hint || sel->state_fullscreen) if(!sel || ishide(sel, selscreen)
|| (sel->flags & HintFlag)|| (sel->flags & FSSFlag))
return; return;
if(!sel->max) if(!(sel->flags & MaxFlag))
{ {
sel->ogeo = sel->geo; sel->ogeo = sel->geo;
sel->tile = False; sel->flags &= ~(TileFlag | FreeFlag);
sel->free = False;
client_maximize(sel); client_maximize(sel);
client_raise(sel); client_raise(sel);
sel->max = True; sel->flags |= MaxFlag;
} }
else else
{ {
sel->max = False; sel->flags &= ~MaxFlag;
tags[selscreen][seltag[selscreen]].layout.func(selscreen); tags[selscreen][seltag[selscreen]].layout.func(selscreen);
} }

View File

@ -62,7 +62,7 @@ mouse_move(Client *c)
GC gci; GC gci;
XEvent ev; XEvent ev;
if(c->max || c->state_fullscreen) if((c->flags & MaxFlag) || (c->flags & FSSFlag))
return; return;
ocx = c->geo.x; ocx = c->geo.x;
@ -72,7 +72,7 @@ mouse_move(Client *c)
None, cursor[CurMove], CurrentTime) != GrabSuccess) None, cursor[CurMove], CurrentTime) != GrabSuccess)
return; return;
if(!c->tile && !c->lmax) if(!(c->flags & TileFlag) && !(c->flags & LMaxFlag))
XGrabServer(dpy); XGrabServer(dpy);
/* Set the GC for the rectangle */ /* Set the GC for the rectangle */
@ -81,7 +81,7 @@ mouse_move(Client *c)
xgc.line_width = BORDH; xgc.line_width = BORDH;
gci = XCreateGC(dpy, ROOT, GCFunction | GCSubwindowMode | GCLineWidth, &xgc); gci = XCreateGC(dpy, ROOT, GCFunction | GCSubwindowMode | GCLineWidth, &xgc);
if(!c->tile && !c->lmax) if(!(c->flags & TileFlag) && !(c->flags & LMaxFlag))
mouse_dragborder(c->geo, gci); mouse_dragborder(c->geo, gci);
XQueryPointer(dpy, ROOT, &dw, &dw, &mx, &my, &dint, &dint, &duint); XQueryPointer(dpy, ROOT, &dw, &dw, &mx, &my, &dint, &dint, &duint);
@ -93,7 +93,7 @@ mouse_move(Client *c)
if(ev.type == MotionNotify) if(ev.type == MotionNotify)
{ {
if(c->tile || c->lmax) if((c->flags & TileFlag) || (c->flags & LMaxFlag))
{ {
XQueryPointer(dpy, ROOT, &dw, &sw, &mx, &my, &dint, &dint, &duint); XQueryPointer(dpy, ROOT, &dw, &sw, &mx, &my, &dint, &dint, &duint);
@ -148,7 +148,7 @@ mouse_move(Client *c)
while(ev.type != ButtonRelease); while(ev.type != ButtonRelease);
/* One time again to delete all the trace on the window */ /* One time again to delete all the trace on the window */
if(!c->tile && !c->lmax) if(!(c->flags & TileFlag) && !(c->flags & LMaxFlag))
{ {
mouse_dragborder(geo, gci); mouse_dragborder(geo, gci);
client_moveresize(c, geo, False); client_moveresize(c, geo, False);
@ -178,7 +178,9 @@ mouse_resize(Client *c)
GC gci; GC gci;
float mwf = tags[selscreen][seltag[selscreen]].mwfact; float mwf = tags[selscreen][seltag[selscreen]].mwfact;
if(c->max || c->lmax || c->state_fullscreen) if((c->flags & MaxFlag)
|| (c->flags & LMaxFlag)
|| (c->flags & FSSFlag))
return; return;
XQueryPointer(dpy, ROOT, &w, &w, &omx, &omy, &d, &d, (uint *)&u); XQueryPointer(dpy, ROOT, &w, &w, &omx, &omy, &d, &d, (uint *)&u);
@ -187,11 +189,11 @@ mouse_resize(Client *c)
pos = Left; pos = Left;
if(XGrabPointer(dpy, ROOT, False, MouseMask, GrabModeAsync, GrabModeAsync, None, if(XGrabPointer(dpy, ROOT, False, MouseMask, GrabModeAsync, GrabModeAsync, None,
cursor[((c->tile) ? CurResize : ((pos == Right) ? CurRightResize : CurLeftResize))], cursor[((c->flags & TileFlag) ? CurResize : ((pos == Right) ? CurRightResize : CurLeftResize))],
CurrentTime) != GrabSuccess) CurrentTime) != GrabSuccess)
return; return;
if(!c->tile) if(!(c->flags & TileFlag))
XGrabServer(dpy); XGrabServer(dpy);
/* Set the GC for the rectangle */ /* Set the GC for the rectangle */
@ -200,7 +202,7 @@ mouse_resize(Client *c)
xgc.line_width = BORDH; xgc.line_width = BORDH;
gci = XCreateGC(dpy, ROOT, GCFunction | GCSubwindowMode | GCLineWidth, &xgc); gci = XCreateGC(dpy, ROOT, GCFunction | GCSubwindowMode | GCLineWidth, &xgc);
if(!c->tile) if(!(c->flags & TileFlag))
{ {
if(pos == Right) if(pos == Right)
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->geo.width + conf.client.borderheight, c->geo.height); XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->geo.width + conf.client.borderheight, c->geo.height);
@ -216,7 +218,8 @@ mouse_resize(Client *c)
if(ev.type == MotionNotify) if(ev.type == MotionNotify)
{ {
/* To resize MWFACT in tile mode */ /* To resize MWFACT in tile mode */
if(c->tile && tags[selscreen][seltag[selscreen]].layout.func != grid) if((c->flags & TileFlag)
&& tags[selscreen][seltag[selscreen]].layout.func != grid)
{ {
if(tags[selscreen][seltag[selscreen]].layout.func == tile) if(tags[selscreen][seltag[selscreen]].layout.func == tile)
mwf += (ROUND(ev.xmotion.x_root) - omx) / (sgeo[c->screen].width); mwf += (ROUND(ev.xmotion.x_root) - omx) / (sgeo[c->screen].width);
@ -233,7 +236,7 @@ mouse_resize(Client *c)
tags[selscreen][seltag[selscreen]].mwfact = (mwf < 0.05) ? 0.05 : ((mwf > 0.95) ? 0.95 : mwf); tags[selscreen][seltag[selscreen]].mwfact = (mwf < 0.05) ? 0.05 : ((mwf > 0.95) ? 0.95 : mwf);
} }
/* Free mode */ /* Free mode */
else if(!c->tile) else if(!(c->flags & TileFlag))
{ {
mouse_dragborder(geo, gci); mouse_dragborder(geo, gci);
@ -261,7 +264,7 @@ mouse_resize(Client *c)
} }
while(ev.type != ButtonRelease); while(ev.type != ButtonRelease);
if(!c->tile) if(!(c->flags & TileFlag))
{ {
mouse_dragborder(ogeo, gci); mouse_dragborder(ogeo, gci);
client_moveresize(c, geo, True); client_moveresize(c, geo, True);

View File

@ -39,6 +39,16 @@
#define MAXTAG 36 #define MAXTAG 36
#define NUM_OF_LAYOUT 9 #define NUM_OF_LAYOUT 9
/* Clients flags definition */
#define FreeFlag (1 << 1)
#define MaxFlag (1 << 2)
#define TileFlag (1 << 3)
#define HideFlag (1 << 4)
#define LMaxFlag (1 << 5)
#define UnmapFlag (1 << 6)
#define HintFlag (1 << 7)
#define FSSFlag (1 << 8)
/* Typedef */ /* Typedef */
typedef const char* uicb_t; typedef const char* uicb_t;
typedef unsigned int uint; typedef unsigned int uint;
@ -159,10 +169,8 @@ struct Client
char *fg; char *fg;
uint resizecorner; uint resizecorner;
} colors; } colors;
/* Client Information */ /* Client Information by flags */
Bool max, tile, free, hide; uint flags;
Bool hint, lmax, unmapped;
Bool state_fullscreen;
/* Struct in chains */ /* Struct in chains */
Client *next; Client *next;
Client *prev; Client *prev;

View File

@ -213,7 +213,7 @@ scan(void)
if(screen != -1 && screen <= screen_count() - 1) if(screen != -1 && screen <= screen_count() - 1)
c->screen = screen; c->screen = screen;
if(free != -1) if(free != -1)
c->free = free; c->flags |= (free) ? FreeFlag : 0;
client_update_attributes(c); client_update_attributes(c);
} }