aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-04-13 00:35:18 +0200
committerdec05eba <dec05eba@protonmail.com>2022-04-13 00:35:18 +0200
commit02f7b01c888f2ad9ee106acaee30e226bff04532 (patch)
tree5e2570dccb5514fdc3567a11f45af0dc5806a5b7 /src
parente6e1d14c01150872fea9198328d862127b4896b6 (diff)
Fix flickering issue caused by visibility change spam
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp8
-rw-r--r--src/window_texture.c6
2 files changed, 9 insertions, 5 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;
diff --git a/src/window_texture.c b/src/window_texture.c
index e162a25..0479254 100644
--- a/src/window_texture.c
+++ b/src/window_texture.c
@@ -167,9 +167,9 @@ int window_texture_on_resize(WindowTexture *self) {
cleanup:
if(texture_id != 0) glDeleteTextures(1, &texture_id);
- if(glx_pixmap) glXDestroyPixmap(self->display, self->glx_pixmap);
- if(glx_pixmap_bound) glXReleaseTexImageEXT(self->display, self->glx_pixmap, GLX_FRONT_EXT);
- if(pixmap) XFreePixmap(self->display, self->pixmap);
+ if(glx_pixmap) glXDestroyPixmap(self->display, glx_pixmap);
+ if(glx_pixmap_bound) glXReleaseTexImageEXT(self->display, glx_pixmap, GLX_FRONT_EXT);
+ if(pixmap) XFreePixmap(self->display, pixmap);
if(configs) XFree(configs);
return result;
}