aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <nilix@nilfm.cc>2022-03-27 10:52:10 -0600
committerDerek Stevens <nilix@nilfm.cc>2022-03-27 10:52:10 -0600
commit9612bd6ee2d7033ad66292cd817d1253f5a1567a (patch)
tree2fa60e731ee84e9402eb7dfac6687952c7501335
parent16ed0f7f244c9c3e6d671449996c89e11db296dc (diff)
pass mouse clicks through to windows properlyHEADv1.4.0main1.4.0
-rw-r--r--client.c2
-rw-r--r--event.c4
-rw-r--r--manage.c4
-rw-r--r--menu.c8
4 files changed, 14 insertions, 4 deletions
diff --git a/client.c b/client.c
index bed7604..18a0146 100644
--- a/client.c
+++ b/client.c
@@ -36,7 +36,7 @@ void setactive(Client* c, int on) {
c->parent,
False,
ButtonMask,
- GrabModeAsync,
+ GrabModeSync,
GrabModeSync,
None,
None);
diff --git a/event.c b/event.c
index 650f01e..f0c5d3e 100644
--- a/event.c
+++ b/event.c
@@ -62,8 +62,10 @@ void mainloop(int shape_event) {
break;
case ButtonPress:
button(&ev.xbutton);
+ XAllowEvents(dpy, ReplayPointer, ev.xbutton.time);
break;
case ButtonRelease:
+ XAllowEvents(dpy, ReplayPointer, ev.xbutton.time);
break;
case MapRequest:
mapreq(&ev.xmaprequest);
@@ -238,7 +240,7 @@ void mapreq(XMapRequestEvent* e) {
return;
break;
}
- XReparentWindow(dpy, c->window, c->parent, BORDER - 1, BORDER - 1);
+ XReparentWindow(dpy, c->window, c->parent, BORDER, BORDER);
XAddToSaveSet(dpy, c->window);
/* fall through... */
case NormalState:
diff --git a/manage.c b/manage.c
index 34cf0c9..e73177f 100644
--- a/manage.c
+++ b/manage.c
@@ -30,6 +30,7 @@ int manage(Client* c, int mapped) {
XWMHints* hints;
XSetWindowAttributes attrs;
XRRMonitorInfo monitor;
+ ScreenInfo* screen;
trace("manage", c, 0);
XSelectInput(
@@ -141,9 +142,10 @@ int manage(Client* c, int mapped) {
}
if (c->is9term && !(fixsize ? drag(c, Button3) : sweep(c, Button3))) {
+ screen = c->screen;
XKillClient(dpy, c->window);
rmclient(c);
- if (current && current->screen == c->screen)
+ if (current && current->screen == screen)
cmapfocus(current);
return 0;
}
diff --git a/menu.c b/menu.c
index f1d59f7..5e3df14 100644
--- a/menu.c
+++ b/menu.c
@@ -146,8 +146,8 @@ void button(XButtonEvent* e) {
case Button2:
if (c) {
XMapRaised(dpy, c->parent);
+ top(c);
active(c);
- XAllowEvents(dpy, ReplayPointer, curtime);
} else if (
(e->state & (ShiftMask | ControlMask)) == (ShiftMask | ControlMask)) {
menuhit(e, &egg);
@@ -155,6 +155,12 @@ void button(XButtonEvent* e) {
button2(n);
return;
case Button3:
+ if (c) {
+ XMapRaised(dpy, c->parent);
+ top(c);
+ active(c);
+ return;
+ }
break;
case Button4:
/* scroll up changes to previous virtual screen, wraps around */