Commit Graph

2689 Commits

Author SHA1 Message Date
Camilla Löwy
6876cf8d7e Remove errors for gamepad element mismatch
Because there are controllers in the wild using the same hardware ID
despite having different numbers of buttons and axes, an error message
was triggered that was only expected for a corrupted mapping database.

This removes the error for now, in preparation for better error handling
for gamepad mappings overall.

Fixes #1763.
2021-06-25 20:19:40 +02:00
Camilla Löwy
a89fcd20d8 Wayland: Fix missing constant on FreeBSD
On FreeBSD O_CLOEXEC is only available when _POSIX_C_SOURCE >= 200809.
O_CLOEXEC is in turn required by the epollshim header.

Issue reported on IRC.
2021-06-22 00:30:39 +02:00
Camilla Löwy
114776a246 EGL: Fix creation of single-buffered windows
The EGL backend ignored the state of GLFW_DOUBLEBUFFER and always
created a double-buffered EGL window.

This sets the EGL_RENDER_BUFFER attribute at EGL window creation
appropriately.

Fixes #1843.
2021-05-14 19:02:25 +02:00
Camilla Löwy
fd79b02840 Move single/double-buffer filtering to backends
There is no need to enumerate framebuffer configs that will just be
filtered out later by the GLFW_DOUBLEBUFFER hard constraint.
2021-05-14 19:02:25 +02:00
Camilla Löwy
184377b493 Skip initial buffer swap when single-buffered
This skips the buffer swap after the initial glClear performed during
window creation, if the window is single-buffered.  This call confused
apitrace into thinking the window was double-buffered.

Fixes #1873.
2021-05-14 19:02:25 +02:00
Camilla Löwy
04f21abb52 Make GLFW_DOUBLEBUFFER a window attribute 2021-05-14 19:02:25 +02:00
Camilla Löwy
da236ba807 Make monitor and joystick names static strings
Related to #478.
2021-05-14 19:02:08 +02:00
Camilla Löwy
9a3a8bc267 Win32: Always define UNICODE and _UNICODE 2021-04-23 14:46:47 +02:00
Camilla Löwy
a646f51bca Win32: Fix macros being enabled for other backends
_UNICODE should not be defined for other backends even when built on
Windows.
2021-04-23 14:46:47 +02:00
Konstantin Podsvirov
e3f916808d Fix hardcoded runtime destination in CMake install
Closes #1883.
Closes #1884.
2021-04-22 22:47:16 +02:00
Camilla Löwy
061a0263a9 Win32: Fix compilation with standalone LLVM
The /clang: suffix passed to Clang-CL was accidentally also passed to
the regular standalone Clang, which caused compilation to fail.  We now
pass /W3 to Clang-CL, which it interprets as -Wall.

The _CRT_SECURE_NO_WARNINGS macro is now defined for both Clang and
Clang-CL.

The /entry: flag passed to link.exe is now also passed to lld-link,
letting the windows subsystem tests and examples link.

Fixes #1807.
Closes #1824.
Closes #1874.
2021-04-22 22:37:37 +02:00
Camilla Löwy
85bce8a8ea Replace GL_ARB_debug_output in comments 2021-04-22 22:37:37 +02:00
Nicolas Caramelli
84f95a7d7f Add GLFW_X11_XCB_VULKAN_SURFACE init hint
This hint controls whether GLFW will try to use VK_KHR_xcb_surface
before falling back to VK_KHR_xlib_surface.

Closes #1793.
2021-04-14 23:38:22 +02:00
Camilla Löwy
52ba8c7f07 Win32: Add warning when option will have no effect
The GPU driver only looks in the executable for the symbol requesting
the high-performance GPU, so enabling them when buidling GLFW as a DLL
will have no effect.
2021-03-15 00:48:48 +01:00
Camilla Löwy
17ae300d96 Ignore cached state when setting window attributes
This filtering prevented valid changes if the native window state was
changed externally.
2021-03-14 23:16:17 +01:00
Camilla Löwy
1f34295a74 Win32: Add MinGW-w64 detection to version string 2021-03-09 23:36:05 +01:00
Camilla Löwy
4afa227a05 X11: Fix attribs not applied on leaving fullscreen
If the GLFW_DECORATED and/or GLFW_FLOATING window attributes were
changed while in fullscreen mode, the changes did not take effect when
the window entered windowed mode.

