Commit Graph

4717 Commits

Author SHA1 Message Date
Camilla Löwy
9cce2896ee Null: Add (fictional) scancodes
This replaces the previous scheme where scancodes were equal to keycodes
(an implausible and potentially misleading situation) with a set of
scancodes invented purely for the null platform.
2023-03-31 15:56:01 +02:00
Camilla Löwy
23ab972724 Fix unquoted CMake variable references
The previous version did not handle paths containing whitespace
correctly.

Related to #2256
2023-03-31 15:33:15 +02:00
Camilla Löwy
fbdb53b9ca Wayland: Add initial support for libdecor
This is partly based on the implementation of libdecor support in
PR #1693 by @ christianrauch.

Where available, the libdecor library is loaded at init and becomes the
preferred method for window decorations.  On compositors that support
XDG decorations, libdecor in turn uses those.  If not, libdecor has
a plug-in archtecture and may load additional libraries to either use
compositor-specific decorations or draw its own.

If necessary, support for libdecor can be disabled with the
GLFW_WAYLAND_LIBDECOR init hint.  This is mostly in case some part of
the dynamic loading or duplication of header material added here turns
out to cause problems with future versions of libdecor-0.so.0.

Fixes #1639
Closes #1693
Related to #1725
2023-03-27 22:03:36 +02:00
Camilla Löwy
cd466cf9fd Wayland: Simplify decoration side detection
This commit simplifies the detection of which element of a fallback
decorated window the pointer has entered.  Instead of looping through
the list of windows, the user pointer of fallback decoration surfaces is
set to the GLFW window object.
2023-03-27 22:03:36 +02:00
Camilla Löwy
39f0e86228 Wayland: Clean up enum value names 2023-03-27 22:03:36 +02:00
Camilla Löwy
efa9297a41 Wayland: Simplify per-window ouput scales tracking
This replaces (one case of) manual management of weak links between
windows and monitors, both objects with complex life times, with
wl_object pointers used as opaque key values.
2023-03-27 22:03:36 +02:00
Camilla Löwy
91c837ace5 Wayland: Use tags to verify proxy ownership
This is in preparation for adding support for libdecor, which creates
its own proxies on our display.  It will likely also be helpful to some
people using native access on Wayland.

This is partly based on the implementation of libdecor support in
PR #1693 by @ christianrauch.
2023-03-27 22:03:36 +02:00
Camilla Löwy
6d9083af03 Wayland: Remove duplicate setting of user data
The surface user data is already set by wl_surface_add_listener.
2023-03-27 22:03:36 +02:00
Camilla Löwy
4cf510511c Wayland: Stop manually tracking interface versions
This is already tracked by the proxies we care about.
2023-03-27 22:03:36 +02:00
Camilla Löwy
c1a79c1c41 Wayland: Emit size event when setting aspect ratio 2023-03-27 22:03:36 +02:00
Camilla Löwy
8397b39afa Wayland: Fix some missing window refresh events 2023-03-27 22:03:36 +02:00
Camilla Löwy
735fc101f5 Wayland: Fix decorations not always being created
If a window was initially fullscreen then it would not get an XDG
decoration object.  If the window was later switched to windowed mode it
would then get fallback decorations instead of XDG ones.
2023-03-27 22:03:36 +02:00
Camilla Löwy
228428fa4f Wayland: Simplify test for fallback decorations
The GLFW fallback decorations only exist when the window is visible,
decorated and in windowed mode.
2023-03-27 22:03:36 +02:00
Camilla Löwy
82e77dbff4 Wayland: Pick more plausible default cursor size
This is not intended as a replacement for actually querying the desktop
for the correct size, but it appears to be a better fallback value.
2023-03-27 22:03:36 +02:00
Juan Ramos
9a87635686 Update to actions/checkout@v3
Fixes the following CI warning:

"Node.js 12 actions are deprecated. Please update the following
actions to use Node.js 16: actions/checkout@v2..."

Closes #2255
2023-03-03 14:47:15 +01:00
Camilla Löwy
2b580012da Add credit
Related to #2199
2023-03-03 14:46:43 +01:00
Yoshinori Sano
5c463a9070 Win32: Fix typo in error description
Closes #2199
2023-03-03 14:36:12 +01:00
Camilla Löwy
9b1f63bad9 Add credit
Closes #2256
2023-03-02 17:47:36 +01:00
Juan Ramos
1c9fcdc9df Simplify setting of GLFW_STANDALONE CMake variable
Use string(COMPARE EQUAL ...) instead of a whole if() statement.

