Commit Graph

102 Commits

Author SHA1 Message Date
Camilla Löwy
85348c67cd Wayland: Load functions for new atomic marshalling
The wayland-scanner program recently changed how it generates
marshalling, requiring a couple of new core functions.

Fixes #1949.
2021-08-19 18:55:35 +02:00
Camilla Löwy
dffe203c17 Wayland: Make libwayland-client dynamically loaded
The insight to use wayland.xml to resolve the difficult-to-redirect
interface symbols was gleaned from SDL.

Instead of compiling the code output of wayland-scanner separately it is
made part of the wl_init compilation unit.  This lets us do things like
transparently rename our copies of Wayland globals.

The OS version of wayland-client-protocol.h is no longer used by GLFW,
but it is presumably ABI compatible with the output of wayland-scanner.

Closes #1174.
Closes #1338.
Related to #1655.
Closes #1943.
2021-08-15 21:58:19 +02:00
Camilla Löwy
111c02d74e POSIX: Remove use of deprecated gettimeofday
POSIX.1-2008 deprecated gettimeofday, which we used as a fallback if the
monotonic clock was unavailable.

This replaces that fallback with the non-monotonic real-time clock.

Because of the Gordian knot of feature test macros across Unices, this
also includes the shift from some platform source files defining
_POSIX_C_SOURCE to various values to _DEFAULT_SOURCE being defined for
all source files on Linux.  This is because -std=c99 on Linux disables
_DEFAULT_SOURCE (POSIX 2008 and extensions).

Once runtime platform selection comes in, this kind of platform-specific
preprocessor logic can be moved into the platform glue files and won't
need to be replicated by third-party build setups, but for now, sorry.
2021-08-13 17:18:56 +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
Nicolas Caramelli
1adfbde4d7 Wayland: Move 96 DPI default to outputHandleMode
Closes #1792.
2020-12-09 19:11:40 +01:00
Nicolas Caramelli
0ef149c8f2 Wayland: Assume 96 DPI if physical size is <= 0 2020-10-14 12:04:28 +02:00
Camilla Löwy
782e6b6cef Make joystick platform code init on demand
This makes joystick support initialize the first time a joystick
function is called, including those gamepad functions that are layered
on top of joystick functions.

Related to #1284.
Related to #1646.
2020-07-21 17:38:56 +02:00
Camilla Löwy
f760b124ca Wayland: Fix scroll offsets being inverted
Scrolling offsets were inverted compared to X11 and Win32.

Fixes #1463.
2020-07-15 23:16:01 +02:00
Camilla Löwy
081484ed34 Fix POSIX conformance issues for clock_gettime
CLOCK_MONOTONIC should not be used as a feature macro.  The POSIX
feature macros are provided by unistd.h.  CLOCK_MONOTONIC is provided by
time.h.  CLOCK_MONOTONIC requires _POSIX_C_SOURCE >= 199309L on some
systems.
2019-12-15 18:15:40 +01:00
Emmanuel Gil Peyrot
ef6189f348 Wayland: Unset the cursor name on border exit
It would previously conserve the last name it had before leaving the
border, sometimes desynchronising with what it should have been.
2019-12-08 21:58:11 +01:00
Emmanuel Gil Peyrot
a80788c17f Wayland: Don’t update cursor position in the frame
That way the application only sees the cursor moving when it is inside
of its area, it won’t go back to the top or left side when trying to
resize the window or just hovering the fallback decorations.
2019-11-21 13:53:08 +01:00
Emmanuel Gil Peyrot
a9f674e719 Wayland: Don’t reload the cursor on every pointer motion
Previously, any pointer motion in the window decorations when using the
fallback implementation would obtain the wl_cursor again, and do the
attach danse for no benefit.

This will ultimately allow animated cursors to not reset to the first
frame on motion, once these will be implemented.
2019-11-21 13:52:37 +01: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
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
3461d1c2a5 Fix missing context APIs in version strings 2019-04-08 20:51:34 +02:00
Emmanuel Gil Peyrot
5f9cbd0ebc Wayland: keyboard repeat rate is given in Hz
It was currently interpreted as ms, which is obviously wrong.

