diff options
author | David Robillard <d@drobilla.net> | 2025-02-08 16:49:06 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-08 18:02:30 -0500 |
commit | 1395c97015ac9d5069881a038f4272a426fda9e9 (patch) | |
tree | 9049ba724b9866701f9fd0330038cb6965792663 /test/test_size.c | |
parent | 23b0774862b79543b93a9b50b4f085c2c396698a (diff) | |
download | pugl-1395c97015ac9d5069881a038f4272a426fda9e9.tar.gz pugl-1395c97015ac9d5069881a038f4272a426fda9e9.tar.bz2 pugl-1395c97015ac9d5069881a038f4272a426fda9e9.zip |
Replace frame with size and position hints
Diffstat (limited to 'test/test_size.c')
-rw-r--r-- | test/test_size.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/test_size.c b/test/test_size.c index 5c8eb04..386933c 100644 --- a/test/test_size.c +++ b/test/test_size.c @@ -87,7 +87,7 @@ main(int argc, char** argv) puglSetSizeHint(test.view, PUGL_MIN_SIZE, minSize, minSize); puglSetSizeHint(test.view, PUGL_MAX_SIZE, maxSize, maxSize); puglSetSizeHint(test.view, PUGL_FIXED_ASPECT, 1, 1); - puglSetPosition(test.view, 384, 384); + puglSetPositionHint(test.view, PUGL_DEFAULT_POSITION, 384, 384); // Create and show window assert(!puglRealize(test.view)); @@ -97,21 +97,22 @@ main(int argc, char** argv) } // Check that the frame matches the last configure event - const PuglRect frame = puglGetFrame(test.view); - assert(frame.x == test.configuredFrame.x); - assert(frame.y == test.configuredFrame.y); - assert(frame.width == test.configuredFrame.width); - assert(frame.height == test.configuredFrame.height); + const PuglPoint pos = puglGetPositionHint(test.view, PUGL_CURRENT_POSITION); + const PuglArea size = puglGetSizeHint(test.view, PUGL_CURRENT_SIZE); + assert(pos.x == test.configuredFrame.x); + assert(pos.y == test.configuredFrame.y); + assert(size.width == test.configuredFrame.width); + assert(size.height == test.configuredFrame.height); #if defined(_WIN32) || defined(__APPLE__) /* Some window managers on Linux (particularly tiling ones) just disregard these hints entirely, so we only check that the size is in bounds on MacOS and Windows where this is more or less universally supported. */ - assert(frame.width >= minSize); - assert(frame.height >= minSize); - assert(frame.width <= maxSize); - assert(frame.height <= maxSize); + assert(size.width >= minSize); + assert(size.height >= minSize); + assert(size.width <= maxSize); + assert(size.height <= maxSize); #endif // Tear down |