simplify client_manage()

This commit is contained in:
Julien Danjou 2007-11-15 14:44:43 +01:00
parent 0fa1b4c822
commit aa4de56ef5
1 changed files with 5 additions and 11 deletions

View File

@ -278,22 +278,22 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
c->display = awesomeconf->display; c->display = awesomeconf->display;
c->phys_screen = awesomeconf->phys_screen; c->phys_screen = awesomeconf->phys_screen;
c->screen = get_screen_bycoord(c->display, c->x, c->y);
tag_client_with_current_selected(c, awesomeconf); tag_client_with_current_selected(c, awesomeconf);
move_client_to_screen(c, current_acf, True);
/* update window title */ /* update window title */
updatetitle(c); updatetitle(c);
c->screen = get_screen_bycoord(c->display, c->x, c->y);
/* loadprops or apply rules if no props */ /* loadprops or apply rules if no props */
if(!loadprops(c, awesomeconf->ntags)) if(!loadprops(c, awesomeconf->ntags))
{ {
Rule *r; Rule *r;
Bool matched = False, has_rule = False; Bool matched = False;
for(r = current_acf->rules; r; r = r->next) for(r = current_acf->rules; r; r = r->next)
if(client_match_rule(c, r)) if(client_match_rule(c, r))
{ {
has_rule = True;
c->isfloating = r->isfloating; c->isfloating = r->isfloating;
if(r->screen != RULE_NOSCREEN && r->screen != c->screen) if(r->screen != RULE_NOSCREEN && r->screen != c->screen)
@ -316,14 +316,10 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
tag_client_with_current_selected(c, current_acf); tag_client_with_current_selected(c, current_acf);
break; break;
} }
if(!has_rule)
{
tag_client_with_current_selected(c, current_acf);
move_client_to_screen(c, current_acf, True);
}
} }
screen_info = get_screen_info(current_acf->display, current_acf->screen, NULL); screen_info = get_screen_info(current_acf->display, current_acf->screen, NULL);
/* if window request fullscreen mode */ /* if window request fullscreen mode */
if(c->w == screen_info[current_acf->screen].width && c->h == screen_info[current_acf->screen].height) if(c->w == screen_info[current_acf->screen].width && c->h == screen_info[current_acf->screen].height)
{ {
@ -376,8 +372,6 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
False, True, current_acf->buttons.root, False, True, current_acf->buttons.root,
current_acf->buttons.client, current_acf->numlockmask); current_acf->buttons.client, current_acf->numlockmask);
move_client_to_screen(c, current_acf, True);
/* check for transient and set tags like its parent */ /* check for transient and set tags like its parent */
if((rettrans = XGetTransientForHint(c->display, w, &trans) == Success) if((rettrans = XGetTransientForHint(c->display, w, &trans) == Success)
&& (t = get_client_bywin(*current_acf->clients, trans))) && (t = get_client_bywin(*current_acf->clients, trans)))