Commit Graph

7244 Commits

Author SHA1 Message Date
Kirill Primak
6261bd9684 .mailmap: add myself 2024-08-05 19:32:24 +03:00
Philipp Kaeser
d400b4587a wlr_scene: Add 'struct' to comment in wlr_scene_create() to permit auto-linkify. 2024-08-04 11:57:27 +02:00
Philipp Kaeser
42df9414fb wlr_scene: Add documentation to wlr_scene_create about how to destroy the allocated resources. 2024-08-04 09:49:58 +00:00
Kirill Primak
7e13dfdd4d xwayland: remove stray empty line 2024-08-02 17:52:19 +03:00
Consolatis
ceb4fcedca xwm: expose individual axis for _set_maximized()
This allows compositors to support both axis individually.
To keep existing behavior, compositors can supply the same
maximized state for both axis.
2024-08-02 14:46:37 +00:00
John Lindgren
f9199bb6d4 xwayland: set focus to XCB_POINTER_ROOT rather than XCB_NONE
Fixes an issue with keyboard grabs not working when no XWayland windows
are focused.
2024-08-01 13:19:24 +00:00
John Lindgren
5083efe18b xwayland: add wlr_xwayland_surface_offer_focus()
In labwc, we have had trouble with XWayland windows using the Globally
Active input model (see wlr_xwayland_icccm_input_model()). Under
traditional X11, these windows do not expect to be given focus directly
by the window manager; rather, the WM sends them a WM_TAKE_FOCUS message
prompting the client to take focus voluntarily.

Currently, these clients are difficult to support with wlroots, because
wlr_xwayland_surface_activate() assumes the client window will always
accept the keyboard focus after being sent WM_TAKE_FOCUS. Some Globally
Active client windows (e.g. panels/toolbars) don't want to be focused.
It's useless at best to focus them, and might even make them misbehave.
Others do need keyboard focus to be functional -- and there doesn't seem
to be any reliable way to know this in advance.

Adding wlr_xwayland_surface_offer_focus() allows the compositor to send
WM_TAKE_FOCUS to a client window supporting it and then see whether the
client accepts or ignores the offer. If it accepts, the surface will emit
the focus_in signal notifying the compositor that it has received focus.

This is entirely opt-in. A compositor that doesn't want to use the new
function can continue to call wlr_xwayland_surface_activate() directly
just as before.
2024-08-01 13:19:24 +00:00
John Lindgren
eb5312022a xwayland: add focus_in and grab_focus events
Allows the compositor to know when the XWayland focus changes.
2024-08-01 13:19:24 +00:00
John Lindgren
aa1163e640 xwayland: factor out xwm_set_focused_window()
Currently _NET_WM_STATE is updated in xwm_focus_window() but
_NET_ACTIVE_WINDOW is updated in xwm_surface_activate(). In some cases
(for example, client-initiated focus changes) the two properties can get
out of sync.

Factor out a new function which updates both properties in sync.

Adjust the logic in xwm_handle_focus_in() to call either
xwm_focus_window() or xwm_set_focused_window(), or neither, as
appropriate.
2024-08-01 13:19:24 +00:00
Kirill Primak
de574ac098 output-power-management: send zwlr_output_power_v1.failed on output destroy
From the event description:

This event indicates that the output power management mode control is no
longer valid. This can happen for a number of reasons, including:
<...>
- The output disappeared
2024-08-01 15:24:20 +03:00
BiRD
42673a2821 tinywl: Update .gitignore 2024-07-29 11:39:34 -04:00
BiRD
cd2cf1bafb ci: Remove package 'gmake' 2024-07-29 11:39:34 -04:00
BiRD
f16a3c1180 tinywl: Edit Makefile for bmake compatibility
- Replace 'shell' calls with '!=' assignments
- Add default target 'all'
- Don't use var '$<' for non-sources
2024-07-29 11:39:34 -04:00
chenyongxing
015bb8512e render/vulkan: Fix draw rect clip region invalid in blend none mod 2024-07-16 14:24:46 +08:00
Isaac Freund
7550e483ae docs: update comments for wlr_output API changes
The old wlr_output_{commit,test}() functions are still mentioned in
multiple places.
2024-07-15 12:30:06 +00:00
Isaac Freund
2a8a23c467 wlr_output: remove dead function 2024-07-15 12:30:06 +00:00
Simon Ser
179ed7c296 build: use fs.relative_to() instead of hand-rolled logic
Meson has introduced a relative_to() function [1] in its fs module
since version 1.3.

