diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-04-12 22:35:18 +0000 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-04-12 22:35:18 +0000 |
commit | 02f7b01c888f2ad9ee106acaee30e226bff04532 (patch) | |
tree | 5e2570dccb5514fdc3567a11f45af0dc5806a5b7 /src/main.cpp | |
parent | e6e1d14c01150872fea9198328d862127b4896b6 (diff) | |
download | vr-video-player-02f7b01c888f2ad9ee106acaee30e226bff04532.tar.gz vr-video-player-02f7b01c888f2ad9ee106acaee30e226bff04532.tar.bz2 vr-video-player-02f7b01c888f2ad9ee106acaee30e226bff04532.zip |
Fix flickering issue caused by visibility change spam
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index e822c80..a183976 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1094,8 +1094,12 @@ bool CMainApplication::HandleInput() window_resize_time = SDL_GetTicks(); window_resized = false; - XSelectInput(x_display, src_window_id, StructureNotifyMask|VisibilityChangeMask|KeyPressMask|KeyReleaseMask); - XFixesSelectCursorInput(x_display, src_window_id, XFixesDisplayCursorNotifyMask); + if(focused_window_changed) { + XSelectInput(x_display, src_window_id, StructureNotifyMask|VisibilityChangeMask|KeyPressMask|KeyReleaseMask); + XFixesSelectCursorInput(x_display, src_window_id, XFixesDisplayCursorNotifyMask); + XFlush(x_display); + XSync(x_display, False); + } focused_window_changed = false; window_resized = false; |