diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-01-07 16:34:29 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-01-07 16:34:29 +0100 |
commit | df2eec24a3fb8a59d1fc070816bced96f2b6aa4d (patch) | |
tree | 3d62defc40cd708122c4f65aca801efab30e6fb6 | |
parent | 9a5c20836a70fd1f1cf9d21fc7e4febfbed38f53 (diff) |
Check event window
-rw-r--r-- | src/WindowUtils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/WindowUtils.cpp b/src/WindowUtils.cpp index d245568..7631e4d 100644 --- a/src/WindowUtils.cpp +++ b/src/WindowUtils.cpp @@ -321,7 +321,7 @@ namespace gsr { } XNextEvent(display, &xev); - if(xev.type == ConfigureNotify) { + if(xev.type == ConfigureNotify && xev.xconfigure.window == window) { got_data = xev.xconfigure.x > 0 && xev.xconfigure.y > 0; position.x = xev.xconfigure.x + xev.xconfigure.width / 2; position.y = xev.xconfigure.y + xev.xconfigure.height / 2; @@ -382,7 +382,7 @@ namespace gsr { } XNextEvent(display, &xev); - if(xev.type == MapNotify) { + if(xev.type == MapNotify && xev.xmap.window == window) { int x = 0; int y = 0; Window w = None; @@ -393,7 +393,7 @@ namespace gsr { position.y = y + size / 2; if(got_data) break; - } else if(xev.type == ConfigureNotify) { + } else if(xev.type == ConfigureNotify && xev.xconfigure.window == window) { got_data = xev.xconfigure.x > 0 && xev.xconfigure.y > 0; position.x = xev.xconfigure.x + xev.xconfigure.width / 2; position.y = xev.xconfigure.y + xev.xconfigure.height / 2; |