aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r--pugl/detail/win.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index 9debb6d..6ef9255 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -435,20 +435,25 @@ handleConfigure(PuglView* view, PuglEvent* event)
(LPPOINT)&rect,
2);
- view->frame.x = rect.left;
- view->frame.y = rect.top;
- view->frame.width = rect.right - rect.left;
- view->frame.height = rect.bottom - rect.top;
+ const LONG width = rect.right - rect.left;
+ const LONG height = rect.bottom - rect.top;
+
+ view->frame.x = rect.left;
+ view->frame.y = rect.top;
event->configure.type = PUGL_CONFIGURE;
event->configure.x = view->frame.x;
event->configure.y = view->frame.y;
- event->configure.width = view->frame.width;
- event->configure.height = view->frame.height;
+ event->configure.width = width;
+ event->configure.height = height;
+
+ if (view->frame.width != width || view->frame.height != height) {
+ view->frame.width = width;
+ view->frame.height = height;
+
+ view->backend->resize(view, width, height);
+ }
- view->backend->resize(view,
- rect.right - rect.left,
- rect.bottom - rect.top);
return rect;
}