Cleanup stuff in client_manage for loading properties

Remove a double call to ewmh_check_client_hints, and only call
move_client_to_screen() when needed.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-03-23 21:54:55 +01:00
parent 507ef3c21d
commit db0932f77a
1 changed files with 19 additions and 29 deletions

View File

@ -325,7 +325,8 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
client_updatewmhints(c); client_updatewmhints(c);
/* Try to load props if any */ /* Try to load props if any */
retloadprops = client_loadprops(c, screen); if(!(retloadprops = client_loadprops(c, screen)))
move_client_to_screen(c, screen, True);
/* Then check clients hints */ /* Then check clients hints */
ewmh_check_client_hints(c); ewmh_check_client_hints(c);
@ -333,41 +334,30 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
/* default titlebar position */ /* default titlebar position */
c->titlebar = globalconf.screens[screen].titlebar_default; c->titlebar = globalconf.screens[screen].titlebar_default;
/* First check clients hints */
ewmh_check_client_hints(c);
/* get the matching rule if any */ /* get the matching rule if any */
rule = rule_matching_client(c); rule = rule_matching_client(c);
/* Then apply rules if no props */ /* Then apply rules if no props */
if(!retloadprops) if(!retloadprops && rule)
{ {
/* Get the client's rule */ if(rule->screen != RULE_NOSCREEN)
if(rule) move_client_to_screen(c, rule->screen, True);
tag_client_with_rule(c, rule);
switch(rule->isfloating)
{ {
if(rule->screen != RULE_NOSCREEN) case Maybe:
move_client_to_screen(c, rule->screen, True); break;
else case Yes:
move_client_to_screen(c, screen, True); client_setfloating(c, True);
tag_client_with_rule(c, rule); break;
case No:
switch(rule->isfloating) client_setfloating(c, False);
{ break;
case Maybe:
break;
case Yes:
client_setfloating(c, True);
break;
case No:
client_setfloating(c, False);
break;
}
if(rule->opacity >= 0.0f)
window_settrans(c->win, rule->opacity);
} }
else
move_client_to_screen(c, screen, True); if(rule->opacity >= 0.0f)
window_settrans(c->win, rule->opacity);
} }
/* check for transient and set tags like its parent, /* check for transient and set tags like its parent,