event: Check if the state_fullscreent is false to do configure notify event
This commit is contained in:
parent
3d0b3410c1
commit
f9a2c441f3
@ -509,8 +509,10 @@ client_moveresize(Client *c, XRectangle geo, Bool r)
|
||||
|
||||
/* Set the client screen */
|
||||
c->screen = screen_get_with_geo(geo.x, geo.y);
|
||||
c->tag = seltag[c->screen];
|
||||
|
||||
frame_moveresize(c, c->geo);
|
||||
|
||||
XMoveResizeWindow(dpy, c->win, BORDH, BORDH + TBARH, c->geo.width, c->geo.height);
|
||||
|
||||
client_configure(c);
|
||||
@ -537,9 +539,10 @@ client_maximize(Client *c)
|
||||
|
||||
geo.x = sgeo[c->screen].x;
|
||||
geo.y = sgeo[c->screen].y;
|
||||
geo.width = sgeo[c->screen].width - BORDH * 2;
|
||||
geo.width = sgeo[c->screen].width - BORDH * 2;
|
||||
geo.height = sgeo[c->screen].height - BORDH * 2;
|
||||
|
||||
|
||||
if(c->state_fullscreen)
|
||||
{
|
||||
geo.y -= INFOBARH;
|
||||
@ -562,6 +565,7 @@ client_size_hints(Client *c)
|
||||
|
||||
if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
|
||||
size.flags = PSize;
|
||||
|
||||
/* base */
|
||||
if(size.flags & PBaseSize)
|
||||
{
|
||||
@ -618,6 +622,7 @@ client_size_hints(Client *c)
|
||||
}
|
||||
else
|
||||
c->minax = c->maxax = c->minay = c->maxay = 0;
|
||||
|
||||
c->hint = (c->maxw && c->minw && c->maxh && c->minh
|
||||
&& c->maxw == c->minw && c->maxh == c->minh);
|
||||
|
||||
|
||||
@ -227,6 +227,7 @@ configureevent(XEvent *ev)
|
||||
{
|
||||
CHECK(!c->tile);
|
||||
CHECK(!c->lmax);
|
||||
CHECK(!c->state_fullscreen);
|
||||
}
|
||||
|
||||
/* Configure Request Part {{{ */
|
||||
|
||||
21
src/layout.c
21
src/layout.c
@ -135,7 +135,7 @@ maxlayout(int screen)
|
||||
{
|
||||
Client *c;
|
||||
|
||||
for(c = nexttiled(screen, clients); c; c = nexttiled(screen, c->next))
|
||||
for(c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next))
|
||||
{
|
||||
c->tile = False;
|
||||
c->lmax = True;
|
||||
@ -151,7 +151,7 @@ maxlayout(int screen)
|
||||
* \return a client pointer
|
||||
*/
|
||||
Client*
|
||||
nexttiled(int screen, Client *c)
|
||||
tiled_client(int screen, Client *c)
|
||||
{
|
||||
for(;c && (c->max
|
||||
|| c->free
|
||||
@ -195,7 +195,7 @@ uicb_set_nmaster(uicb_t cmd)
|
||||
|
||||
screen_get_sel();
|
||||
|
||||
for(nc = 0, c = nexttiled(selscreen, clients); c; c = nexttiled(selscreen, c->next), ++nc);
|
||||
for(nc = 0, c = tiled_client(selscreen, clients); c; c = tiled_client(selscreen, c->next), ++nc);
|
||||
|
||||
if(!nc || tags[selscreen][seltag[selscreen]].nmaster + n == 0
|
||||
|| tags[selscreen][seltag[selscreen]].nmaster + n > nc)
|
||||
@ -218,7 +218,7 @@ grid(int screen)
|
||||
unsigned int i, n, cols, rows, cpcols = 0;
|
||||
unsigned int border = BORDH * 2;
|
||||
|
||||
for(n = 0, c = nexttiled(screen, clients); c; c = nexttiled(screen, c->next), ++n);
|
||||
for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n);
|
||||
CHECK(n);
|
||||
|
||||
for(rows = 0; rows <= n / 2; ++rows)
|
||||
@ -229,7 +229,7 @@ grid(int screen)
|
||||
? rows - 1
|
||||
: rows;
|
||||
|
||||
for(i = 0, c = nexttiled(screen, clients); c; c = nexttiled(screen, c->next), ++i)
|
||||
for(i = 0, c =tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i)
|
||||
{
|
||||
/* Set client property */
|
||||
c->max = c->lmax = False;
|
||||
@ -275,7 +275,7 @@ multi_tile(int screen, Position type)
|
||||
uint i , n, tilesize, mwfact, nmaster = tags[screen][seltag[screen]].nmaster;
|
||||
uint border = BORDH * 2;
|
||||
|
||||
for(n = 0, c = nexttiled(screen, clients); c; c = nexttiled(screen, c->next), ++n);
|
||||
for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n);
|
||||
CHECK(n);
|
||||
|
||||
/* FIX NMASTER */
|
||||
@ -312,7 +312,7 @@ multi_tile(int screen, Position type)
|
||||
}
|
||||
|
||||
|
||||
for(i = 0, c = nexttiled(screen, clients); c; c = nexttiled(screen, c->next), ++i)
|
||||
for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i)
|
||||
{
|
||||
/* Set client property */
|
||||
c->max = c->lmax = False;
|
||||
@ -445,8 +445,8 @@ uicb_tile_switch(uicb_t cmd)
|
||||
|
||||
if(!sel || sel->hint || !sel->tile || sel->state_fullscreen)
|
||||
return;
|
||||
if((c = sel) == nexttiled(selscreen, clients))
|
||||
CHECK((c = nexttiled(selscreen, c->next)));
|
||||
if((c = sel) == tiled_client(selscreen, clients))
|
||||
CHECK((c = tiled_client(selscreen, c->next)));
|
||||
client_detach(c);
|
||||
client_attach(c);
|
||||
client_focus(c);
|
||||
@ -470,10 +470,12 @@ uicb_togglefree(uicb_t cmd)
|
||||
{
|
||||
sel->tile = sel->max = sel->lmax = False;
|
||||
client_moveresize(sel, sel->ogeo, True);
|
||||
client_raise(sel);
|
||||
}
|
||||
else
|
||||
sel->ogeo = sel->geo;
|
||||
|
||||
|
||||
tags[selscreen][seltag[selscreen]].layout.func(selscreen);
|
||||
|
||||
return;
|
||||
@ -493,6 +495,7 @@ uicb_togglemax(uicb_t cmd)
|
||||
{
|
||||
sel->ogeo = sel->geo;
|
||||
sel->tile = False;
|
||||
sel->free = False;
|
||||
client_maximize(sel);
|
||||
client_raise(sel);
|
||||
sel->max = True;
|
||||
|
||||
11
src/mouse.c
11
src/mouse.c
@ -42,6 +42,7 @@ mouse_move(Client *c)
|
||||
int ocy = c->geo.y;
|
||||
int mx = c->geo.x;
|
||||
int my = c->geo.y;
|
||||
int oscreen = c->screen;
|
||||
int dint;
|
||||
uint duint;
|
||||
Window dw;
|
||||
@ -67,7 +68,15 @@ mouse_move(Client *c)
|
||||
geo.x = (ocx + (ev.xmotion.x - mx));
|
||||
geo.y = (ocy + (ev.xmotion.y - my));
|
||||
|
||||
client_moveresize(c, geo, True);
|
||||
|
||||
if(c->screen != oscreen)
|
||||
arrange(c->screen);
|
||||
|
||||
if(c->free || tags[c->screen][c->tag].layout.func == freelayout)
|
||||
client_moveresize(c, geo, True);
|
||||
else
|
||||
break;
|
||||
|
||||
}
|
||||
else if(ev.type == MapRequest
|
||||
|| ev.type == Expose
|
||||
|
||||
@ -255,7 +255,7 @@ void arrange(int screen);
|
||||
void freelayout(int screen);
|
||||
void layoutswitch(Bool b);
|
||||
void maxlayout(int screen);
|
||||
Client *nexttiled(int screen, Client *c);
|
||||
Client *tiled_client(int screen, Client *c);
|
||||
/* tile {{{ */
|
||||
void grid(int screen);
|
||||
void tile(int screen);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user