Compute the rule only one time

This commit is contained in:
Julien Danjou 2008-03-14 17:34:25 +01:00
parent 8b217359e9
commit 12584caa5d
1 changed files with 5 additions and 2 deletions

View File

@ -363,11 +363,14 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
/* default titlebar position */ /* default titlebar position */
c->titlebar.position = globalconf.screens[screen].titlebar_default_position; c->titlebar.position = globalconf.screens[screen].titlebar_default_position;
/* get the matching rule if any */
rule = rule_matching_client(c);
/* Then apply rules if no props */ /* Then apply rules if no props */
if(!retloadprops) if(!retloadprops)
{ {
/* Get the client's rule */ /* Get the client's rule */
if((rule = rule_matching_client(c))) if(rule)
{ {
if(rule->screen != RULE_NOSCREEN) if(rule->screen != RULE_NOSCREEN)
move_client_to_screen(c, rule->screen, True); move_client_to_screen(c, rule->screen, True);
@ -443,7 +446,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
} }
/* attach to the stack */ /* attach to the stack */
if((rule = rule_matching_client(c))) if(rule)
switch(rule->ismaster) switch(rule->ismaster)
{ {
case Yes: case Yes: