Commit Graph

2506 Commits

Author SHA1 Message Date
Corentin Wallez
3a37a08998 Fix -Wextra-semi warnings
Closes #1440.
2019-10-17 20:09:38 +02:00
Luflosi
7749aac50d
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.
2019-10-17 13:47:28 +02:00
Guillaume Racicot
8f852e0833 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.
2019-10-16 02:33:12 +02:00
Luflosi
d25248343e 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.
2019-10-06 17:36:46 +02:00
Camilla Löwy
3d2540c373 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.
2019-10-03 21:05:49 +02:00
Camilla Löwy
3ec8f4a7f5 Win32: Disable dynamic libgcc for MinGW DLL 2019-10-03 21:05:49 +02:00
Luflosi
243b1bc292 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.
2019-09-23 13:43:05 +02:00
luz.paz
7105ff2dfd Fix typos
Found via `codespell -q 3 -S ./deps -L fo,numer,te,uint,wille`
2019-09-16 12:30:25 +02:00
Camilla Löwy
7f02898264 Cocoa: Fix glfwSetWindowSize anchor point
This makes glfwSetWindowSize use the top-left corner as anchor point
instead of the bottom-left corner.

Fixes #1553.
2019-09-06 16:57:37 +02:00
httpdigest
2777f6a754 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.
2019-09-01 21:57:06 +02:00
Camilla Löwy
cbf23e5615 Win32: Fix VS static analysis false positive
This way is perhaps also more readable for humans.
2019-08-28 20:59:49 +02:00
Camilla Löwy
56ca0cb3b3 Unify key name string handling
This makes key names per-key static strings for all supported platforms.

Fixes #1200.
2019-08-27 19:29:56 +02:00
Camilla Löwy
4cc5d2e623 Clarify comment 2019-08-15 17:25:36 +02:00
Camilla Löwy
2c7ef5b480 Win32: Fix initial state of maximized state cache 2019-08-14 19:18:29 +02:00
Camilla Löwy
711b9694a1 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.
2019-08-13 16:08:15 +02:00
Ave Milia
2e039d9275 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.
2019-07-22 21:37:22 +02:00
Camilla Löwy
b430bc4935 Cocoa: Fix internal symbol hiding for dylib
The default symbol visibility was not set to hidden on macOS.
2019-07-16 23:14:16 +02:00
Camilla Löwy
062a1c22b5 Cocoa: Fix file-local function not declared static 2019-07-16 23:12:20 +02:00
Leon Linhart
4f0b8b0dda 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.
2019-07-12 16:39:17 +02:00
Camilla Löwy
d232bcfcdd Cleanup
Related to #1528.
2019-07-12 15:00:51 +02:00
Denis Bernard
36f90800d8 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.
2019-07-12 14:08:43 +02:00
Camilla Löwy
c6b95e3b07 X11: Fix focus events not being filtered
The filter condition had ended up below the action.
2019-07-11 00:36:34 +02:00
Luflosi
e463e85bba
Fix typo
Closes #1513.
2019-07-01 11:30:57 +02:00
Camilla Löwy
3262c29440 Cocoa: Cleanup
This makes the Cocoa _glfwPlatformSetWindowMonitor consistent with its
X11 and Win32 counterparts.
2019-06-27 18:14:48 +02:00
A. Tombs
1d62157268 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.
2019-06-27 18:14:48 +02:00
Camilla Löwy
1f508530f0 X11: Let the language initialize XEvent structs 2019-06-27 18:14:48 +02:00
Camilla Löwy
fad9896d38 X11: Clean up EWMH feature detection
The EWMH feature detection atoms are now named and loaded the same way
as other X11 atoms.  Detection is now performed after all
non-conditional atoms have been loaded.  The EWMH detection now has
hopefully more readable comments.
2019-06-27 18:14:48 +02:00
Camilla Löwy
0c6b505619 Convert some declarations to C99 style 2019-06-27 18:13:29 +02:00
Luflosi
2db3b9688d
Replace some tabs with spaces
I found some tabs where there should be spaces for consistency.
Closes #1496.
2019-06-16 16:57:09 +02:00
Camilla Löwy
84ec99bb01 Remove pointless comments 2019-05-24 14:43:49 +02:00
Camilla Löwy
d0c3fa900a Win32: Fix non-client actions for disabled cursor
Disabled cursor mode interfered with some non-client actions.
2019-05-24 14:43:49 +02:00
Camilla Löwy
267e06a41e Win32: Remove stale comment 2019-05-24 14:43:49 +02:00
Camilla Löwy
22a6c02a4c WGL: Add extension function macro aliases
This should have been done when the WGL extension members were moved
from the context struct to the library struct.
2019-05-24 14:43:49 +02:00
Camilla Löwy
3fd4e79adb WGL: Fix misplaced block comment 2019-05-24 14:43:49 +02:00
Camilla Löwy
56aad76b16 Add C dialect reminders to each source file
Files built for Win32 must use C89 style declarations for compatibility
with VS 2010 and 2012, which are still supported by GLFW.
2019-05-24 14:43:49 +02:00
Camilla Löwy
0b01d850ed NSGL: Remove enforcement of forward-compatible flag
This sharp corner should have been addressed a long time ago.
2019-05-19 21:10:29 +02:00
Camilla Löwy
a255e7ace6 Move to the modern CMake project version option
This replaces the manual ad-hoc version variables we have used since
CMake 2.x (and GLFW 2.x lite).
2019-05-17 16:12:52 +02:00
Konstantin Podsvirov
15af302f77 Fix use of absolute path in INSTALL_INTERFACE
Closes #1470.
2019-05-17 16:12:52 +02:00
Emmanuel Gil Peyrot
599fb3de34 Wayland: Remove wl_shell support
This protocol is part of the core Wayland, but it is pretty badly
designed and is missing quite a few features, and is in the process of
being phased out in compositors.  Its support in GLFW requires
duplicating pretty much every single window management codepath.

