@@ -313,10 +313,7 @@ PuglStatus puglSetGeometryConstraints(PuglView* const view, const uint width, co
313313 #elif defined(DISTRHO_OS_MAC)
314314 if (view->impl ->window )
315315 {
316- if (const PuglStatus status = updateSizeHint (view, PUGL_MIN_SIZE ))
317- return status;
318-
319- if (const PuglStatus status = updateSizeHint (view, PUGL_FIXED_ASPECT ))
316+ if (const PuglStatus status = puglUpdateSizeHints (view))
320317 return status;
321318 }
322319 #elif defined(DISTRHO_OS_WASM)
@@ -331,7 +328,7 @@ PuglStatus puglSetGeometryConstraints(PuglView* const view, const uint width, co
331328 #elif defined(HAVE_X11)
332329 if (view->impl ->win )
333330 {
334- if (const PuglStatus status = updateSizeHints (view))
331+ if (const PuglStatus status = puglUpdateSizeHints (view))
335332 return status;
336333
337334 XFlush (view->world ->impl ->display );
@@ -358,7 +355,7 @@ void puglSetResizable(PuglView* const view, const bool resizable)
358355 }
359356 // FIXME use [view setAutoresizingMask:NSViewNotSizable] ?
360357 #elif defined(DISTRHO_OS_WASM)
361- updateSizeHints (view);
358+ puglUpdateSizeHints (view);
362359 #elif defined(DISTRHO_OS_WINDOWS)
363360 if (const HWND hwnd = view->impl ->hwnd )
364361 {
@@ -367,7 +364,7 @@ void puglSetResizable(PuglView* const view, const bool resizable)
367364 SetWindowLong (hwnd, GWL_STYLE , winFlags);
368365 }
369366 #elif defined(HAVE_X11)
370- updateSizeHints (view);
367+ puglUpdateSizeHints (view);
371368 #endif
372369}
373370
@@ -391,7 +388,7 @@ PuglStatus puglSetSizeAndDefault(PuglView* const view, const uint width, const u
391388 return status;
392389 }
393390 #elif defined(DISTRHO_OS_WASM)
394- if (const PuglStatus status = updateSizeHints (view))
391+ if (const PuglStatus status = puglUpdateSizeHints (view))
395392 return status;
396393
397394 emscripten_set_canvas_element_size (view->world ->strings [PUGL_CLASS_NAME ], width, height);
@@ -411,7 +408,7 @@ PuglStatus puglSetSizeAndDefault(PuglView* const view, const uint width, const u
411408 // matches upstream pugl, adds flush at the end
412409 if (view->impl ->win )
413410 {
414- if (const PuglStatus status = updateSizeHints (view))
411+ if (const PuglStatus status = puglUpdateSizeHints (view))
415412 return status;
416413
417414 if (const PuglStatus status = puglSetWindowSize (view, width, height))
@@ -608,20 +605,20 @@ void puglWin32ShowCentered(PuglView* const view)
608605
609606PuglStatus puglX11UpdateWithoutExposures (PuglWorld* const world)
610607{
611- const bool wasDispatchingEvents = world->impl -> dispatchingEvents ;
612- world->impl -> dispatchingEvents = true ;
608+ const PuglWorldState startState = world->state ;
609+ world->state = PUGL_WORLD_UPDATING ;
613610 PuglStatus st = PUGL_SUCCESS ;
614611
615612 const double startTime = puglGetTime (world);
616613 const double endTime = startTime + 0.03 ;
617614
618615 for (double t = startTime; !st && t < endTime; t = puglGetTime (world))
619616 {
620- pollX11Socket (world, endTime - t);
621- st = dispatchX11Events (world);
617+ if (!(st = pollX11Socket (world, endTime - t)))
618+ st = dispatchX11Events (world);
622619 }
623620
624- world->impl -> dispatchingEvents = wasDispatchingEvents ;
621+ world->state = startState ;
625622 return st;
626623}
627624
0 commit comments