From 946e4c1606bdd5725ff7fd9a9becc521e3b66358 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Wed, 23 Feb 2011 23:19:06 +0100 Subject: [PATCH 01/12] Remove double follow_client entry in the rule section of the wmfsrc --- wmfsrc | 1 - 1 file changed, 1 deletion(-) diff --git a/wmfsrc b/wmfsrc index 0f7d3c2..1348117 100644 --- a/wmfsrc +++ b/wmfsrc @@ -236,7 +236,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] From 3ca201c42ae13fb6a1f80e63a00d2762ebcf95ec Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Wed, 23 Feb 2011 23:22:11 +0100 Subject: [PATCH 02/12] Delete deprecated option raiseswitch --- src/config.c | 1 - src/structs.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/config.c b/src/config.c index 68119c0..927f78e 100644 --- a/src/config.c +++ b/src/config.c @@ -156,7 +156,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_pclick = fetch_opt_first(sec, "true", "focus_pointer_click").bool; conf.status_timing = fetch_opt_first(sec, "1", "status_timing").num; diff --git a/src/structs.h b/src/structs.h index 0100c1f..7fbc820 100644 --- a/src/structs.h +++ b/src/structs.h @@ -381,7 +381,6 @@ typedef struct char *font; uint opacity; Bool raisefocus; - Bool raiseswitch; Bool focus_fmouse; Bool focus_pclick; Bool ignore_next_client_rules; From 5ece3a6e55a27e7443ac4dea436f4e0cd9da766e Mon Sep 17 00:00:00 2001 From: Paride Legovini Date: Fri, 11 Mar 2011 16:43:03 +0100 Subject: [PATCH 03/12] focus_follow_movement caused flickering, fixed. When using focus_follow_movement, client_focus() should be called only if the target client is unfocused. Calling client_focus() on every motion event causes an ugly flickering of the window. Signed-off-by: Raphael Khaiat --- src/event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/event.c b/src/event.c index 971cdb8..e5c7fb9 100644 --- a/src/event.c +++ b/src/event.c @@ -637,7 +637,8 @@ motionnotify(XMotionEvent *ev) return; if((c = client_gb_win(ev->subwindow))) - client_focus(c); + if (c != sel) + client_focus(c); return; } From 41c4570dcf6a77efde704bc67fea4488cd413ffc Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Mon, 21 Mar 2011 13:28:15 +0100 Subject: [PATCH 04/12] Add "expose" feature ala mac OS X to display all client of a screen Feature #100 requested by shibo --- src/config.c | 3 +++ src/structs.h | 2 ++ src/tag.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/wmfs.h | 1 + wmfsrc | 5 +++++ 5 files changed, 51 insertions(+) diff --git a/src/config.c b/src/config.c index 89ea268..e452a08 100644 --- a/src/config.c +++ b/src/config.c @@ -98,6 +98,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} }; @@ -501,6 +502,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"); diff --git a/src/structs.h b/src/structs.h index 40e6cbd..49e9e00 100644 --- a/src/structs.h +++ b/src/structs.h @@ -499,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; diff --git a/src/tag.c b/src/tag.c index dfd1f36..7a95d30 100644 --- a/src/tag.c +++ b/src/tag.c @@ -734,3 +734,43 @@ uicb_tag_rename(uicb_t cmd) return; } + +void +uicb_tag_toggle_expose(uicb_t cmd) +{ + (void)cmd; + int i; + + screen_get_sel(); + + for(i = 1; i <= conf.ntag[selscreen]; i++) + { + if(strcmp(tags[selscreen][i].name, conf.tag_expose_name) == 0) + { + tag_set(sel->tag); + arrange(selscreen, True); + tag_delete(selscreen, i); + 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); + } + + arrange(selscreen, True); + tags[selscreen][conf.ntag[selscreen]].request_update = True; + + return; +} diff --git a/src/wmfs.h b/src/wmfs.h index be2f4de..d540757 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -300,6 +300,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); diff --git a/wmfsrc b/wmfsrc index d59c257..da816bc 100644 --- a/wmfsrc +++ b/wmfsrc @@ -124,6 +124,9 @@ #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 @@ -431,6 +434,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) From b1a52a3a6b01dcadb89123af38cd97444963a41c Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Tue, 22 Mar 2011 14:07:53 +0100 Subject: [PATCH 05/12] Fix "expose feature" --- src/tag.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tag.c b/src/tag.c index 7a95d30..beef79f 100644 --- a/src/tag.c +++ b/src/tag.c @@ -750,6 +750,7 @@ uicb_tag_toggle_expose(uicb_t cmd) tag_set(sel->tag); arrange(selscreen, True); tag_delete(selscreen, i); + arrange(selscreen, True); return; } } @@ -769,8 +770,8 @@ uicb_tag_toggle_expose(uicb_t cmd) tags[selscreen][conf.ntag[selscreen]].tagad ^= TagFlag(i); } - arrange(selscreen, True); tags[selscreen][conf.ntag[selscreen]].request_update = True; + arrange(selscreen, True); return; } From 79928efd35fa79e618ef132114ef46bd83f0ff0d Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Tue, 22 Mar 2011 14:08:59 +0100 Subject: [PATCH 06/12] Delete useless function --- src/tag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tag.c b/src/tag.c index beef79f..bcf2b2d 100644 --- a/src/tag.c +++ b/src/tag.c @@ -748,7 +748,6 @@ uicb_tag_toggle_expose(uicb_t cmd) if(strcmp(tags[selscreen][i].name, conf.tag_expose_name) == 0) { tag_set(sel->tag); - arrange(selscreen, True); tag_delete(selscreen, i); arrange(selscreen, True); return; From a7f9bf65ff1faef2ebf0aa0b1512a68896ffd568 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Wed, 23 Mar 2011 13:42:53 +0100 Subject: [PATCH 07/12] Fix "expose" feature by adding "request_update" to all tags of the screen --- src/tag.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tag.c b/src/tag.c index bcf2b2d..6583d0a 100644 --- a/src/tag.c +++ b/src/tag.c @@ -739,7 +739,7 @@ void uicb_tag_toggle_expose(uicb_t cmd) { (void)cmd; - int i; + int i, j; screen_get_sel(); @@ -749,6 +749,9 @@ uicb_tag_toggle_expose(uicb_t cmd) { 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; } From 4064cbdfd9cab3b82cbec439f5073b7d3bb181c6 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Quoc Date: Sun, 20 Mar 2011 11:31:31 +0700 Subject: [PATCH 08/12] Add client_set_master command The function swaps selected client with the first one (master). --- src/client.c | 24 ++++++++++++++++++++++++ src/config.c | 1 + src/wmfs.h | 1 + 3 files changed, 26 insertions(+) diff --git a/src/client.c b/src/client.c index 7ed498d..0641925 100644 --- a/src/client.c +++ b/src/client.c @@ -1628,3 +1628,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; +} diff --git a/src/config.c b/src/config.c index e452a08..07f4ac3 100644 --- a/src/config.c +++ b/src/config.c @@ -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 }, diff --git a/src/wmfs.h b/src/wmfs.h index d540757..b0c3890 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -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); From 703974cb00858ed80cf4216e8da571a27ad60daf Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Wed, 23 Mar 2011 13:55:54 +0100 Subject: [PATCH 09/12] Add the keybind client_set_master in the default wmfsrc --- src/client.c | 8 ++++---- wmfsrc | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client.c b/src/client.c index 0641925..4d20f41 100644 --- a/src/client.c +++ b/src/client.c @@ -1637,17 +1637,17 @@ 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_swap(c, sel); client_focus(c); } return; diff --git a/wmfsrc b/wmfsrc index da816bc..8de1209 100644 --- a/wmfsrc +++ b/wmfsrc @@ -334,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] From 6372f3974cb67a74428aefbfb23b65992ba2b3f2 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Quoc Date: Sun, 20 Mar 2011 12:25:12 +0700 Subject: [PATCH 10/12] Fix "flick" when new client is not in current tag --- src/client.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index 4d20f41..6fb89ff 100644 --- a/src/client.c +++ b/src/client.c @@ -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) From df4e32f4f93eeaf073b28409006ebbb3b432a0a6 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Thu, 24 Mar 2011 13:05:37 +0100 Subject: [PATCH 11/12] Fix feature expose when there is no client on the screen. Bug found by pistache --- src/tag.c | 8 ++++++-- wmfsrc | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tag.c b/src/tag.c index 6583d0a..ba35bfb 100644 --- a/src/tag.c +++ b/src/tag.c @@ -739,7 +739,7 @@ void uicb_tag_toggle_expose(uicb_t cmd) { (void)cmd; - int i, j; + int i, j; screen_get_sel(); @@ -747,12 +747,16 @@ uicb_tag_toggle_expose(uicb_t cmd) { if(strcmp(tags[selscreen][i].name, conf.tag_expose_name) == 0) { - tag_set(sel->tag); + 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; } } diff --git a/wmfsrc b/wmfsrc index 8de1209..e4069cc 100644 --- a/wmfsrc +++ b/wmfsrc @@ -131,7 +131,7 @@ border = true # Hide empty tags in tag list - autohide = false + autohide = true # Mouse buttons action on tag. mouse_button_tag_sel = "1" From 0e8634fbe40685a48d894e6220a16f1e49d1fd22 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Thu, 24 Mar 2011 13:34:47 +0100 Subject: [PATCH 12/12] Fix bug #104 found by pistache --- src/layout.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layout.c b/src/layout.c index 73e2dcb..30919b5 100644 --- a/src/layout.c +++ b/src/layout.c @@ -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; }