This bumps the required compositor versions to the ones which have
implemented xdg-shell, approximately two years ago, which seems sensible
to me.
2019-04-20 10:05:15 +02:00
Camilla Löwy
a337c56848 Start 3.4 2019-04-16 23:08:39 +02:00
Camilla Löwy
ab118b2529 Fix copyright years (somewhat) 2019-04-15 20:50:00 +02:00
Camilla Löwy
1f91697cd3 Win32: Fix VS static analysis warnings 2019-04-15 15:37:15 +02:00
Camilla Löwy
334a485968 Win32: Fix potential buffer overrun
Found with VS static analysis.
2019-04-15 15:35:19 +02:00
Camilla Löwy
0e74265426 Cocoa: Fix cursor hover test 2019-04-15 14:52:17 +02:00
Camilla Löwy
3c3981a4f0 Cocoa: Fix coordinate transformations
Window relative mouse locations provided via NSWindow and NSEvent are
based at 0,1 while screen relative locations use 0,0.  Incorrect
handling of this had crept into other coordinate transformations.  Note
that most of these errors canceled each other out, so the reported
positions of windows, monitors and work areas are unaffected.  This
corrects the cursor position for glfwGetCursorPos and glfwSetCursorPos.

Fixes #1461.
2019-04-15 14:52:17 +02:00
Camilla Löwy
28f118f4de NSGL: Disable swap interval
Swap interval now uses CVDisplayLink.
2019-04-15 14:36:12 +02:00
Camilla Löwy
93962ec168 Win32: Fix VS 2010 build error 2019-04-15 02:46:07 +02:00
Camilla Löwy
3461d1c2a5 Fix missing context APIs in version strings 2019-04-08 20:51:34 +02:00
Camilla Löwy
c585bf010b Fix file flags 2019-04-07 20:44:21 +02:00
Cliff Smolinsky
87458617e0 Win32: Bypass composition check on Windows 8+
DWM composition is always enabled on Windows 8 and later, so there's no
need to call DwmIsCompositionEnabled on those platforms.

Fixes #1452.
Closes #1453.
2019-04-01 18:11:55 +02:00