From 23b0774862b79543b93a9b50b4f085c2c396698a Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Sat, 8 Feb 2025 16:48:43 -0500
Subject: Add PUGL_CURRENT_SIZE hint and make size hints dynamic

---
 include/pugl/pugl.h | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

(limited to 'include')

diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h
index 8ecea0e..6aaca58 100644
--- a/include/pugl/pugl.h
+++ b/include/pugl/pugl.h
@@ -982,6 +982,15 @@ typedef enum {
   */
   PUGL_DEFAULT_SIZE,
 
+  /**
+     Current size.
+
+     This reflects the current size of the view, which may be different from
+     the default size if the view is resizable.  Typically, it overrides the
+     default size.
+  */
+  PUGL_CURRENT_SIZE,
+
   /**
      Minimum size.
 
@@ -1183,14 +1192,15 @@ puglSetSize(PuglView* view, unsigned width, unsigned height);
 /**
    Set a size hint for the view.
 
-   This can be used to set the default, minimum, and maximum size of a view,
-   as well as the supported range of aspect ratios.
+   This can be used to set the default, current, minimum, and maximum size of a
+   view, as well as the supported range of aspect ratios.
 
    This should be called before puglRealize() so the initial window for the
-   view can be configured correctly.
+   view can be configured correctly.  It may also be used dynamically after the
+   window is realized, for some hints.
 
-   @return #PUGL_UNKNOWN_ERROR on failure, but always succeeds if the view is
-   not yet realized.
+   @return An error code on failure, but always succeeds if the view is not yet
+   realized.
 */
 PUGL_API PuglStatus
 puglSetSizeHint(PuglView*    view,
-- 
cgit v1.2.1