summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-14 14:12:14 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-14 14:12:14 +0300
commit459f73f2623f66e2887aae6feff2ec0fab185b2c (patch)
tree8cad6eaadc45a43597a3b04f35ab6c5e5676aa51
parentc2dd6107db2ff4b8001085068f4c1c5971cdd9c3 (diff)
Window: Don’t post redundant resize commands
-rw-r--r--src/ui/window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 315c4243..e0dfe813 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -341,10 +341,13 @@ static void setupUserInterface_Window(iWindow *d) {
341 341
342static void updateRootSize_Window_(iWindow *d) { 342static void updateRootSize_Window_(iWindow *d) {
343 iInt2 *size = &d->root->rect.size; 343 iInt2 *size = &d->root->rect.size;
344 const iInt2 oldSize = *size;
344 SDL_GetRendererOutputSize(d->render, &size->x, &size->y); 345 SDL_GetRendererOutputSize(d->render, &size->x, &size->y);
345 arrange_Widget(d->root); 346 if (!isEqual_I2(oldSize, *size)) {
346 postCommandf_App("window.resized width:%d height:%d", size->x, size->y); 347 arrange_Widget(d->root);
347 postRefresh_App(); 348 postCommandf_App("window.resized width:%d height:%d", size->x, size->y);
349 postRefresh_App();
350 }
348} 351}
349 352
350static float pixelRatio_Window_(const iWindow *d) { 353static float pixelRatio_Window_(const iWindow *d) {