Skip to content

Commit

Permalink
Don't dispatch events to destroyed windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Jun 15, 2024
1 parent 3be1fb7 commit 9fd6e41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/yxapp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,13 @@ void YXApplication::dispatchEvent(YWindow *win, XEvent &xev) {
w = w->getFocusWindow();
}

for (; w && (w->handleKey(xev.xkey) == false); w = w->parent()) {
for (; w; w = w->parent()) {
if (w->destroyed() || w->handleKey(xev.xkey))
break;
if (fGrabTree && w == fXGrabWindow)
break;
}
} else {
} else if (win->destroyed() == false) {
Window child;

if (xev.type == MotionNotify) {
Expand Down Expand Up @@ -698,7 +700,7 @@ void YXApplication::handleGrabEvent(YWindow *winx, XEvent &xev) {
}
if (win.ptr == nullptr)
return ;
{
else {
YWindow *p = win.ptr;
for (; p; p = p->parent()) {
if (p == fXGrabWindow)
Expand Down

0 comments on commit 9fd6e41

Please sign in to comment.