Merge branch 'bacardi55' of github.com:xorg62/wmfs

Conflicts:
	src/event.c
This commit is contained in:
Martin Duquesnoy 2011-04-07 18:02:27 +02:00
commit e28c6a3d64
7 changed files with 104 additions and 10 deletions

View File

@ -898,11 +898,18 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
client_attach(c);
client_set_rules(c);
client_get_name(c);
client_raise(c);
setwinstate(c->win, NormalState);
if(c->tag == (uint)seltag[selscreen])
{
client_raise(c);
setwinstate(c->win, NormalState);
}
else
client_hide(c);
ewmh_get_client_list();
client_update_attributes(c);
client_map(c);
if(c->tag == (uint)seltag[selscreen])
client_map(c);
ewmh_manage_window_type(c);
if(ar)
@ -1628,3 +1635,27 @@ uicb_client_ignore_tag(uicb_t cmd)
return;
}
/** Set current client as master
*\para cmd uicb_t type unused
*/
void
uicb_client_set_master(uicb_t cmd)
{
Client *c;
(void)cmd;
/* get the first client */
screen_get_sel();
if(!sel || ishide(sel, selscreen))
return;
for(c = clients; c && ishide(c, selscreen); c = c->next);
if (c && c != sel)
{
client_swap(c, sel);
client_focus(c);
}
return;
}

View File

@ -50,6 +50,7 @@ const func_name_list_t func_list[] =
{"client_move", uicb_client_move },
{"client_resize", uicb_client_resize },
{"client_ignore_tag", uicb_client_ignore_tag },
{"client_set_master", uicb_client_set_master },
{"toggle_max", uicb_togglemax },
{"layout_next", uicb_layout_next },
{"layout_prev", uicb_layout_prev },
@ -98,6 +99,7 @@ const func_name_list_t func_list[] =
{"clientlist", uicb_clientlist },
{"check_clist", uicb_checkclist },
{"toggle_tagautohide", uicb_toggle_tagautohide },
{"toggle_tag_expose", uicb_tag_toggle_expose},
{NULL, NULL}
};
@ -157,7 +159,6 @@ conf_misc_section(void)
conf.font = fetch_opt_first(sec, "sans-9", "font").str;
conf.raisefocus = fetch_opt_first(sec, "false", "raisefocus").bool;
conf.raiseswitch = fetch_opt_first(sec, "false", "raiseswitch").bool;
conf.focus_fmouse = fetch_opt_first(sec, "true", "focus_follow_mouse").bool;
conf.focus_fmov = fetch_opt_first(sec, "false", "focus_follow_movement").bool;
conf.focus_pclick = fetch_opt_first(sec, "true", "focus_pointer_click").bool;
@ -502,6 +503,8 @@ conf_tag_section(void)
conf.border.tag = fetch_opt_first(sec, "false", "border").bool;
conf.tagautohide = fetch_opt_first(sec, "false", "autohide").bool;
conf.tagnamecount = fetch_opt_first(sec, "false", "name_count").bool;
conf.tag_expose_name = fetch_opt_first(sec, "EXPOSE", "expose_name").str;
conf.expose_layout = fetch_opt_first(sec, "tile_grid_vertical", "expose_layout").str;
def_tag = fetch_section_first(sec, "default_tag");

View File

@ -51,10 +51,13 @@ arrange(int screen, Bool update_layout)
client_hide(c);
}
if(update_layout)
tags[screen][seltag[screen]].layout.func(screen);
if(tags[screen][seltag[screen]].layout.func)
{
if(update_layout)
tags[screen][seltag[screen]].layout.func(screen);
infobar_draw(screen);
infobar_draw(screen);
}
return;
}

View File

