diff --git a/src/client.c b/src/client.c index ac7dfc5..7ed498d 100644 --- a/src/client.c +++ b/src/client.c @@ -1297,13 +1297,19 @@ client_unmanage(Client *c) { /* Arrange */ for(i = 0; i < screen_count() && !b; ++i) - if(c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) + if(c->tag == (uint)seltag[i]) + { b = True; + break; + } + else if(tags[i][seltag[i]].tagad & TagFlag(c->tag)) + { + tags[i][seltag[i]].layout.func(c->screen); + break; + } if(b) - { tags[c->screen][c->tag].layout.func(c->screen); - } else { tags[c->screen][c->tag].request_update = True; @@ -1419,6 +1425,20 @@ uicb_client_screen_prev(uicb_t cmd) return; } +/** Change client of screen to n + * \param cmd uicb_t type screen +*/ +void +uicb_client_screen_set(uicb_t cmd) +{ + (void)cmd; + CHECK(sel); + + client_set_screen(sel, atoi(cmd)); + + return; +} + /** Move a client *\param cmd uicb_t type */ diff --git a/src/config.c b/src/config.c index 927f78e..89ea268 100644 --- a/src/config.c +++ b/src/config.c @@ -42,6 +42,7 @@ const func_name_list_t func_list[] = {"client_swap_prev", uicb_client_swap_prev }, {"client_screen_next", uicb_client_screen_next }, {"client_screen_prev", uicb_client_screen_prev }, + {"client_screen_set", uicb_client_screen_set }, {"client_focus_right", uicb_client_focus_right }, {"client_focus_left" , uicb_client_focus_left }, {"client_focus_top", uicb_client_focus_top }, @@ -157,6 +158,7 @@ conf_misc_section(void) conf.font = fetch_opt_first(sec, "sans-9", "font").str; conf.raisefocus = fetch_opt_first(sec, "false", "raisefocus").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; conf.status_timing = fetch_opt_first(sec, "1", "status_timing").num; conf.status_path = fetch_opt_first(sec, "", "status_path").str; diff --git a/src/event.c b/src/event.c index 7807c8f..971cdb8 100644 --- a/src/event.c +++ b/src/event.c @@ -625,6 +625,23 @@ unmapnotify(XUnmapEvent *ev) return; } +/** XMotionNotify handle event + * \param ev XMotionEvent pointer + */ +static void +motionnotify(XMotionEvent *ev) +{ + Client *c; + + if(!conf.focus_fmouse || !conf.focus_fmov) + return; + + if((c = client_gb_win(ev->subwindow))) + client_focus(c); + + return; +} + /** Key grabbing function */ void @@ -667,6 +684,7 @@ getevent(XEvent ev) case MapNotify: mapnotify(&ev.xmap); break; case MapRequest: maprequest(&ev.xmaprequest); break; case MappingNotify: mappingnotify(&ev.xmapping); break; + case MotionNotify: motionnotify(&ev.xmotion); break; case PropertyNotify: propertynotify(&ev.xproperty); break; case ReparentNotify: reparentnotify(&ev.xreparent); break; case SelectionClear: selectionclearevent(&ev.xselectionclear); break; diff --git a/src/structs.h b/src/structs.h index 7fbc820..40e6cbd 100644 --- a/src/structs.h +++ b/src/structs.h @@ -382,6 +382,7 @@ typedef struct uint opacity; Bool raisefocus; Bool focus_fmouse; + Bool focus_fmov; Bool focus_pclick; Bool ignore_next_client_rules; Bool tagautohide; diff --git a/src/wmfs.h b/src/wmfs.h index 09d31d2..be2f4de 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -194,6 +194,7 @@ void uicb_client_focus_bottom(uicb_t cmd); void uicb_client_kill(uicb_t); void uicb_client_screen_next(uicb_t); void uicb_client_screen_prev(uicb_t); +void uicb_client_screen_set(uicb_t); void uicb_client_move(uicb_t cmd); void uicb_client_resize(uicb_t cmd); void uicb_ignore_next_client_rules(uicb_t cmd); diff --git a/wmfsrc b/wmfsrc index 7b663a2..d59c257 100644 --- a/wmfsrc +++ b/wmfsrc @@ -7,11 +7,13 @@ # @include "~/.config/wmfs/menu-wmfsrc" [misc] - font = "dejavu-10" - raisefocus = true - raiseswitch = false - focus_follow_mouse = true - opacity = 255 + font = "dejavu-10" + raisefocus = true + raiseswitch = false + focus_follow_mouse = true + focus_follow_movement = false + opacity = 255 + # focus_pointer_click: click on unfocused client area: # true -- default, set focus # false -- click go to client; including dockapps