Bug reported on the GLFW forum.
https://discourse.glfw.org/t/turning-on-off-window-decorations-while-in-full-screen-wont-work-properly/1780
2021-03-08 21:55:26 +01:00
Camilla Löwy
b925a54ef1 Wayland: Move DPI fallback work to output done
This removes the dependency on the (unspecified) ordering of geometry
and mode events in wl_output.

Based on feedback from @linkmauve and @caramelli.

Related to #1792.
2021-02-10 20:43:11 +01:00
Camilla Löwy
729c9988d0 Win32: Fix content area rescaling on older systems
GLFW_SCALE_TO_MONITOR had no effect on Windows 8.1 up to and including
Windows 10 version 1607 (Anniversary Update), despite those having
support for per-monitor DPI.

That done was to avoid handling systems that have non-client scaling,
introduced in Windows 10 version 1607, without reliable overriding of
the new window size, introduced in Windows 10 version 1703 (Creators
Update).  Both are needed to keep the content area at a fixed size for
windows that have GLFW_SCALE_TO_MONITOR disabled.

This change enables window rescaling on Windows 8.1 and all later
versions but disables non-client scaling for unscaled windows on Windows
10 version 1607.  Versions after 1607 are unaffected.

Fixes #1511.
2021-02-10 20:41:40 +01:00
Camilla Löwy
410890aa80 Win32: Fix full screen windows affected by scaling
Per-monitor DPI scaling should not affect full screen windows.

Fixes #1582.
2021-02-10 20:28:54 +01:00
Camilla Löwy
6de084000b Cocoa: Fix console apps getting a dock icon
Regression introduced by @elmindreda in
8b11867464.
2021-02-10 18:14:32 +01:00
Laurent Aphecetche
384ff74a46 Cocoa: Fix install name for installed dylib
The install name was incorrectly set to a relative path.

This change leaves the install name of the installed dylib as
@rpath/soname.  Those who wish to override this can set the
CMAKE_INSTALL_NAME_DIR variable.

Closes #1504.
2021-01-18 23:52:27 +01:00
Camilla Löwy
f8d6801a50 Simplify references in CMake if-statements 2021-01-18 23:52:27 +01:00
Camilla Löwy
3959ee8949 Cocoa: Unify CG display to NS screen mapping
This moves the matching of CG displays to NS screens to monitor
enumeration time.
2021-01-18 23:52:27 +01:00
Nevyn Bengtsson
2bc52ca82e Cocoa: Use modern API to get display name
On Apple Silicon, IOKit is deprecated and there will be no
matching io_service that we can query for name. Luckilly,
NSScreen got an API to fetch the display name in 10.15.

This is a blocker to get glfw running on Apple Silicon.

Fixes #1809.
Closes #1833.
2021-01-18 23:52:27 +01:00
Camilla Löwy
5aff72aa00 Cocoa: Fix duplicate monitor connection events 2021-01-18 23:52:27 +01:00
Camilla Löwy
8b11867464 Cocoa: Fix menubar for unbundled apps on 10.15
NSApp setActivationPolicy: was being called too soon when the app was
not bundled and launched from the command line.

This fix is based on #1802 by @richardwilkes.

Fixes #1648.
Closes #1802.
2021-01-18 23:52:27 +01:00
Philip Rideout
f5af421a6b Cocoa: Fix duplicate video mode detection
Closes #1830.
2021-01-18 23:52:27 +01:00
ashishgamedev
761f97d6b6 Fix indentation in internal.h
Closes #1818.
2020-12-15 02:12:20 +01:00
Nicolas Caramelli
1adfbde4d7 Wayland: Move 96 DPI default to outputHandleMode
Closes #1792.
2020-12-09 19:11:40 +01:00
Luflosi
08e5a17063 Use switch statement instead of if-else-chain for cursor shapes
Closes #1739.
2020-12-08 15:45:14 +01:00
Leonard König
0dc1005c85 Wayland: Fix destroying CSDs in the correct order
On Wayland we implement Client-Side Decorations if the compositors do not
implement SSDs.  In that case, the destructors of the surfaces were called
in the wrong order, leading to a dereference of an already freed object.
We need to first destroy the subsurface before destroying the parent surface.

