aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/x11.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-02-02 14:55:16 +0100
committerDavid Robillard <d@drobilla.net>2020-02-02 14:55:16 +0100
commitc1c69abf7bc964b6e2c1c5d5c1ba7f1542dcecc4 (patch)
tree72139763618bfe995d0ffd2402fe42f8b1f47adf /pugl/detail/x11.c
parent0f114d846286355c90df02ef45e9c7e098b71104 (diff)
downloadpugl-c1c69abf7bc964b6e2c1c5d5c1ba7f1542dcecc4.tar.gz
pugl-c1c69abf7bc964b6e2c1c5d5c1ba7f1542dcecc4.tar.bz2
pugl-c1c69abf7bc964b6e2c1c5d5c1ba7f1542dcecc4.zip
Only resize backend when necessary
This avoids resizing the backend when the window is only moved, which fixes flicker with Cairo where resizing is expensive.
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r--pugl/detail/x11.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 49c843b..4099553 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -648,14 +648,18 @@ flushPendingConfigure(PuglView* view)
PuglEvent* const configure = &view->impl->pendingConfigure;
if (configure->type) {
- view->frame.x = configure->configure.x;
- view->frame.y = configure->configure.y;
- view->frame.width = configure->configure.width;
- view->frame.height = configure->configure.height;
-
- view->backend->resize(view,
- (int)view->frame.width,
- (int)view->frame.height);
+ view->frame.x = configure->configure.x;
+ view->frame.y = configure->configure.y;
+
+ if (configure->configure.width != view->frame.width ||
+ configure->configure.height != view->frame.height) {
+ view->frame.width = configure->configure.width;
+ view->frame.height = configure->configure.height;
+
+ view->backend->resize(view,
+ (int)view->frame.width,
+ (int)view->frame.height);
+ }
view->eventFunc(view, configure);
configure->type = 0;