[1]: https://mesonbuild.com/Fs-module.html#relative_to
2024-07-14 21:42:26 +00:00
Bill Li
22adc65586 ci: use package x11-servers/xwayland instead of x11-servers/xwayland-devel 2024-07-15 05:24:31 +08:00
Kirill Primak
e17916d413 Rename wlr_surface_get_extends() to wlr_surface_get_extents()
Extend (verb): cause to cover a wider area; make larger.
2024-07-13 19:56:58 +00:00
Isaac Freund
d3b7e040af wlr_xwayland_surface: fix prefix of two functions
Since we're breaking this API anyways, replace the ambiguous "or" in the
function name with the explicit "override redirect" to avoid confusion.
2024-07-13 19:56:58 +00:00
Isaac Freund
5ecbd23c1d wlr_surface: fix argument order consistency
This swaps the argument order of wlr_surface_accepts_touch() and
wlr_surface_accepts_tablet_v2(), putting the wlr_surface argument first
as should be the case for functions namespaced with wlr_surface_*.
2024-07-13 19:56:58 +00:00
Simon Ser
b10516e1e8 build: bump version to 0.19.0-dev 2024-07-12 23:48:02 +02:00
Simon Ser
4666996b2a build: bump version to 0.18.0 2024-07-12 23:39:50 +02:00
Simon Ser
e34cc23549 scene: only skip bottom-most black rects with fractional scaling
We were relying on the fact that we wouldn't paint anything on top
of the black background in the region of a black rect. However
when fractional scaling is used the repaint region might get
expanded to nearby pixels by scale_output_damage(). As a result
the neighbour scene nodes might leak into the skipped black rect's
region.

Avoid this by using this optimization for bottom-most black rects
only when fractional scaling is used.

References: https://github.com/swaywm/sway/issues/8233
2024-07-11 21:03:27 +02:00
Simon Ser
f057239b6a ci: use tinywl built by Meson
This removes the need for repeating and keeping in sync build
options for Meson and make invocations.
2024-07-11 02:54:26 +00:00
Simon Ser
a35b4f059d backend/drm: add support for SIZE_HINTS property
This property allows the driver to advertise support for multiple
cursor sizes. On Intel, using a smaller buffer size reduces power
consumption.

References: https://lore.kernel.org/dri-devel/20240227193523.5601-2-ville.syrjala@linux.intel.com/
2024-07-10 22:42:44 +00:00
Simon Ser
6f63f55ace build: use auto_features=disabled for libdrm subproject
Instead of individually disabling each driver, use
auto_features=disabled to disable all feature options by default.
2024-07-10 17:47:12 +00:00
Simon Ser
59138460c4 render: init wl_shm version 2 2024-07-07 18:52:24 +02:00
Simon Ser
0028e0638f backend/wayland: use wl_shm.release if available 2024-07-07 18:16:48 +02:00
Simon Ser
22dab77d28 shm: add support for wl_shm version 2
References: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/335
2024-07-07 18:16:45 +02:00
Kirill Primak
9646742502 meson: bump wayland dep version to 1.23
libwayland 1.23 includes a wl_event_loop destroy signal fix which our
backends depend on to shut down correctly.
2024-07-05 17:29:05 +03:00
Simon Ser
0a79bc28c7 build: require libinput v1.19
This version has been published back in 2021.
2024-07-04 22:51:07 +02:00
Alexander Orzechowski
ee24201e26 wlr_scene: Don't disable scene nodes at creation time 2024-07-04 14:35:52 -04:00
Alexander Orzechowski
a9375d6bac wlr_scene: Drop map/unmap listeners from layer_shell_v1
Redundant.
2024-07-04 14:10:33 -04:00
Alexander Orzechowski
48b9b7d406 wlr_scene: Drop map/unmap listeners from drag_icon
Redundant.
2024-07-04 14:09:47 -04:00
Alexander Orzechowski
24a9f88873 wlr_scene: Drop map/unmap listeners from xdg_shell
subsurface_tree will handle it. This was redundant.
2024-07-04 14:08:24 -04:00
Kirill Primak
67b88e46b0 Fix __VA_OPT__ macro invocations 2024-06-30 09:01:15 +03:00
Alexander Orzechowski
65e6579c56 wlr_scene: send preferred buffer transform 2024-06-28 13:44:35 -04:00
Simon Ser
85875c47d9 build: build with C23 if supported
This lets us conditionally leverage C23 features.

