Prevent SelectionRequests from interfering with blinking cursor (#173)
Some old clipboard managers, such as greenclip and parcellite, constantly poll applications with SelectionRequest events, which breaks the internal timer and blinking cursor. This fix prevents these events from causing any disruption. Fixes #172
This commit is contained in:
parent
da81ae1704
commit
cb91e175ba
1 changed files with 8 additions and 4 deletions
12
x.c
12
x.c
|
|
@ -3804,8 +3804,12 @@ run(void)
|
|||
|
||||
xev = 0;
|
||||
while (XPending(xw.dpy)) {
|
||||
xev = 1;
|
||||
XNextEvent(xw.dpy, &ev);
|
||||
#if BLINKING_CURSOR_PATCH
|
||||
xev = (!xev || xev == SelectionRequest) ? ev.type : xev;
|
||||
#else
|
||||
xev = 1;
|
||||
#endif // BLINKING_CURSOR_PATCH
|
||||
if (XFilterEvent(&ev, None))
|
||||
continue;
|
||||
if (handler[ev.type])
|
||||
|
|
@ -3832,10 +3836,10 @@ run(void)
|
|||
if (!drawing) {
|
||||
trigger = now;
|
||||
#if BLINKING_CURSOR_PATCH
|
||||
if (IS_SET(MODE_BLINK)) {
|
||||
win.mode ^= MODE_BLINK;
|
||||
}
|
||||
if (xev != SelectionRequest) {
|
||||
win.mode &= ~MODE_BLINK;
|
||||
lastblink = now;
|
||||
}
|
||||
#endif // BLINKING_CURSOR_PATCH
|
||||
drawing = 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue