Fix freezing by temp removing mouse click to focus patch
This commit is contained in:
parent
6e170d60fa
commit
7693207ef2
|
@ -95,7 +95,6 @@
|
||||||
- speedwm.fadeinactive: 1
|
- speedwm.fadeinactive: 1
|
||||||
- speedwm.defaultlayout: 1
|
- speedwm.defaultlayout: 1
|
||||||
- speedwm.wmclass: 1
|
- speedwm.wmclass: 1
|
||||||
- speedwm.clicktofocus: 0
|
|
||||||
- speedwm.stairpx: 20
|
- speedwm.stairpx: 20
|
||||||
- speedwm.stairdirection: 1
|
- speedwm.stairdirection: 1
|
||||||
- speedwm.stairsamesize: 1
|
- speedwm.stairsamesize: 1
|
||||||
|
|
|
@ -184,7 +184,7 @@ static char *scratchpadcmd[] = {"s", TERMINAL, "-t", "scratchpa
|
||||||
static int warpcursor = 1; /* Warp cursor when switching client/monitor */
|
static int warpcursor = 1; /* Warp cursor when switching client/monitor */
|
||||||
static int pertag = 1; /* Use different mfact and layout for each layout */
|
static int pertag = 1; /* Use different mfact and layout for each layout */
|
||||||
static int wmclass = 1; /* Enable (1) workaround for when a class cannot be grabbed */
|
static int wmclass = 1; /* Enable (1) workaround for when a class cannot be grabbed */
|
||||||
static int clicktofocus = 0; /* Click to focus a window, instead of focusing when touched. (1/0) */
|
static int focusontouch = 1; /* Focus when the users' mouse touches a window (1) */
|
||||||
|
|
||||||
/* Full screen options */
|
/* Full screen options */
|
||||||
static int movefullscreenmon = 1; /* Move fullscreen windows to another monitor */
|
static int movefullscreenmon = 1; /* Move fullscreen windows to another monitor */
|
||||||
|
|
32
speedwm.c
32
speedwm.c
|
@ -931,12 +931,8 @@ if (!leftlayout) {
|
||||||
|
|
||||||
} else if ((c = wintoclient(ev->window))) {
|
} else if ((c = wintoclient(ev->window))) {
|
||||||
focus(c);
|
focus(c);
|
||||||
|
|
||||||
if (clicktofocus) {
|
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
XAllowEvents(dpy, ReplayPointer, CurrentTime);
|
XAllowEvents(dpy, ReplayPointer, CurrentTime);
|
||||||
}
|
|
||||||
|
|
||||||
click = ClkClientWin;
|
click = ClkClientWin;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -996,10 +992,8 @@ if (!leftlayout) {
|
||||||
}
|
}
|
||||||
} else if ((c = wintoclient(ev->window))) {
|
} else if ((c = wintoclient(ev->window))) {
|
||||||
focus(c);
|
focus(c);
|
||||||
if (clicktofocus) {
|
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
XAllowEvents(dpy, ReplayPointer, CurrentTime);
|
XAllowEvents(dpy, ReplayPointer, CurrentTime);
|
||||||
}
|
|
||||||
click = ClkClientWin;
|
click = ClkClientWin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1712,7 +1706,6 @@ drawbars(void)
|
||||||
void
|
void
|
||||||
enternotify(XEvent *e)
|
enternotify(XEvent *e)
|
||||||
{
|
{
|
||||||
if (!clicktofocus) {
|
|
||||||
Client *c;
|
Client *c;
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
XCrossingEvent *ev = &e->xcrossing;
|
XCrossingEvent *ev = &e->xcrossing;
|
||||||
|
@ -1726,8 +1719,9 @@ enternotify(XEvent *e)
|
||||||
selmon = m;
|
selmon = m;
|
||||||
} else if (!c || c == selmon->sel)
|
} else if (!c || c == selmon->sel)
|
||||||
return;
|
return;
|
||||||
|
if (focusontouch) {
|
||||||
focus(c);
|
focus(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2044,11 +2038,9 @@ grabbuttons(Client *c, int focused)
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
|
unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
|
||||||
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
||||||
if (!clicktofocus) {
|
if (!focused)
|
||||||
if (!focused)
|
XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
|
||||||
XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
|
BUTTONMASK, GrabModeSync, GrabModeSync, None, None);
|
||||||
BUTTONMASK, GrabModeSync, GrabModeSync, None, None);
|
|
||||||
|
|
||||||
for (i = 0; i < LENGTH(buttons); i++)
|
for (i = 0; i < LENGTH(buttons); i++)
|
||||||
if (buttons[i].click == ClkClientWin)
|
if (buttons[i].click == ClkClientWin)
|
||||||
for (j = 0; j < LENGTH(modifiers); j++)
|
for (j = 0; j < LENGTH(modifiers); j++)
|
||||||
|
@ -2056,18 +2048,6 @@ grabbuttons(Client *c, int focused)
|
||||||
buttons[i].mask | modifiers[j],
|
buttons[i].mask | modifiers[j],
|
||||||
c->win, False, BUTTONMASK,
|
c->win, False, BUTTONMASK,
|
||||||
GrabModeAsync, GrabModeSync, None, None);
|
GrabModeAsync, GrabModeSync, None, None);
|
||||||
} else {
|
|
||||||
if(!focused)
|
|
||||||
XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
|
|
||||||
BUTTONMASK, GrabModeSync, GrabModeSync, None, None);
|
|
||||||
for(i = 0; i < LENGTH(buttons); i++)
|
|
||||||
if(buttons[i].click == ClkClientWin)
|
|
||||||
for(j = 0; j < LENGTH(modifiers); j++)
|
|
||||||
XGrabButton(dpy, buttons[i].button,
|
|
||||||
buttons[i].mask | modifiers[j],
|
|
||||||
c->win, False, BUTTONMASK,
|
|
||||||
GrabModeAsync, GrabModeSync, None, None);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3433,7 +3413,7 @@ restack(Monitor *m)
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
|
|
||||||
if (warpcursor)
|
if (warpcursor && focusontouch)
|
||||||
{
|
{
|
||||||
if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && selmon->lt[selmon->sellt] != &layouts[2])
|
if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && selmon->lt[selmon->sellt] != &layouts[2])
|
||||||
warp(m->sel);
|
warp(m->sel);
|
||||||
|
|
|
@ -152,7 +152,7 @@ ResourcePref resources[] = {
|
||||||
{ "deckcount", INTEGER, &deckcount },
|
{ "deckcount", INTEGER, &deckcount },
|
||||||
{ "defaultlayout", INTEGER, &defaultlayout },
|
{ "defaultlayout", INTEGER, &defaultlayout },
|
||||||
{ "wmclass", INTEGER, &wmclass },
|
{ "wmclass", INTEGER, &wmclass },
|
||||||
{ "clicktofocus", INTEGER, &clicktofocus },
|
{ "focusontouch", INTEGER, &focusontouch },
|
||||||
{ "roundedcorners", INTEGER, &roundedcorners },
|
{ "roundedcorners", INTEGER, &roundedcorners },
|
||||||
{ "cornerradius", INTEGER, &cornerradius },
|
{ "cornerradius", INTEGER, &cornerradius },
|
||||||
{ "underline", INTEGER, &underline },
|
{ "underline", INTEGER, &underline },
|
||||||
|
|
Loading…
Reference in a new issue