aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2022-05-21Rename PUGL_UNSUPPORTED_TYPE to be more genericDavid Robillard4-5/+5
2022-05-21MacOS: Specify maximum size constraint on draw viewDavid Robillard1-15/+37
I am not sure why the minimum was only specified before, but it seems like an oversight.
2022-05-21X11: Use cursor themesDavid Robillard2-29/+42
This changes to getting cursors by name from the cursor theme, which makes the cursor match the ones used in modern desktop environments. As far as I can tell, there is no real standard for names, these ones seem to work for me in GNOME, KDE, and Xfce. I am not sure about the compatibility concerns here, but X11 without Xcursor themes strikes me as either too esoteric or too ancient to worry about, especially since cursor switching isn't critical functionality anyway.
2022-05-21Avoid setting cursor on realizationDavid Robillard1-4/+0
This avoids issues when the default X11 cursor isn't the expected "default" of the environment, for example with Plasma. A real application that changes the cursor needs to do so consistently on mouse enter and leave events anyway.
2022-05-20Windows: Set window class on local moduleDavid Robillard1-2/+10
This avoids potential clashes between multiple copies of Pugl statically compiled into several modules.
2022-05-03Fix crash when destroying OpenGL views that haven't been realizedJean Pierre Cimalando3-0/+9
2022-04-23Fix IWYU warningsDavid Robillard1-1/+0
I suspect that using the same configuration across both C and C++ is starting to wear a bit thin, but this will do for now.
2022-04-23Move reserved platform defines from code to build systemDavid Robillard2-8/+0
Numerous things warn about this, and it's generally a bad idea to put these in the code since it can result in incompatibly compiled code being linked together. Unfortunately this makes building manually (without the build system) more fiddly, but such is life.
2022-04-23Suppress warnings when building with clang on WindowsDavid Robillard1-0/+1
2022-04-23Windows: Remove redundant view size assignmentDavid Robillard1-5/+0
2022-04-23Windows: Avoid initialization warningDavid Robillard1-1/+2
2022-04-23Windows: Remove pointless const qualifiersDavid Robillard1-4/+1
2022-04-23Windows: Avoid else after returnDavid Robillard2-5/+15
2022-04-23Strengthen MSVC warningsDavid Robillard2-3/+3
2022-04-21Improve error handlingDavid Robillard8-79/+139
2022-04-21Remove unused return type from backend destroy methodsDavid Robillard11-35/+24
Since this is essentially a destructor, I don't think there's anything really useful to do with errors here, and in practice no backends actually used it anyway.
2022-04-21Move attribute definitions to a separate headerDavid Robillard4-12/+21
2022-04-21Fix private include guardsDavid Robillard5-15/+15
2021-12-17Reduce variable scopeDavid Robillard1-2/+2
2021-12-17Adopt REUSE machine-readable licensing standardDavid Robillard22-334/+48
See https://reuse.software/ for details.
2021-12-17Suppress new warnings in clang-tidy 13David Robillard1-1/+2
2021-12-17Windows: Support extended mouse buttonsDavid Robillard1-0/+14
2021-12-17Make button numbers consistent across platformsDavid Robillard3-7/+14
There's no universal consensus on how buttons are numbered. Left, right, middle as 0, 1, 2 seems to be the most common convention on modern vaguely similar libraries, so I've gone with that. The switch to zero-based indices will obviously break all current client code. Particularly since now is the time to finish any breaking changes before a stable release, I think that is better than only changing the middle and right numbers, which would likely go unnoticed.
2021-12-17Call glXQueryDrawable() from within the GLX contextDavid Robillard1-5/+8
This fixes getting the PUGL_SWAP_INTERVAL hint on some NVidia drivers.
2021-12-17Explicitly check for supported GLX extensionsDavid Robillard1-11/+24
2021-12-16Add puglGetBackend()David Robillard1-0/+6
2021-12-16Add puglGetClassName()David Robillard1-0/+6
2021-12-16Add puglGetWindowTitle()David Robillard1-0/+6
2021-12-16Add puglGetParentWindow()David Robillard1-0/+6
2021-12-16Add puglGetTransientParent()David Robillard1-0/+6
2021-12-16Rename puglSetTransientFor to puglSetTransientParentDavid Robillard3-3/+3
2021-12-16X11: Fix potential crash in puglGrabFocus()David Robillard1-1/+10
This is really a mistake in user code, but things shouldn't crash in general. So, this commit fixes the crash and adds some documentation so that developers hopefully don't try to grab focus before it makes sense. The case that was previously a crash will now gracefully fail, that is, the focus will not be (and can not be) grabbed.
2021-10-09Use the correct macro for GLX_CONTEXT_PROFILE_MASK_ARBfalkTX1-1/+1
GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB is the correct counterpart to GLX_CONTEXT_CORE_PROFILE_BIT_ARB in this context. This has the same value as the GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB it replaces though, so this change should not actually affect anything.
2021-10-09Only call SetProcessDPIAware in programsfalkTX1-10/+11
This prevents plugins from changing global host state, which causes serious problems in hosts that are not DPI aware.
2021-08-28Suppress new clang-tidy warningsDavid Robillard1-0/+2
2021-08-28X11: Check for XRandR extension before usagefalkTX1-6/+9
It happens in practice that XRandR is enabled in the build but is not available at runtime, particularly with X11 forwarding over SSH. This properly queries the extension first to avoid crashing in such situations.
2021-08-25Fix whitespaceDavid Robillard1-1/+2
2021-08-25MacOS: Fix build on MacOS 10.9 and earlierfalkTX1-0/+1
NSEventSubtype was introduced in 10.10.
2021-06-07MacOS: Reset GL context after initial window reshapefalkTX1-0/+1
2021-06-07MacOS: Fix conversion warningfalkTX1-1/+1
2021-05-28Fix questionable float equality comparisonDavid Robillard2-5/+5
This avoids a warning, and makes more sense in this situation anyway because negatives are also a bad configuration.
2021-05-27Make code build cleanly as C++David Robillard2-4/+14
2021-05-27Fix missing function sentinelDavid Robillard1-1/+1
2021-05-27Avoid confusing fallthrough structureDavid Robillard1-6/+4
2021-05-25Rename event structs in a more readable styleDavid Robillard14-43/+43
Aside from reading more naturally, this avoids clashes with types that are not events, like PuglEventFlags. This is also more consistent with the C++ bindings, where "EventExpose" would be quite strange, for example. Apologies for the noise. Aliases to the old names will be preserved in the deprecated API like other things for a short while.
2021-05-25Fix some conversion warningsDavid Robillard2-8/+8
Avoids narrowing warnings when building as C++, and uses unsigned operands with bitwise operators in various places.
2021-05-25Windows: Make puglSetFrame() consistent with X11falkTX1-2/+1
2021-05-25X11: Do not override _POSIX_C_SOURCE if already definedfalkTX1-1/+3
2021-05-24Shrink codeDavid Robillard1-4/+1
2021-05-24Separate stub backends from other backendsDavid Robillard11-183/+217
Stub backends were a dependency of other backends to allow some code reuse. However, that can cause conflicting symbols if multiple backends are linked into the same binary, which should be possible. To avoid this, move the shared code into the platform implementation, and export those symbols so that backends can use them. This adds some semi-public platform-specific API that can only be used by backends included with pugl. They are undocumented, subject to change at any time without a corresponding version change, and may not be used by third parties (for example by custom backends in an application).