Commit Graph

3941 Commits

Author SHA1 Message Date
Camilla Löwy
399c082033 X11: Fix content scale fallback value on KDE
KDE sometimes removes the Xft.dpi resource when it would be set to the
X11 default value of 96, causing GLFW to fall back to a value calculated
from the core display sizes in pixels and mm in a desktop environment
that supports Xft.dpi.

This moves to a hardcoded fallback value of 96 on the assumption that
there are more people running KDE with 96 DPI than there are people
running desktop environments that do not support Xft.dpi.

All of this is terrible please send help.

Fixes #1578.

(cherry picked from commit 75294462b3)
2019-11-05 18:03:11 +01:00
Camilla Löwy
1bf892f603 X11: Fix decoration enabling after window creation
This fixes the enabling of window decorations after creation.  Instead
of removing the _MOTIF_WM_HINTS property, we now set or unset the
MWM_DECOR_ALL bit of the decorations field.

Fixes #1566.

(cherry picked from commit 5fc4c01302)
2019-11-05 18:02:03 +01:00
Camilla Löwy
f9a9bb6747 Remove stray characters from hardcoded CFLAGS
The additional '>' characters were appended to the compiler option.

Related to #1576.

(cherry picked from commit 33683ec60e)
2019-11-05 18:01:18 +01:00
Camilla Löwy
91c6a542ff Cleanup
Related to #1585.

(cherry picked from commit 04f7f55f07)
2019-11-05 18:01:05 +01:00
Pablo Prietz
411d4dd51e Fix CMake 3.0 - 3.6 support regression
Replaces `VERSION_GREATER_EQUAL` with `VERSION_EQUAL OR
VERSION_GREATER`.  `VERSION_GREATER_EQUAL` was only added in CMake 3.7.

Fixes #1584.
Closes #1585.

(cherry picked from commit 4d0ae4ffa7)
2019-11-05 18:00:50 +01:00
Camilla Löwy
161e9e1215 Update changelog
(cherry picked from commit 36c547875c)
2019-11-05 17:59:27 +01:00
Camilla Löwy
3a8d97cc3d Allow AppVeyor to skip pure documentation updates
(cherry picked from commit 692754a2c5)
2019-11-05 17:59:23 +01:00
Corentin Wallez
afcefcb5f7 Fix -Wextra-semi warnings
Closes #1440.

(cherry picked from commit 3a37a08998)
2019-11-05 17:59:15 +01:00
Luflosi
8c69091c59 Use the correct type in a for loop
The `monitorCount` member in the `_GLFWlibrary` struct is of type `int`, so the `for` loop iterating over it should also use the type `int`.

Closes #1572.

(cherry picked from commit 7749aac50d)
2019-11-05 17:59:08 +01:00
Camilla Löwy
857951419a Use HTTPS for Discourse forum
(cherry picked from commit 1e20218b3d)
2019-11-05 17:59:03 +01:00
Camilla Löwy
17f1cceb32 Add credit
Related to #1576.

(cherry picked from commit 545f409592)
2019-11-05 17:58:59 +01:00
Guillaume Racicot
3f0390b827 Enable C99 explicitly with CMake where available
This enables compilation as C99 where supported by the compiler.
A workaround with per-compiler hardcoded flags is used for CMake 3.0,
which does not support the C_STANDARD target property.

Fixes #1560.
Closes #1576.

(cherry picked from commit 8f852e0833)
2019-11-05 17:58:45 +01:00
Camilla Löwy
4a62820646 Clean up monitors tool output
(cherry picked from commit f71b55f83d)
2019-11-05 17:58:21 +01:00
Luflosi
3facbd2083 Use the correct type for a struct member
The `name` member in the `_GLFWmonitorWayland` struct is used in two places. It is assigned the value from a variable of type `uint32_t` and is compared to another variable of type `uint32_t`, so `name` should also have the same type.

Closes #1569.

(cherry picked from commit d25248343e)
2019-11-05 17:58:10 +01:00
Camilla Löwy
e4e9581557 Add VS 2010 and MinGW to AppVeyor build matrix
VS 2010 and MinGW are the two trickiest Windows environments so this
should hopefully catch more mistakes.  This is probably not the right
way to set up any of this, but it works for now.

This is also a first step towards building our release binaries with CI.

[skip travis]

