Simplify scan() function
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2473de53b7
commit
21277ad12b
22
awesome.c
22
awesome.c
|
@ -77,33 +77,15 @@ scan()
|
||||||
for(screen = 0; screen < ScreenCount(globalconf.display); screen++)
|
for(screen = 0; screen < ScreenCount(globalconf.display); screen++)
|
||||||
{
|
{
|
||||||
if(XQueryTree(globalconf.display, RootWindow(globalconf.display, screen), &d1, &d2, &wins, &num))
|
if(XQueryTree(globalconf.display, RootWindow(globalconf.display, screen), &d1, &d2, &wins, &num))
|
||||||
{
|
|
||||||
for(i = 0; i < num; i++)
|
for(i = 0; i < num; i++)
|
||||||
{
|
|
||||||
/* XGetWindowAttributes return 1 on success */
|
/* XGetWindowAttributes return 1 on success */
|
||||||
if(!XGetWindowAttributes(globalconf.display, wins[i], &wa)
|
if(XGetWindowAttributes(globalconf.display, wins[i], &wa)
|
||||||
|| wa.override_redirect
|
&& !wa.override_redirect
|
||||||
|| XGetTransientForHint(globalconf.display, wins[i], &d1))
|
|
||||||
continue;
|
|
||||||
if(wa.map_state == IsViewable || window_getstate(wins[i]) == IconicState)
|
|
||||||
{
|
|
||||||
real_screen = screen_get_bycoord(globalconf.screens_info, screen, wa.x, wa.y);
|
|
||||||
client_manage(wins[i], &wa, real_screen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* now the transients */
|
|
||||||
for(i = 0; i < num; i++)
|
|
||||||
{
|
|
||||||
if(!XGetWindowAttributes(globalconf.display, wins[i], &wa))
|
|
||||||
continue;
|
|
||||||
if(XGetTransientForHint(globalconf.display, wins[i], &d1)
|
|
||||||
&& (wa.map_state == IsViewable || window_getstate(wins[i]) == IconicState))
|
&& (wa.map_state == IsViewable || window_getstate(wins[i]) == IconicState))
|
||||||
{
|
{
|
||||||
real_screen = screen_get_bycoord(globalconf.screens_info, screen, wa.x, wa.y);
|
real_screen = screen_get_bycoord(globalconf.screens_info, screen, wa.x, wa.y);
|
||||||
client_manage(wins[i], &wa, real_screen);
|
client_manage(wins[i], &wa, real_screen);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if(wins)
|
if(wins)
|
||||||
XFree(wins);
|
XFree(wins);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue