mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Using xu_btn_ungrab() buttons during client_leave doesn't work (error
BadValue) when the modifier is already AnyModifier . Instead alter xu_btn_ungrab() to ungrab AnyButton/AnyModifier and call it only when a client is coming into focus in client_setactive(), instead of iterating over ignore mods - matches how we handle key grabs.
This commit is contained in:
parent
083a023f2c
commit
a2013ee9dd
2
calmwm.h
2
calmwm.h
@ -511,7 +511,7 @@ void conf_screen(struct screen_ctx *);
|
||||
void xev_loop(void);
|
||||
|
||||
void xu_btn_grab(Window, int, u_int);
|
||||
void xu_btn_ungrab(Window, int, u_int);
|
||||
void xu_btn_ungrab(Window);
|
||||
int xu_getprop(Window, Atom, Atom, long, unsigned char **);
|
||||
int xu_get_wm_state(Window, int *);
|
||||
int xu_getstrprop(Window, Atom, char **);
|
||||
|
5
client.c
5
client.c
@ -186,15 +186,10 @@ client_delete(struct client_ctx *cc)
|
||||
void
|
||||
client_leave(struct client_ctx *cc)
|
||||
{
|
||||
struct screen_ctx *sc;
|
||||
|
||||
if (cc == NULL)
|
||||
cc = client_current();
|
||||
if (cc == NULL)
|
||||
return;
|
||||
|
||||
sc = cc->sc;
|
||||
xu_btn_ungrab(sc->rootwin, AnyModifier, Button1);
|
||||
}
|
||||
|
||||
void
|
||||
|
2
conf.c
2
conf.c
@ -649,6 +649,8 @@ conf_grab_mouse(Window win)
|
||||
{
|
||||
struct mousebinding *mb;
|
||||
|
||||
xu_btn_ungrab(win);
|
||||
|
||||
TAILQ_FOREACH(mb, &Conf.mousebindingq, entry) {
|
||||
if (mb->flags != MOUSEBIND_CTX_WIN)
|
||||
continue;
|
||||
|
7
xutil.c
7
xutil.c
@ -65,12 +65,9 @@ xu_btn_grab(Window win, int mask, u_int btn)
|
||||
}
|
||||
|
||||
void
|
||||
xu_btn_ungrab(Window win, int mask, u_int btn)
|
||||
xu_btn_ungrab(Window win)
|
||||
{
|
||||
u_int i;
|
||||
|
||||
for (i = 0; i < nitems(ign_mods); i++)
|
||||
XUngrabButton(X_Dpy, btn, (mask | ign_mods[i]), win);
|
||||
XUngrabButton(X_Dpy, AnyButton, AnyModifier, win);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user