(cherry picked from commit 1bd0a55aa7)
2019-10-04 02:18:50 +02:00
Camilla Löwy
087110aa63 Win32: Cleanup keyboard input flag parsing
This replaces some magic numbers with the corresponding winuser.h
provided macros and unifies how the MSB from Get*KeyState is tested.

(cherry picked from commit 3d2540c373)
2019-10-04 02:18:48 +02:00
Camilla Löwy
e30718e927 Win32: Disable dynamic libgcc for MinGW DLL
(cherry picked from commit 3ec8f4a7f5)
2019-10-04 02:18:46 +02:00
Luflosi
613b169899 Use the correct type in a for loop
The `size` member in the `GLFWgammaramp` struct is of type `unsigned int`, so the `for` loop iterating over it should also use the type `unsigned int`.

Closes #1541.

(cherry picked from commit 243b1bc292)
2019-10-04 02:18:43 +02:00
luz.paz
13a4e4e810 Fix typos
Found via `codespell -q 3 -S ./deps -L fo,numer,te,uint,wille`

(cherry picked from commit 7105ff2dfd)
2019-09-23 15:27:17 +02:00
Camilla Löwy
a1b65e8542 Cocoa: Fix glfwSetWindowSize anchor point
This makes glfwSetWindowSize use the top-left corner as anchor point
instead of the bottom-left corner.

Fixes #1553.

(cherry picked from commit 7f02898264)
2019-09-23 15:27:00 +02:00
Camilla Löwy
649553cc78 Remove deprecated tags from Doxyfile.in
This fixes warnings emitted by Doxygen 1.8.16.

(cherry picked from commit aa8e8ab960)
2019-09-23 15:26:52 +02:00
Camilla Löwy
934f0e9ff1 Update changelog and add credit
Related to #1556.

(cherry picked from commit 26aac53e1d)
2019-09-23 15:26:43 +02:00
httpdigest
b2919dca4b Fix comparison of video modes of equal area
This fixes the bug of video modes being discarded if they had
a different resolution but the same area as another mode.

Fixes #1555.
Closes #1556.

(cherry picked from commit 2777f6a754)
2019-09-23 15:26:37 +02:00
Camilla Löwy
71cfafe2f9 Win32: Fix VS static analysis false positive
This way is perhaps also more readable for humans.

(cherry picked from commit cbf23e5615)
2019-09-23 15:26:28 +02:00
Camilla Löwy
79f4ec6822 Unify key name string handling
This makes key names per-key static strings for all supported platforms.

Fixes #1200.

(cherry picked from commit 56ca0cb3b3)
2019-09-23 15:26:23 +02:00
Camilla Löwy
2032a8f0dc Clarify comment
(cherry picked from commit 4cc5d2e623)
2019-09-23 15:26:17 +02:00
Camilla Löwy
c0d1249ca2 Fix license copyright year and formatting
(cherry picked from commit f764836e58)
2019-09-23 15:26:13 +02:00
Camilla Löwy
2d3f388158 Win32: Fix initial state of maximized state cache
(cherry picked from commit 2c7ef5b480)
2019-09-23 15:26:08 +02:00
Camilla Löwy
30e67357be Win32: Fix GLFW_MAXIMIZED not maximizing window
The window rect adjustment for content scale broke the initial, correct
maximization performed when creating the window with WS_MAXIMIZE.  This
switches to updating the restored rect instead of the current rect.

Fixes #1499.
Closes #1503.

(cherry picked from commit 711b9694a1)
2019-09-23 15:25:51 +02:00
Camilla Löwy
116f4c831d Put fix in correct position
This fixes a mismerge by @elmindreda in
65748fb8f3.

(cherry picked from commit efda4afb49)
2019-09-23 15:25:31 +02:00
Camilla Löwy
1e8dc836a0 Fix Vulkan triangle test segfault on resize
The command buffer handle was not reset after being freed on window
resize, leading to a segfault when the stale handle was used.

(cherry picked from commit 65748fb8f3)
2019-09-23 15:25:28 +02:00
Camilla Löwy
adcd306fbd Fix conflict with DEBUG macro defined by Bazel
The Bazel build system may define DEBUG when compiling on macOS, which
caused the glfwinfo test program to fail to build.

Fixes #1537.

(cherry picked from commit 6abad2efd2)
2019-09-23 15:25:17 +02:00
Camilla Löwy
b1309dd42a Add credit
(cherry picked from commit b0692d73ddb66461549cda0a009f867dab9de0fd)
2019-07-22 23:26:02 +02:00
Ave Milia
d25e19b790 CMake: remove -DGLFW_DLL on non-Windows targets
When using GLFW with CMake and installed GLFW binaries, `-DGLFW_DLL` is
passed on Linux, which should not happen.

