Skip to content

Commit

Permalink
Skip propagation of non-input events
Browse files Browse the repository at this point in the history
Fixes #1771

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
  • Loading branch information
Caellian authored Apr 4, 2024
1 parent bfe39a8 commit 407769d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/display-x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ bool display_output_x11::main_loop_wait(double t) {
}
}

DBGP2("Processing %d X11 events...", XPending(display));
/* handle X events */
while (XPending(display) != 0) {
XEvent ev;
Expand Down Expand Up @@ -630,6 +631,7 @@ bool display_output_x11::main_loop_wait(double t) {
}
}
}
DBGP2("Done with events!");

#ifdef BUILD_XDAMAGE
if (x11_stuff.damage) {
Expand Down
5 changes: 5 additions & 0 deletions src/x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,12 @@ void propagate_x11_event(XEvent &ev) {
i_ev->common.window = window.desktop;
i_ev->common.x = i_ev->common.x_root;
i_ev->common.y = i_ev->common.y_root;
} else {
// Not a known input event; blindly propagating them causes loops and all
// sorts of other evil.
return;
}
DBGP2("Propagating event: { type: %d; serial: %d }", i_ev->type, i_ev->common.serial);
XSendEvent(display, window.desktop, False, window.event_mask, &ev);

int _revert_to;
Expand Down

0 comments on commit 407769d

Please sign in to comment.