Commit Graph

461 Commits

Author SHA1 Message Date
Simon Ser 41b7acbab7 backend: return wlr_session in wlr_backend_autocreate() call
Up until now, wlr_backend_autocreate() created the wlr_session and
then stuffed it into struct wlr_multi_backend so that compositors
can grab it later.

This is an abuse of wlr_multi_backend and the wlr_backend API:
wlr_backend_get_session() and wlr_multi_backend.session only exist
to accomodate the needs of wlr_backend_autocreate(). What's more,
the DRM and libinput backends don't implement
wlr_backend_impl.get_session.

Instead, return the struct wlr_session to the compositor in the
wlr_backend_autocreate() call. wlr_backend_get_session() will be
removed in the next commit.
2022-11-15 21:16:25 +00:00
Isaac Freund 91943a68a6 wlr_input_device: remove anon union field
This union is unnecessary since the recent input device refactor and can
now be replaced by wlr_*_from_input_device() functions.
2022-06-21 18:42:07 +00:00
Simon Ser c2952411d3 examples/screencopy-dmabuf: stop using strncpy
strncpy doesn't guarantee that the result is zero-terminated.
2022-06-04 23:03:39 +02:00
Simon Ser 366e8e3b91 examples/text-input: stop using strcpy/strcat
These functions are too easy to misuse, they don't do bounds
checking.
2022-06-04 23:02:42 +02:00
Alexander Orzechowski ccd0f85c2a wlr_scene: Only allow parenting on a wlr_scene_tree 2022-05-31 09:14:28 +00:00
Alexander Orzechowski 9eb71146ae wlr_scene: Refactor wlr_scene (the root element) to encase a wlr_scene_tree
Co-authored-by: Isaac Freund <mail@isaacfreund.com>
2022-05-31 09:14:28 +00:00
Simon Ser bb2946f737 build: make GBM optional
Now that the DRM backend no longer depends on GBM, we can make it
optional. The GLES2 renderer still depends on it because of our EGL
device selection.

This is useful for compositors with their own renderers, and for
compositors using the Vulkan renderer.
2022-05-30 13:30:08 +00:00
Alexander Orzechowski dc9bc5683a wlr_scene: Refactor wlr_scene_surface to be a helper on top of wlr_scene_buffer 2022-05-19 14:26:50 -04:00
Simon Ser 8fe3aa29da xdg-shell: specify version in wlr_xdg_shell_create
With protocol additions such as [1], compositors currently have no
way to opt out of the version upgrade. The protocol upgrade will
always be backwards-compatible but may require new compositor
features.

The status quo doesn't make it possible to ship a protocol addition
without breaking the wlroots API. This will be an issue for API
stabilization [2].

To address this, let compositors provide a maximum version in the
function creating the global. We need to support all previous versions
of the interface anyways because of older clients.