Closes #1530.

(cherry picked from commit d7fb01750ece465cfaae0493dfe3003da1e5f500)
2019-07-22 23:26:02 +02:00
Camilla Löwy
1daf9de40f Cocoa: Fix internal symbol hiding for dylib
The default symbol visibility was not set to hidden on macOS.

(cherry picked from commit b430bc4935)
2019-07-22 23:25:52 +02:00
Camilla Löwy
cfd93597ec Cocoa: Fix file-local function not declared static
(cherry picked from commit 062a1c22b5)
2019-07-22 23:24:56 +02:00
Camilla Löwy
8e923e592d Documentation work
[ci skip]

(cherry picked from commit a4d910b4a7)
2019-07-16 14:41:23 +02:00
Leon Linhart
9fc035a562 Win32: Fix cursor enter/position event order
This fixes the cursor enter event being emitted after the first cursor
position event on Windows.

Closes #1490.

(cherry picked from commit 4f0b8b0dda)
2019-07-16 14:41:16 +02:00
Camilla Löwy
ce7cd3e288 Add credits
(cherry picked from commit 7bd0af3089)
2019-07-16 14:41:10 +02:00
Lukas Zanner
452a648abb Fix typo in glfwGetRequiredInstanceExtensions docs
Closes #1500.

(cherry picked from commit 84b13113ed)
2019-07-16 14:41:06 +02:00
Camilla Löwy
75b415c5b8 Cleanup
(cherry picked from commit 62b7fe8311)
2019-07-16 14:40:58 +02:00
Camilla Löwy
248e827673 Win32: Fix symbol redefinition warnings
When both GLFW_INCLUDE_VULKAN and VK_USE_PLATFORM_WIN32_KHR were
defined, the GLFW header would define replacement versions of APIENTRY
and WINGDIAPI /before/ including the Vulkan header, which would include
windows.h, which (justifiably) defines APIENTRY and WINGDIAPI blindly.

Fixes #1524.

(cherry picked from commit 773f4495f0)
2019-07-16 14:40:52 +02:00
Camilla Löwy
95e7ad7e5b Update changelog
Related to #1528.

(cherry picked from commit 5bea122211)
2019-07-16 14:40:39 +02:00
Camilla Löwy
ff2c00091d Cleanup
Related to #1528.

(cherry picked from commit d232bcfcdd)
2019-07-16 14:39:38 +02:00
Denis Bernard
b3eb6dd38b X11: Query and keep track of Xkb group index
For users with multiple keyboard layouts configured, glfwGetKeyName
works fine only with the primary layout.  Switching layouts results in
changing the group index.  This commit querries the current group index
when initializing keyboard input and keeps track of any change to it.

As a result the scancode -> keyname mapping may change while the program
is running (needs to be documented).

Fixes #1462.
Closes #1528.

(cherry picked from commit 36f90800d8)
2019-07-16 14:39:34 +02:00
Camilla Löwy
84fa724456 X11: Fix focus events not being filtered
The filter condition had ended up below the action.

(cherry picked from commit c6b95e3b07)
2019-07-16 14:39:28 +02:00
Luflosi
633ba53f2c Fix typo
Closes #1513.

(cherry picked from commit e463e85bba)
2019-07-16 14:39:19 +02:00
Camilla Löwy
898b7f9c54 Remove unused function in tearing test
(cherry picked from commit 3a5e99e59a)
2019-07-16 14:39:12 +02:00
Camilla Löwy
eb466a0e0b Cocoa: Cleanup
This makes the Cocoa _glfwPlatformSetWindowMonitor consistent with its
X11 and Win32 counterparts.

(cherry picked from commit 3262c29440)
2019-07-16 14:39:05 +02:00
A. Tombs
8542f8dd84 Win32: Cleanup pointer test in win32_window.c
MSVC 2019 complains that the code at line 1744
(`GetMonitorInfo(window->monitor->win32.handle, &mi);`) can potentially
dereference a null pointer. The compiler is wrong in this case (it has
not spotted that `monitor` and `window->monitor` must be equal), but
I think it makes sense for our non-NULL test to be on the variable we
actually use rather than the one it was set from.

Related to #1491.

(cherry picked from commit 1d62157268)
2019-07-16 14:39:02 +02:00