Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -uNr xorg62-wmfs/src/client.c xorg62-wmfs-sloppy/src/client.c
- --- xorg62-wmfs/src/client.c 2013-08-14 13:17:34.000000000 +0200
- +++ xorg62-wmfs-sloppy/src/client.c 2014-10-16 16:18:37.229643862 +0200
- @@ -671,6 +671,37 @@
- }
- void
- +client_focus_diffident(struct client *c)
- +{
- + /* Unfocus selected */
- + if(W->client && W->client != c)
- + {
- + client_grabbuttons(W->client, false);
- + client_frame_update(W->client, &W->client->ncol);
- + }
- +
- + /* Focus c */
- + if((W->client = c))
- + {
- + c->tag->sel = c;
- + client_grabbuttons(c, true);
- + client_tab_focus(c);
- + client_frame_update(c, CCOL(c));
- +
- + XSetInputFocus(W->dpy, c->win, RevertToPointerRoot, CurrentTime);
- + XChangeProperty(W->dpy, W->root, W->net_atom[net_active_window], XA_WINDOW, 32,
- + PropModeReplace, (unsigned char *)&c->win, 1);
- + }
- + else
- + {
- + W->client = W->screen->seltag->sel = NULL;
- + XSetInputFocus(W->dpy, W->root, RevertToPointerRoot, CurrentTime);
- + }
- +
- + ewmh_update_wmfs_props();
- +}
- +
- +void
- uicb_client_focus_click(Uicb cmd)
- {
- (void)cmd;
- diff -uNr xorg62-wmfs/src/client.h xorg62-wmfs-sloppy/src/client.h
- --- xorg62-wmfs/src/client.h 2013-08-14 13:17:34.000000000 +0200
- +++ xorg62-wmfs-sloppy/src/client.h 2014-10-16 16:07:52.637672601 +0200
- @@ -37,6 +37,7 @@
- void _client_tab(struct client *c, struct client *cm);
- void client_tab_focus(struct client *c);
- void client_focus(struct client *c);
- +void client_focus_diffident(struct client *c);
- void uicb_client_focus_click(Uicb);
- void client_get_name(struct client *c);
- void client_close(struct client *c);
- diff -uNr xorg62-wmfs/src/config.c xorg62-wmfs-sloppy/src/config.c
- --- xorg62-wmfs/src/config.c 2013-08-14 13:17:34.000000000 +0200
- +++ xorg62-wmfs-sloppy/src/config.c 2014-10-16 16:21:10.897637011 +0200
- @@ -254,6 +254,8 @@
- W->cfocus |= CFOCUS_ENTER;
- if(strstr(tmp, "click"))
- W->cfocus |= CFOCUS_CLICK;
- + if(strstr(tmp, "sloppy"))
- + W->cfocus |= CFOCUS_SLOPPY;
- /* [mouse] */
- /* for client frame AND titlebar */
- diff -uNr xorg62-wmfs/src/event.c xorg62-wmfs-sloppy/src/event.c
- --- xorg62-wmfs/src/event.c 2013-08-14 13:17:34.000000000 +0200
- +++ xorg62-wmfs-sloppy/src/event.c 2014-10-16 16:17:47.513646078 +0200
- @@ -48,6 +48,14 @@
- if((c = client_gb_win(ev->window)) && c != W->client
- && ev->button == 1 && W->cfocus & CFOCUS_CLICK)
- client_focus(c);
- + if((c = client_gb_win(ev->window))
- + && ev->button == 1 && W->cfocus & CFOCUS_SLOPPY)
- + if(c->flags & CLIENT_FREE
- + && !(c->flags & (CLIENT_FULLSCREEN | CLIENT_TABBED)))
- + {
- + c->tag->flags |= CLIENT_IGNORE_ENTER;
- + XRaiseWindow(W->dpy, c->frame);
- + }
- }
- static void
- @@ -80,6 +88,9 @@
- else if(c != W->client && !(c->flags & CLIENT_TABBED)
- && W->cfocus & CFOCUS_ENTER)
- client_focus(c);
- + else if(c != W->client && !(c->flags & CLIENT_TABBED)
- + && W->cfocus & CFOCUS_SLOPPY)
- + client_focus_diffident(c);
- }
- }
- diff -uNr xorg62-wmfs/src/wmfs.h xorg62-wmfs-sloppy/src/wmfs.h
- --- xorg62-wmfs/src/wmfs.h 2013-08-14 13:17:34.000000000 +0200
- +++ xorg62-wmfs-sloppy/src/wmfs.h 2014-10-16 15:58:47.189696919 +0200
- @@ -356,7 +356,8 @@
- struct theme *ctheme;
- #define CFOCUS_ENTER 0x01
- #define CFOCUS_CLICK 0x02
- - Flags cfocus; /* Focus configuration, can be set to 0, CFOCUS_ENTER or CFOCUS_CLICK*/
- +#define CFOCUS_SLOPPY 0x04
- + Flags cfocus; /* Focus configuration, can be set to 0, CFOCUS_ENTER, CFOCUS_CLICK or CFOCUS_SLOPPY*/
- int padding;
- diff -uNr xorg62-wmfs/wmfs.1 xorg62-wmfs-sloppy/wmfs.1
- --- xorg62-wmfs/wmfs.1 2013-08-14 13:17:34.000000000 +0200
- +++ xorg62-wmfs-sloppy/wmfs.1 2014-10-16 16:26:31.161622732 +0200
- @@ -425,7 +425,7 @@
- key modifier to perform actions on clients\&.
- .PP
- \fB\ focus:\fR
- -select the focus mouse options; enter=focus follow mouse, click=click to focus, everything-else=disable focus mouse support\&.
- +select the focus mouse options; enter=focus follow mouse, click=click to focus, sloppy=focus follows mouse, but windows are only raised on click, everything-else=disable focus mouse support\&.
- .PP
- \fB\ mousebinds:\fR
- mouse actions on client\&.
- diff -uNr xorg62-wmfs/wmfsrc xorg62-wmfs-sloppy/wmfsrc
- --- xorg62-wmfs/wmfsrc 2013-08-14 13:17:34.000000000 +0200
- +++ xorg62-wmfs-sloppy/wmfsrc 2014-10-16 16:27:18.881620604 +0200
- @@ -128,8 +128,9 @@
- key_modifier = "Super"
- # Focus type:
- - # enter : focus follow mouse (default)
- - # click : click to focus
- + # enter : focus follow mouse (default)
- + # click : click to focus
- + # sloppy : focus follow mouse, but windows are raised only on click
- # everything-else : disable mouse focus support
- focus = enter
Advertisement
Add Comment
Please, Sign In to add comment