Fix client_gb functions
This commit is contained in:
parent
f5f97fc442
commit
0d0cb3190a
@ -23,7 +23,7 @@ barwin_new(Window parent, int x, int y, int w, int h, Color fg, Color bg, bool e
|
||||
struct barwin *b = (struct barwin*)xcalloc(1, sizeof(struct barwin));
|
||||
XSetWindowAttributes at =
|
||||
{
|
||||
.override_redirect = True,
|
||||
.override_redirect = true,
|
||||
.background_pixmap = ParentRelative,
|
||||
.event_mask = BARWIN_MASK
|
||||
};
|
||||
|
||||
36
src/client.c
36
src/client.c
@ -113,10 +113,15 @@ client_gb_win(Window w)
|
||||
{
|
||||
struct client *c = SLIST_FIRST(&W->h.client);
|
||||
|
||||
while(c && c->win != w)
|
||||
c = SLIST_NEXT(c, next);
|
||||
while(c)
|
||||
{
|
||||
if(c->win == w)
|
||||
return c;
|
||||
|
||||
return c;
|
||||
c = SLIST_NEXT(c, next);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct client*
|
||||
@ -124,10 +129,15 @@ client_gb_frame(Window w)
|
||||
{
|
||||
struct client *c = SLIST_FIRST(&W->h.client);
|
||||
|
||||
while(c && c->frame != w)
|
||||
c = SLIST_NEXT(c, next);
|
||||
while(c)
|
||||
{
|
||||
if(c->frame == w)
|
||||
return c;
|
||||
|
||||
return c;
|
||||
c = SLIST_NEXT(c, next);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct client*
|
||||
@ -147,10 +157,18 @@ client_gb_titlebar(Window w)
|
||||
{
|
||||
struct client *c = SLIST_FIRST(&W->h.client);
|
||||
|
||||
while(c && c->titlebar && c->titlebar->win != w)
|
||||
c = SLIST_NEXT(c, next);
|
||||
if(!c->titlebar)
|
||||
return NULL;
|
||||
|
||||
return c;
|
||||
while(c && c->titlebar->win != w)
|
||||
{
|
||||
if(c->titlebar->win == w)
|
||||
return c;
|
||||
|
||||
c = SLIST_NEXT(c, next);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -176,13 +176,11 @@ mouse_move(struct client *c, void (*func)(struct client*, struct client*))
|
||||
}
|
||||
else
|
||||
{
|
||||
c2 = NULL;
|
||||
|
||||
XQueryPointer(W->dpy, W->root, &w, &w, &d, &d, &d, &d, (uint *)&u);
|
||||
|
||||
if(!(c2 = client_gb_win(w)))
|
||||
if(!(c2 = client_gb_frame(w)))
|
||||
c2 = client_gb_titlebar(w);
|
||||
|
||||
if(c2)
|
||||
if((c2 = client_gb_win(w)) || (c2 = client_gb_frame(w)) || (c2 = client_gb_titlebar(w)))
|
||||
{
|
||||
if(c2 != last)
|
||||
{
|
||||
@ -240,4 +238,5 @@ uicb_mouse_tab(Uicb cmd)
|
||||
|
||||
if(W->client && mouse_check_client(W->client))
|
||||
mouse_move(W->client, _client_tab);
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user