This mechanism works the same way as Wayland clients passing a version
in wl_global.bind.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3514
[2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1008

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3397
2022-05-15 15:44:40 +00:00
Kirill Primak 0326ceff90 examples/layer-shell: premultiply alpha 2022-05-09 10:08:44 +00:00
Johannes 12d84f8c36 examples/egl_common: switch rgba format
The current ARGB2101010 has really "corase" control over the alpha.
Particularily, examples/layer-shell would look really strange with certain
parameters. For examples, when passing an alpha of 0.84, the box would not
appear transparent at all anymore.

Patched as suggested by @mstoeckl -- thank you!
2022-05-09 09:38:32 +00:00
Simon Zeni aaf787ee56 types/wlr_touch: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni e732c5c895 types/wlr_tablet_tool: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni d1f543a9d8 types/wlr_tablet_pad: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni 9a17200446 types/wlr_keyboard: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni bd6c000d14 types/wlr_pointer: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni 96ccc50c57 types/wlr_input_device: move width_mm and height_mm fields to wlr_tablet and wlr_touch 2022-03-17 13:44:19 -04:00
Guido Günther 0a5a65cf48 examples/input-method: Don't crash on NULL surrounding text
E.g. With e.g. gnome-terminal we never end up in handle_surrouding
so it will be NULL.
2022-03-02 14:28:58 +00:00
Keith Bowes 35b3d67e5f Fixed compiling with FFmpeg 5.0 2022-02-21 15:51:17 +01:00
Alexander Orzechowski c22ea3eb99 scene_graph: Simplify computation for offset of new surfaces.
This became possible after the usage of wlr_surface_send_frame_done.
2022-01-19 04:46:30 -05:00
Alexander Orzechowski 1bc6f7f243 scene_graph: remove unused outputs list 2022-01-19 04:42:01 -05:00
Alexander Orzechowski 8656c77248 scene_graph: use wlr_scene_output_send_frame_done 2022-01-19 04:38:19 -05:00
Kirill Primak 617eb4fb93 surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
Simon Ser 1fbd13ec79 examples: remove unnecessary partial_dependency() call
The definition of the "drm" dep already calls it.
2021-12-07 16:20:54 +01:00
Simon Ser 90e9d327dd examples: remove unnecessary wlroots deps for clients
These clients don't need wlroots.
2021-12-07 16:20:20 +01:00
Simon Ser 83bdb3ad07 examples/layer-shell: remove wlroots dependency
This is a client example, it shouldn't use a compositor library
like wlroots.
2021-12-07 16:19:26 +01:00
Simon Ser ad28490cf4 build: move wayland-client dep to backend/wayland/
wayland-client isn't really used by wlroots core, so let's move the
dep to where it's needed in the Wayland backend.
2021-12-07 16:11:29 +01:00
Simon Zeni 6d6e70b9e0 examples: init wlr_output with allocator and renderer 2021-11-18 09:37:57 -05:00
fwsmit dc22a06184 examples/foreign-toplevel: fix toplevel not being freed 2021-10-07 20:36:21 +02:00
Simon Ser e05c884891 examples/scene-graph: use wlr_scene_output
This allows us to get damage tracking for free™.
2021-09-08 09:50:08 -04:00
Devin J. Pohly e2e68ff680 examples/scene-graph: demonstrate scene_rect node type
Add RECT nodes to the scene-graph demo to illustrate how they are used.
Here, we add a solid rectangle behind each surface as a quick-and-dirty
border, handling surface.commit in order to size it appropriately.
2021-09-02 19:05:02 +02:00
Simon Ser c41bd320be examples/scene-graph: new example 2021-08-26 21:12:28 +02:00
Simon Ser ca0b19fc9c examples/fullscreen-shell: remove unused render_data.view field 2021-08-06 18:27:31 +02:00
Simon Zeni e192d87731 move wlr_box from /types to /util 2021-07-06 21:43:17 +02:00
Simon Ser dbb0e2f75b Remove unused wlr_list.h includes 2021-07-01 10:35:39 -04:00
Simon Ser 8810e95082 Revert "build: workaround for meson disabler object not working with if not"
This reverts commit 9796abcced.

This Meson issue has been fixed upstream for a while. We require
0.56.0 so we should never hit an unpatched Meson.
2021-06-22 21:20:20 +02:00
Brian McKenna 2fd20b17b6 Flush events in virtual pointer example 2021-05-22 13:36:30 +02:00
Simon Zeni 78b94a570c examples/rotation: remove unused includes 2021-04-20 08:46:59 +02:00
Simon Zeni 217c4f79a0 examples: introduce quads example
This examples uses `wlr_render_quad_with_matrix` to render coloured
squares on the screen, and uses the rotation to make them spin on their
middle.
2021-04-20 08:46:59 +02:00
Simon Ser fbc2182b9f Stop specifying xkb_rule_names
If a NULL xkb_rule_names pointer is passed to
xkb_keymap_new_from_names, libxkbcommon will default to reading
the XKB_* env variables. So there's no need to do it ourselves.

Also s/xkb_map_new_from_names/xkb_keymap_new_from_names/ since the
latter is more consistent with the returned struct name.

[1]: https://xkbcommon.org/doc/current/structxkb__rule__names.html
2021-04-19 17:33:28 +02:00
Simon Ser 83670fce65 examples: remove dependency on GLES2 for compositor examples
Most of the examples had a GLES2 dependency, but weren't using it.
Convert multi-pointer to wlr_renderer instead of using directly
glClear.
2021-04-19 17:32:07 +02:00
Simon Ser fd7e565ce3 examples: use wlr_output_preferred_mode 2021-04-19 17:25:41 +02:00
ayaka ed1924800d render: make GLES2 renderer optional
Allow selecting whether the GLES2 renderer gets enabled.

Co-authored-by: Simon Ser <contact@emersion.fr>
2021-04-17 16:39:40 +02:00
Simon Ser 3c6826df71 examples/rotation: error out on invalid option 2021-04-16 08:58:29 +02:00
Simon Ser 6230f7be4f examples/dmabuf-capture: stop using av_init_packet
It's deprecated in ffmpeg >= 4.4.

Closes: https://github.com/swaywm/wlroots/issues/2798
2021-03-22 17:15:06 +01:00
Simon Ser c5202b728a examples: add libdrm partial dependency for compositors
Fixes: 675bc39658 ("Fix wl_shm_format passed to wlr_texture_from_pixels")
2021-02-23 20:29:58 +01:00
Simon Ser 675bc39658 Fix wl_shm_format passed to wlr_texture_from_pixels
Fixes: 27fba3df43 ("render: use DRM formats in wlr_texture_from_pixels")
2021-02-23 17:36:32 +01:00
Simon Ser 4a9e70ccde examples: remove wlroots dep from client examples
There is one exception: layer-shell still uses wlr_log. Would need to
convert to fprintf to drop the wlroots dep there.

Fixes: 34e7f69d69 ("examples: remove dependency on wlr_egl from clients")
2021-02-14 16:49:54 +01:00
Simon Ser b60c5fa450 examples: drop wlr/render/egl.h include from client examples
We use egl_common.h instead.

Fixes: 34e7f69d69 ("examples: remove dependency on wlr_egl from clients")
2021-02-14 16:49:54 +01:00
Simon Ser 12cc465144 examples: drop wlroots dep from egl_common.c
Just use fprintf instead of wlr_log.
2021-02-14 16:49:54 +01:00