Related PR on kitty: https://github.com/kovidgoyal/kitty/pull/3066
Related issue on kitty: https://github.com/kovidgoyal/kitty/issues/3051

Closes #1798.
2020-11-19 02:47:30 +01:00
Camilla Löwy
3327050ca6 Cocoa: Fix ObjC being built as C with CMake 3.19
CMake 3.19 adds -xc when the LANGUAGE file property is C, breaking our
workaround for CMake 3.15 and earlier not understanding the .m suffix.

Fixes #1787.
2020-11-18 00:11:13 +01:00
Camilla Löwy
2f76f70c76 Wayland: Simplify adding of protocol sources 2020-11-11 19:11:38 +01:00
Camilla Löwy
420b165bff Wayland: Fix indentation 2020-11-11 19:11:38 +01:00
Camilla Löwy
a62a6c5019 Wayland: Scanner tool has input and output args 2020-11-11 19:11:38 +01:00
Camilla Löwy
d5f32dfb3b Wayland: Ensure paths are passed on in quoted form 2020-11-11 19:11:38 +01:00
Camilla Löwy
a6f8cc9d44 Fix unquoted paths with variable references
Whitespace is a field separator in CMake.
2020-11-11 19:11:38 +01:00
Joel Winarske
af8f9713dd Wayland: Fix CMake binary dir when built as subdir
Regression introduced by 2747e47393.

Related to #1782.
2020-11-11 19:10:19 +01:00
Camilla Löwy
0bccc3852b Win32: Filter out duplicate size events
This mirrors the filtering done on X11 and Cocoa.  Possibly this should
be done by shared code instead.

Fixes #1610.
2020-11-11 19:10:19 +01:00
Camilla Löwy
ac627706ef Win32: Fix clang-cl interpreting -Wall as /Wall
Unlike -Wall, VS /Wall really means all warnings.

Closes #1780.
2020-11-11 19:10:05 +01:00
Camilla Löwy
6b78419c9a Win32: Enable /W3 on VS for library sources
/W3 is the default for new VS projects and the library builds cleanly
with it on VS 2010-2019 so let's try to keep it that way.
2020-11-11 19:09:10 +01:00
Camilla Löwy
9b140d08d7 Remove ignored Clang compiler flag
Clang ignores this when C99 is enabled, while GCC does not.  Removing
the checks for Clang to hopefully avoid a false sense of security.
2020-11-11 19:07:26 +01:00
Andy Williams
c940695eb0 Fix macOS Print Screen
Many years ago this value was changed from F13 to Print Screen with
1ae9ce1e0a.  However, this was later
reverted to F13 with 5759d0fdf2.

This changes it back to Print Screen for consistency with other
platforms.

Closes #1786.
2020-10-20 19:59:16 +02:00
Nicolas Caramelli
0ef149c8f2 Wayland: Assume 96 DPI if physical size is <= 0 2020-10-14 12:04:28 +02:00
Vladimir Perminov
53b1396a09 Win32: Fix value for _WIN32_WINNT_WINBLUE
An incorrect value for _WIN32_WINNT_WINBLUE caused GLFW to think Windows
8 was 8.1 or greater.  This led to a crash when attempting to call
SetProcessDpiAwareness.

Closes #1775.
2020-10-05 23:24:12 +02:00
Doug Binks
166611cef5 Win32: Update all monitor handles on config change
Closes #1761.
2020-10-05 23:24:12 +02:00
Emmanuel Gil Peyrot
2e6fb7fe22 Wayland: Remove extra trailing whitespace 2020-09-30 17:02:32 +02:00
Joel Winarske
2747e47393 Wayland: Remove extra-cmake-modules dependency
Fixes #1774.
2020-09-30 17:02:26 +02:00
Camilla Löwy
7765451d0f Formatting 2020-08-23 18:33:57 +02:00