1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00
Commit Graph

121 Commits

Author SHA1 Message Date
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 3e884aea46 Wayland: Use memfd_create() and seals if available
This allows the compositor to avoid having to setup and teardown a
SIGBUS signal handler whenever it needs to read from this surface, as it
knows we won’t be able to shrink the file and so doesn’t have to protect
against that.

This codepath will only be used on Linux ≥ 3.17 with glibc ≥ 2.27, and
possibly other kernels and libc.  The former code will continue to be
used as a fallback, either if memfd_create() fails or if it isn’t
available.
2018-10-01 13:13:19 +02:00
Emmanuel Gil Peyrot ab16fcc8db Wayland: Check for buffer creation failure
This prevents unusable decoration objects from being created, and
invalid cursors from being returned to the user.
2018-09-29 22:59:02 +02:00
Emmanuel Gil Peyrot 754b7feaa1 Wayland: Rename handlers for more unicity 2018-09-29 21:01:03 +02:00
Emmanuel Gil Peyrot 4d3f0fb5df Wayland: Split long lines for function declaration 2018-09-29 18:11:13 +02:00
Emmanuel Gil Peyrot 15cad02235 Wayland: Use HiDPI cursors for standard cursors 2018-09-11 14:28:44 +02:00
Emmanuel Gil Peyrot e0b83bbe8d Wayland: Use HiDPI cursors on decorations 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 2926ce4838 Prevent resizing smaller than 1×1 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot a0dbffb8f2 Set decorations as opaque, to optimise composition 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot dfc7eacd50 Do not leak the 1×1 buffer used for decorations 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 0c4ca85149 Fix _glfwPlatformSetWindowMonitor to correctly destroy/recreate decorations 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot c9d691e65e Fix window size calculation when wp_viewporter isn’t supported 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 60e82ba472 Handle scaling factor (hidpi) correctly 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot f51c219b1c Handle maximized size correctly 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 31cea7fa24 Remove decorations when fullscreen 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 58b21d336c Factorise moving to fullscreen 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 8ed91e8a77 Only create decorations if wp_viewporter is supported 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 4e31dc5e6e Make it possible to toggle window decorations 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 1f8ec20b55 Correctly destroy subsurfaces on window destroy 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 4a42364a19 Return correct values for frame size 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 9a7656364e Split shm buffer creation out of _glfwPlatformCreateCursor 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 2de3605b4c Make createAnonymousFile static 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot f67b610dd4 Wayland: Handle repeats which missed a timer 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 f5d3954568 Stop checking for resizing
Fixes #1197
2018-02-06 12:57:17 +01:00
Emmanuel Gil Peyrot eb7c9994bf Prevent auto-iconify from firing on window creation 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot f2617a671f Add a roundtrip after creating the xdg-surface
The specification says we must not attach a buffer until we’ve received
a configure event.
2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 4778d02c67 Ignore _glfwPlatformShowWindow when already visible 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot f710db6504 Ignore configure events of 0×0px 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 0e759c9422 Don’t set min/max size on GLFW_DONT_CARE 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot ae44a28125 Wayland: Add an alternate surface role using xdg-shell
This protocol matches desktops much better than the deprecated
wl_shell, fixing a bunch of race conditions, removing undefined
behaviour, adding missing features, and generally providing a much more
user-friendly experience.

Since most compositors don’t support it yet, the wl_shell_surface role
is kept as fallback for now.
2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot a199efae44 Wayland: Emit an error when wl_shell is absent or unusable 2018-01-29 03:59:47 +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
Camilla Löwy 973bf29622 Remove use of non-standard function strdup
Related to #873.
2018-01-17 11:56:35 +01:00
Emmanuel Gil Peyrot 6c421f131d Wayland: Implement scale callback
Closes #1181.
2018-01-09 22:39:35 +01:00
Camilla Löwy ee9dffcd66 Add GLFW_HOVERED for polling cursor hover state
This window attribute corresponds to the cursor enter/leave callback.

Fixes #1166.
2018-01-09 18:02:52 +01:00
Emmanuel Gil Peyrot 65166858ff Wayland: Add support for the idle-inhibit protocol
Closes #955.
2017-11-20 22:27:37 +01:00
Camilla Löwy 11e47f08b1 Add glfwGetWindowOpacity and glfwSetWindowOpacity
This adds support for setting the opacity of the whole window, including
any decorations.

Fixes #1089.
2017-11-15 15:46:01 +01:00
Camilla Löwy 31cbb20ba2 Deprecate window parameter of clipboard functions 2017-11-10 02:52:16 +01:00
Camilla Löwy bf09dba95b Cleanup 2017-10-26 18:05:56 +02:00
Camilla Löwy 16bf872117 Add content scale queries
This adds glfwGetWindowContentScale and glfwGetMonitorContentScale for
querying the recommended drawing scale factor for DPI-aware rendering.

Parts of this patch are based on code by @ferreiradaselva.

Fixes #235.
Fixes #439.
Fixes #677.
Fixes #845.
Fixes #898.
2017-10-26 17:26:36 +02:00
Emmanuel Gil Peyrot 95e282d5a0 Wayland: Add transparency support
Closes #788.
2017-10-01 01:39:27 +01:00
Camilla Löwy 32e78aeb2e Add GLFW_TRANSPARENT attribute and documentation
This completes support for window framebuffer transparency on Windows,
macOS and X11.  Note that the hint/attribute may be renamed before
release to clarify its relationship to GLFW_OPACITY.

Fixes #197.
Closes #1079.
Related to #663.
Related to #715.
Related to #723.
Related to #1078.
2017-09-27 21:54:04 +02:00
Camilla Löwy e3be6b8ae0 Cleanup
Break up some overly long lines.
2017-09-17 15:14:22 +02:00
Camilla Löwy 82284b86eb Cleanup
Thanks to glfwGetKeyScancode we can now pass only a scancode to the
platform layer for glfwGetKeyName.
2017-07-13 01:26:06 +02:00
Camilla Löwy baa9cd8968 Cleanup
Closes #988.
2017-05-11 20:10:04 +02:00