force windows to tile mode

This commit is contained in:
Julien Danjou 2008-01-07 00:28:15 +01:00
parent 7dd8e9dd5f
commit 81afe81b4e
7 changed files with 5 additions and 38 deletions

View File

@ -426,7 +426,7 @@ rules
name = <regex>
xproperty_name = <string>
xproperty_value = <regex>
float = <{auto,true,false}>
float = <boolean>
tags = <regex>
screen = <integer>
icon = <image>

View File

@ -668,7 +668,7 @@ config_parse(const char *confpatharg)
CFG_STR((char *) "name", NULL, CFGF_NONE),
CFG_STR((char *) "tags", NULL, CFGF_NONE),
CFG_STR((char *) "icon", NULL, CFGF_NONE),
CFG_STR((char *) "float", (char *) "auto", CFGF_NONE),
CFG_BOOL((char *) "float", cfg_false, CFGF_NONE),
CFG_INT((char *) "screen", RULE_NOSCREEN, CFGF_NONE),
CFG_BOOL((char *) "not_master", cfg_false, CFGF_NONE),
CFG_END()
@ -776,7 +776,7 @@ config_parse(const char *confpatharg)
rule->xprop = a_strdup(cfg_getstr(cfgsectmp, "xproperty_name"));
rule->xpropval_r = rules_compile_regex(cfg_getstr(cfgsectmp, "xproperty_value"));
rule->icon = a_strdup(cfg_getstr(cfgsectmp, "icon"));
rule->isfloating = rules_get_float_from_str(cfg_getstr(cfgsectmp, "float"));
rule->isfloating = cfg_getbool(cfgsectmp, "float");
rule->screen = cfg_getint(cfgsectmp, "screen");
rule->not_master = cfg_getbool(cfgsectmp, "not_master");
if(rule->screen >= get_screen_count())

View File

@ -36,13 +36,6 @@ typedef enum
Off
} Position;
typedef enum
{
Float,
Tile,
Auto,
} RuleFloat;
/** Common colors */
enum
{ ColBorder, ColFG, ColBG, ColLast };
@ -56,7 +49,7 @@ struct Rule
char *icon;
char *xprop;
int screen;
RuleFloat isfloating;
Bool isfloating;
Bool not_master;
regex_t *prop_r;
regex_t *tags_r;

View File

@ -160,9 +160,6 @@ handle_event_configurerequest(XEvent * e)
{
old_screen = c->screen;
if(get_current_layout(c->screen)->arrange != layout_floating)
c->isfloating = True;
/* if not resized, send event anyway */
if(!client_resize(c, geometry, False))
{

12
rules.c
View File

@ -97,16 +97,4 @@ is_tag_match_rules(Tag *t, Rule *r)
return False;
}
RuleFloat
rules_get_float_from_str(const char *str)
{
if(!a_strcmp(str, "true") || !a_strcmp(str, "yes"))
return Float;
else if(!a_strcmp(str, "false") || !a_strcmp(str, "no"))
return Tile;
return Auto;
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -29,7 +29,6 @@
regex_t * rules_compile_regex(char *);
Bool client_match_rule(Client *, Rule *);
Bool is_tag_match_rules(Tag *, Rule *);
RuleFloat rules_get_float_from_str(const char *);
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

12
tag.c
View File

@ -121,17 +121,7 @@ tag_client_with_rules(Client *c)
for(r = globalconf.rules; r; r = r->next)
if(client_match_rule(c, r))
{
switch(r->isfloating)
{
case Tile:
c->isfloating = False;
break;
case Float:
c->isfloating = True;
break;
default:
break;
}
c->isfloating = r->isfloating;
if(r->screen != RULE_NOSCREEN && r->screen != c->screen)
move_client_to_screen(c, r->screen, True);