@ -381,7 +381,6 @@ typedef struct
char *font;
uint opacity;
Bool raisefocus;
Bool raiseswitch;
Bool focus_fmouse;
Bool focus_fmov;
Bool focus_pclick;
@ -500,6 +499,8 @@ typedef struct
Bool layout_system; /* Switch: False, Menu: True. */
Bool layout_placement; /* Right (normal): False, Left: True. */
Bool keep_layout_geo;
char *tag_expose_name;
char *expose_layout;
char *selected_layout_symbol;
/* Number of... */
int nkeybind;

View File

@ -734,3 +734,50 @@ uicb_tag_rename(uicb_t cmd)
return;
}
void
uicb_tag_toggle_expose(uicb_t cmd)
{
(void)cmd;
int i, j;
screen_get_sel();
for(i = 1; i <= conf.ntag[selscreen]; i++)
{
if(strcmp(tags[selscreen][i].name, conf.tag_expose_name) == 0)
{
if(clients && sel->tag)
tag_set(sel->tag);
tag_delete(selscreen, i);
for(j = 0; j < conf.ntag[selscreen]; j++)
tags[selscreen][j].request_update = True;
arrange(selscreen, True);
return;
}
}
tag_new(selscreen, conf.tag_expose_name);
for(i = 0; i < conf.nlayout; ++i)
{
if(strcmp(conf.expose_layout, conf.layout[i].type) == 0)
{
tags[selscreen][conf.ntag[selscreen]].layout = conf.layout[i];
}
}
for(i = 1; i < conf.ntag[selscreen]; ++i)
{
tags[selscreen][conf.ntag[selscreen]].tagad ^= TagFlag(i);
}
tags[selscreen][conf.ntag[selscreen]].request_update = True;
arrange(selscreen, True);
return;
}

View File

@ -201,6 +201,7 @@ void uicb_ignore_next_client_rules(uicb_t cmd);
void uicb_clientlist(uicb_t cmd);
Bool uicb_checkclist(uicb_t);
void uicb_client_ignore_tag(uicb_t);
void uicb_client_set_master(uicb_t);
/* ewmh.c */
void ewmh_init_hints(void);
@ -300,6 +301,7 @@ void uicb_tag_del(uicb_t);
void uicb_tag_rename(uicb_t cmd);
void uicb_tag_last(uicb_t cmd);
void uicb_tag_stay_last(uicb_t cmd);
void uicb_tag_toggle_expose(uicb_t cmd);
/* screen.c */
int screen_count(void);

11
wmfsrc
View File

@ -124,11 +124,14 @@
#default_name = "new tag" # deprecated, use [default_tag] instead
#default_layout = "tile_right" # deprecated, use [default_tag] instead
expose_name = "EXPOSE"
expose_layout = "tile_left"
# Border around the tag buttons.
border = true
# Hide empty tags in tag list
autohide = false
autohide = true
# Mouse buttons action on tag.
mouse_button_tag_sel = "1"
@ -244,7 +247,6 @@
max = false # Set automatic maximized client
follow_client = false # follow the client
ignore_tags = false # ignore tag (free mode)
follow_client = false # if the client open in an other tag/screen, follow it.
[/rule]
[/rules]
@ -332,6 +334,9 @@
# Swap current client with the previous.
[key] mod = {"Alt", "Shift"} key = "t" func = "client_swap_prev" [/key]
# Set the selected client as Master
[key] mod = {"Control"} key = "m" func = "client_set_master" [/key]
# Toggle maximum the selected client
[key] mod = {"Alt"} key = "m" func = "toggle_max" [/key]
@ -432,6 +437,8 @@
[key] mod = {"Super", "Shift"} key = "a" func = "client_screen_next" [/key]
[key] mod = {"Super", "Shift"} key = "z" func = "client_screen_prev" [/key]
[key] mod = {"Alt"} key = "e" func = "toggle_tag_expose" [/key]
# unlisted fonctions that can be used in [key] func = ""
# client_focus_{right, left, top, bottom}
# client_ignore_tag # Toggle the client in ignore_tag (display the client on all tags)