Force one build to C11 in CI to make sure we stay C11-compatible.
2024-06-27 18:13:05 +00:00
Simon Ser
3880ee15d7 Use standard __VA_OPT__ instead of GNU's ##__VA_ARGS__
C23 has standardized a way to write variadic macros that accept
zero arguments:
https://open-std.org/JTC1/SC22/WG14/www/docs/n3033.htm

Use that instead of the GNU extension when available.
2024-06-27 18:13:05 +00:00
Simon Ser
315e022f2f backend/drm: fix swapped calloc() arguments in get_or_create_layer()
../backend/drm/drm.c:415:49: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
      415 |         layer->candidate_planes = calloc(sizeof(bool), drm->num_planes);
          |                                                 ^~~~
2024-06-27 18:13:05 +00:00
Simon Ser
29cb151987 backend/drm: fix return value type in create_drm_connector()
../backend/drm/drm.c:1435:24: error: incompatible types when returning type ‘_Bool’ but ‘struct wlr_drm_connector *’ was expected
     1435 |                 return false;
          |                        ^~~~~
2024-06-27 18:13:05 +00:00
Simon Ser
a75c6cca54 render/color: fix return value type
../render/color_lcms2.c: In function ‘wlr_color_transform_init_linear_to_icc’:
    ../render/color_lcms2.c:26:24: error: incompatible types when returning type ‘_Bool’ but ‘struct wlr_color_transform *’ was expected
       26 |                 return false;
          |                        ^~~~~
2024-06-27 18:13:05 +00:00
Simon Ser
fe429b2463 Switch to stable tablet-v2 protocol
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/284
2024-06-27 18:04:00 +00:00
Simon Ser
099350a414 build: check eglext.h header version
We use EGL_EXT_device_drm_render_node, which has been introduced
here:
53f038f6fd
2024-06-27 17:54:57 +00:00
Kenny Levinsen
bf67eb342b render/vulkan: vkMapMemory stage spans up front
We always need these mapped for CPU access, so map it up front instead
of duplicating lazy mapping at each site of use.
2024-06-26 21:10:46 +00:00
Kenny Levinsen
bf0246e50c render/vulkan: Fix 3dlut stage span map offset
The mapping is shared between all users of the stage span, so it should
always map the whole thing and apply the allocation offset to the mapped
pointer.
2024-06-26 21:10:46 +00:00
Kenny Levinsen
6da71b6a89 render/vulkan: Unref color transform on pass submit
We increment the ref counter of the color transform at the start of the
render pass. Decrement it at the end to not leak the color transform.
2024-06-26 22:43:15 +02:00
Kirill Primak
f320df65e6 backend/wayland: introduce wlr_wl_output_set_app_id() 2024-06-26 19:43:20 +00:00
Kenny Levinsen
bc82835756 render/vulkan: Use new span map handling for 3dlut
The use of stage spans for 3dluts was missed when the new cached
mappings were introduced, meaning that it would try to map and unmap
memory that might already have a cached mapping.

Vulkan does not support mapping memory multiple times, so make sure the
3dlut code also uses the cached mapping to avoid segfaults after unmap.
2024-06-26 13:14:07 +02:00