Thanks to https://github.com/Smithay/client-toolkit/pull/62 for making
me notice this issue.
2019-02-20 15:56:04 +01:00
Emmanuel Gil Peyrot
c08abffc50 Wayland: Implement clipboard copy 2018-10-24 14:03:08 +02:00
Emmanuel Gil Peyrot
8b54e28c4e Wayland: Implement clipboard paste 2018-10-24 14:03:08 +02:00
Emmanuel Gil Peyrot
3c4b9a7eef Wayland: Add boilerplate for clipboard handling 2018-10-24 14:03:08 +02:00
Ricardo Vieira
92b3fd02e5 wayland: save serial from all input sources 2018-10-24 14:03:08 +02:00
emersion
5afcd0981b wayland: add support for XCURSOR_THEME and XCURSOR_SIZE
These can be set by the compositor or the user to configure the
xcursor theme and size.
2018-10-11 00:58:23 +02:00
Emmanuel Gil Peyrot
dcd2a19d90 Wayland: Add support for xdg-decoration
This allows compositors which prefer to draw the decorations around
clients to do so, rather than letting GLFW draw its own decorations.
The appearance is thus entirely subject to the compositor used, but
should generally be better than the current solid colour decorations we
have, which we continue to use when the compositor doesn’t support this
protocol or tells us to draw the decorations ourselves.

This new protocol has been tested against wlroots’s rootston compositor.

Fixes #1257.
2018-10-01 16:37:24 +02:00
Emmanuel Gil Peyrot
4d3f0fb5df Wayland: Split long lines for function declaration 2018-09-29 18:11:13 +02:00
Emmanuel Gil Peyrot
e0b83bbe8d Wayland: Use HiDPI cursors on decorations 2018-09-11 14:28:44 +02:00
Emmanuel Gil Peyrot
321062833a Wayland: Load a bigger cursor theme for HiDPI 2018-09-11 14:28:44 +02:00
Emmanuel Gil Peyrot
5ea6e6cda2 Wayland: Add support for animated standard cursors 2018-09-09 13:12:20 +02:00
Emmanuel Gil Peyrot
dede6d6886 Wayland: Add a timerfd for animated cursors 2018-09-09 13:12:20 +02:00
Emmanuel Gil Peyrot
685f2a5f91 Wayland: Close forgotten timerfd on terminate. 2018-09-09 13:12:20 +02:00
Greg V
0a3c4f5d80 Add support for Wayland on FreeBSD and other OSes 2018-03-27 22:03:37 +02:00
Emmanuel Gil Peyrot
0d4534733b Wayland: Destroy subcompositor and viewporter on terminate 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot
a8e551cffa Fix resizing and moving under xdg-shell 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot
9f7ec6b094 Implement window decorations 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot
9dc18a62a6 Rename wl_pointer to pointer 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot
5b65b9b860 Prevent a crash when giving focus to a non-GLFWwindow surface 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot
552e40a4be Add wl_subcompositor support 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot
79e16baca3 Add wp_viewporter support 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot
d6b9d00ceb Wayland: Handle monitor removal 2018-02-24 22:18:39 +01:00
Emmanuel Gil Peyrot
608f055c72 Wayland: Open the timerfd with cloexec 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot
84d10b32c3 Wayland: Ask xkbcommon whether to repeat a key 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot
8bc0c5c2c0 Wayland: dlsym() xkb_keymap_key_repeats 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot
97bf16e5b6 Wayland: Check for wayland protocol version
wl_keyboard version 4 is more recent than the libwayland available in
Ubuntu 14.04.
2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot
90f5edc0b8 Wayland: Use a timerfd for key repeat 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot
c14a35e21e Wayland: Obtain keyboard repeat_info
This had to bump the seat version, we now may get the seat name but we
don’t do anything with it.
2018-02-24 21:06:25 +01:00
Camilla Löwy
53b193a161 Wayland: Fix uninitialized variable warning
Related to #1143.
Fixes #1197.
2018-02-06 13:10:41 +01:00
Emmanuel Gil Peyrot
525ad7bfb8 Close the libwayland-cursor handle after destroying the cursor theme
Fixes a segfault on glfwTerminate().
2018-01-29 04:55:55 +01:00
Emmanuel Gil Peyrot
14856e8b60 Wayland: Bind, listen and destroy xdg_wm_base 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot
440e7e36f3 Fix typography of error messages 2018-01-29 02:34:10 +01:00
Emmanuel Gil Peyrot
407a3e2860 Load libwayland-cursor at runtime 2018-01-29 02:34:10 +01:00
Emmanuel Gil Peyrot
5fbf4ddde8 Load libwayland-egl at runtime 2018-01-29 02:34:10 +01:00