Related to #2256
2023-03-02 17:44:18 +01:00
Juan Ramos
30b91c8b60 Remove CMAKE_LEGACY_CYGWIN_WIN32 CMake option
This was needed for compatibility with CMake versions before 2.8.4.

Related to #2256
2023-03-02 17:42:34 +01:00
Juan Ramos
e0ae1c45df Remove setting of CMake policy CMP0054
This policy is already set to NEW by requiring CMake 3.4.

Related to #2256
2023-03-02 17:40:32 +01:00
ws909
14eea06345 Merge branch 'dev-theming' into theming 2023-02-24 00:55:01 +01:00
ws909
73330df28a Fix _glfwSetThemeWin32 2023-02-24 00:27:41 +01:00
ws909
a30e29fa0a Fix compilation issues on X11, WL. 2023-02-24 00:22:58 +01:00
ws909
ac979c6d7f Fix win32 theming implementation 2023-02-24 00:19:12 +01:00
ws909
decb018a31 Update theming API 2023-02-23 22:48:21 +01:00
ws909
8ba39bca81 Add credit 2023-02-23 19:30:12 +01:00
Andreas
85a6eb0625
Merge pull request #2 from floppyhammer/add-win32-theming
Add win32 theming base
2023-02-22 22:57:17 +01:00
ws909
8f0e79e2a0 Merge branch 'dev-theming' into theming
Merge development changes into main theming branch
2023-02-22 15:33:02 +01:00
floppyhammer
14d3920f6a Add a function to get the system accent color 2023-02-22 14:32:18 +08:00
floppyhammer
c6b0894c57 Code format 2023-02-19 22:31:03 +08:00
floppyhammer
adc9f9d676 Free uxtheme properly 2023-02-19 22:30:33 +08:00
floppyhammer
43ea8967a3 Add win32 theming implementation 2023-02-12 10:51:17 +08:00
ws909
9889f26b0f Use C89 var declaration in glfwGetSystemDefaultTheme, init.c 2023-02-04 17:17:05 +01:00
ws909
5805c51eab Add color specifier to GLFWtheme.
Add color specifier parameter to glfwThemeGetColor and glfwThemeSetColor.
Add GLFW_THEME_COLOR_MAIN.
Remove GLFW_THEME_ATTRIBUTE_HAS_COLOR.
2023-02-01 04:44:22 +01:00
Andreas
e32cb2b2cc
Merge pull request #1 from ws909/dev-theming
dev-theming merge
2023-01-30 03:23:34 +01:00
ws909
afae2b0dfa Implement _glfwGetSystemDefaultThemeCocoa.
Fix bug in _glfwGetThemeCocoa always reporting a light theme for system default themes.
2023-01-30 03:09:39 +01:00
ws909
d87fc99503 Change GLFWtheme's public API flags to attributes 2023-01-30 01:12:12 +01:00
ws909
b5758af155 Add limited inline documentation.
Change _GLFWtheme's color components to floats.
2023-01-30 00:02:44 +01:00
ws909
a63905b2f6 Fix clear color in theming test 2023-01-29 22:57:30 +01:00
ws909
bcd5cf6f8e Fix glfwSetTheme conflicting declaration 2023-01-29 21:18:48 +01:00
ws909
3e7ce3ac63 Convert GLFWtheme to an opaque object.
Add creation, copying and destruction functions for theming objects.
Add setters and getters for theme objects.
2023-01-29 21:06:42 +01:00
Andreas
4963e8ba94
Merge branch 'glfw:master' into theming 2023-01-27 19:23:54 +01:00
Camilla Löwy
8f470597d6 Add support for manually running build workflow 2023-01-26 18:41:46 +01:00
ws909
17ab6209df Fix duplicate syntax error in win32_init, wl_init, x11_init 2023-01-26 10:22:40 +01:00
ws909
266f67c6db Add stubs for all platforms 2023-01-26 10:16:55 +01:00
ws909
b5363d87d2 Fix remaining build errors for Cocoa. 2023-01-26 08:50:42 +01:00
ws909
bbd5bcb7fd Attempt at fixing compilation errors for MacOS 2023-01-26 08:31:31 +01:00
ws909
fe1eddc2ad Conditionally execute theming based on OS version 2023-01-26 06:38:27 +01:00
ws909
2db9a368f7 Add credit 2023-01-26 04:07:43 +01:00