aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
6 daysReplace frame with size and position hintsDavid Robillard6-132/+123
6 daysAdd PUGL_CURRENT_SIZE hint and make size hints dynamicDavid Robillard4-29/+40
6 daysRemove puglSetFrame()David Robillard3-92/+0
Towards fully separating position from size.
6 daysMacOS: Avoid puglSetFrame() in puglRealize()David Robillard1-7/+15
6 daysMacOS: Avoid puglSetFrame() in puglSetPosition() and puglSetSize()David Robillard1-20/+19
7 daysFix accidentally exported symbolDavid Robillard1-1/+0
7 daysUpdate clang-format configurationDavid Robillard7-37/+18
7 daysUse angle brackets for library includes and clean up include pathsDavid Robillard24-32/+32
8 daysRemove deprecated APIDavid Robillard3-51/+0
As far as I can tell, nobody actually cares about this in practice now, and it's slated for removal anyway.
8 daysFully parenthesize mathematical expressionsDavid Robillard3-7/+8
8 daysX11: Gracefully handle failure of clock_gettime()David Robillard1-1/+4
As gracefully as possible given the API anyway. I don't think this is an error case that happens enough to really need transparent error handling, if the clock doesn't work all is lost anyway. Appeases cert-err33-c, which started caring about clock_gettime() in clang-tidy 19.
8 daysUpdate whitespaceDavid Robillard1-1/+2
Apparently clang-format 19 decided to get even worse in this case. The C and C++ committes really, really should have sorted out this nonsense a decade ago.
14 daysConsistently use unsigned literals for event flagsDavid Robillard4-32/+32
14 daysWindows: Improve clipboard reliabilityDavid Robillard1-2/+15
14 daysWindows: Actually use impl variablesDavid Robillard1-14/+13
14 daysWindows: Ignore return value of SetForegroundWindowDavid Robillard1-1/+1
It turns out that this is flaky for reasons that aren't terribly clear from the documentation. So, just ignore it, it's not the end of the world if raising doesn't happen anyway.
14 daysWindows: Improve error handlingDavid Robillard1-46/+30
14 daysWindows: Simplify message pollingDavid Robillard1-21/+6
The internal puglPollWinEvents() abstraction was doing more harm than good.
14 daysWindows: Avoid using a floating point loop counterDavid Robillard1-1/+3
2025-01-23Replace puglPostRedisplayRect() with puglObscureRegion()David Robillard3-20/+55
2025-01-23Rename puglPostRedisplay() to puglObscureView()David Robillard3-5/+5
For consistency with event types (since "obscure" is opposite "expose") and the upcoming puglObscureRegion().
2025-01-23Simplify some conditionalsDavid Robillard1-3/+4
2025-01-22Simplify initial position code and place children at the originDavid Robillard5-134/+121
The code to find the initial size and position for a view had a lot of duplication, and was inconsistent between platforms. Flaky positioning and attempting to center embedded children has historically caused a bunch of problems in general, particularly since windows can be resized. So, factor out all the initial size and position code so that the logic is in one centralized place used by all platforms, and always position embedded children within their parent at the top/left origin. For top-level windows, the view is centered on its transient parent or the screen (as before). A new platform function puglGetAncestorCenter() is used to do this in general code. Also towards a total separation of position and size, towards support for Wayland, where applications don't dictate their own positions.
2025-01-22Factor out puglIsValidSize()David Robillard5-5/+14
2025-01-22Factor out puglIsValidPosition()David Robillard6-8/+17
2025-01-22Rename PuglViewSize to PuglAreaDavid Robillard7-36/+36
2025-01-22Make puglSetSizeHint() consistent with puglSetSize()David Robillard5-26/+34
In general, it's more convenient to have full-width integers as parameters, since C will promote any arithmetic on smaller types to them anyway. Using narrow types here, then, doesn't really make anything stricter, just forces an annoying cast when lots of warnings are enabled, which is likely unchecked. Better to handle it here, since it's more convenient, and the integer range checks the compiler can do aren't correct anyway (the max width/height is intentionally smaller than the max PuglSpan, so it can fit in a signed 16-bit integer).
2025-01-22Windows: Avoid waiting less than a millisecondDavid Robillard1-2/+4
There is API to access the minimum timer resolution, but it seems to always be 1 millisecond, which is also the unit of the MsgWaitForMultipleObjects parameter, so just avoid the fuss and hardcode this as the minimum. This should slightly reduce overhead when the main loop is running without much of a margin until the frame needs to be drawn.
2025-01-21Use a consistent naming scheme for parent functionsDavid Robillard1-2/+2
These could be combined into a hint-like general get/set mechanism, but currently there's only two window relationships and no immediate plans to add more, so that feels a bit over-engineered. So, just rename for consistency with puglSetTransientParent().
2025-01-21Use PuglSpan for view sizesDavid Robillard1-1/+1
2025-01-21Support building for Windows with or without UNICODEDavid Robillard1-40/+63
2025-01-21Use enums for WGL constantsDavid Robillard1-24/+36
2025-01-21X11: Generate text events for keypad symbolsMartin Preinfalk1-1/+2
2025-01-21Make MacOS touchpad scroll sensitivity closer to other platformsDavid Robillard1-3/+3
2025-01-21Add missing const qualifierDavid Robillard1-1/+1
2025-01-21Add PUGL_KEY_NONEDavid Robillard4-9/+8
This isn't a strict enumeration anyway, so a sentinel value does no harm, and using it avoids warnings about testing an enum with no zero value.
2025-01-21Fix whitespaceDavid Robillard2-8/+2
2025-01-21Fix warnings in clang build on WindowsDavid Robillard1-12/+15
2024-10-01Suppress new warnings in clang and clang-tidy 18David Robillard1-1/+3
2024-07-13MacOS: Fix mouse wheel scroll speedDavid Robillard1-5/+11
This just happens to be the factor that results in one tick of a conventional mouse wheel being a change of 1.0 "lines" as on other platforms (at least for me, hopefully everywhere). Moving a wheel quickly does result in quite a lot of acceleration on MacOS though, so more refinement might be needed here for consistent event handling across platforms.
2024-07-13MacOS: Fix expose event coordinatesDavid Robillard1-1/+4
2024-07-13X11: Avoid setting PBaseSize hints for top-level windowsDavid Robillard1-1/+2
By my reading of the spec, pugl's use of this hint was correct. However, many window managers break when it's set and use that size as the minimum (even when an actual minimum is set). This seems to be a bug based on a misreading of the spec which has been copy-pasted across many small window manager projects over the years. Not exposing the default size is unfortunate, but apparently nobody misses features based on it and there's nothing we can do about it here, so just deny the window manager the information entirely. The hint is still set for embedded views because (for example) plugin hosts need this information.
2024-07-12Windows: Support building with UNICODEDavid Robillard3-20/+37
2024-06-10Fix build and tests with optional X11 features disabledDavid Robillard1-1/+1
2023-11-11MacOS: Fix Cairo rendering on some systemsDavid Robillard1-3/+1
CGContextConvertSizeToUserSpace returns a negative height on some systems and a positive height on others. I have no idea why, but only basic scaling is required here, so just avoid this function entirely.
2023-11-11Add support for Num, Scroll, and Caps LockDavid Robillard4-20/+37
2023-11-11MacOS: Support left/right shift, control, and option keysDavid Robillard1-4/+6
2023-10-22X11: Only call XSetTransientForHint for valid windowsfalkTX1-1/+1
Signed-off-by: falkTX <falktx@falktx.com>
2023-10-21Fix potential memory leaks due to realloc() failureDavid Robillard2-31/+55
2023-10-21Fix whitespaceDavid Robillard1-1/+2