Commit graph

43 commits

Author SHA1 Message Date
Simon Ser
3668c9d86c examples, tinywl: use "default" cursor instead of "left_ptr"
"left_ptr" is the X11 name, "default" is the cursor spec name.
2023-02-01 15:00:42 +01:00
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 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
6d6e70b9e0 examples: init wlr_output with allocator and renderer 2021-11-18 09:37:57 -05:00
Simon Ser
dbb0e2f75b Remove unused wlr_list.h includes 2021-07-01 10:35:39 -04: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
Simon Ser
4b03bdc3ab Remove wlr_create_renderer_func_t
This callback allowed compositors to customize the EGL config used by
the renderer. However with renderer v6 EGL configs aren't used anymore.
Instead, buffers are allocated via GBM and GL FBOs are rendered to. So
customizing the EGL config is a no-op.
2020-12-30 17:09:40 +01:00
Isaac Freund
e06c9e43af Remove unneeded includes from wlr_input_device.h
This uncovered many places where we were using things without directly
including them.
2020-11-11 15:40:47 +01:00
Rouven Czerwinski
c32d89ee3e
examples: remove unnecessary gles2.h imports 2020-07-28 13:36:09 +02:00
Scott Anderson
2fea2fced8 examples: Fix compositor-examples
Due to the way the wlr_output API was changed, these examples would
never get a frame event to start the rendering loop. We now commit the
outputs to start it.
2020-02-08 11:38:44 +01:00
Simon Ser
16e5e9541b Add -Wmissing-prototypes
This requires functions without a prototype definition to be static.
This allows to detect dead code, export less symbols and put shared
functions in headers.
2019-11-20 02:05:03 +00:00
Simon Ser
ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
Simon Ser
23e37e7b1d output: refactor frame submission API
This is necessary for direct scan-out and other upcoming features. This patch
changes the output API to look like the wl_surface API.

Outputs now have some double-buffered state: the frame to be submitted
(currently only wlr_renderer frames are supported) and the damaged region.
To attach a pending frame, use wlr_output_attach_render. To set the pending
damaged region, use wlr_output_set_damage.

To submit the pending state, call wlr_output_commit. This will submit the
pending frame to the backend.

To migrate from the old API to the new one:

- Replace wlr_output_make_current calls by wlr_output_attach_render
- Replace wlr_output_swap_buffers calls by wlr_output_set_damage and
  wlr_output_commit
2019-04-23 14:34:30 -06:00
Alexander Bakker
776b6ce395 Fix software cursor rendering for tinywl and some examples 2019-01-13 21:39:56 +01:00
random human
6af77e3d9e
Release pointers in examples/multi-pointer 2018-09-03 04:00:53 +05:30
random human
7105864e13
Handle setting keymap in examples more securely 2018-09-03 02:43:44 +05:30
emersion
f86f1daf9a Fix build on FreeBSD 2018-08-16 10:54:45 +01:00
emersion
7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
Ilia Bozhinov
24cf70ae96 backends: implement custom EGL and renderer initialization
Compositors now have more control over how the backend creates its
renderer. Currently all backends create an EGL/GLES2 renderer, so
the necessary attributes for creating the context are passed to a
user-provided callback function. It is responsible for initializing
provided wlr_egl and to return a renderer. On fail, return 0.

Fixes #987
2018-05-25 14:56:52 +03:00
Timidger
9a1d0e42d2
Fixed emersion's issues 2018-05-10 19:03:58 -07:00
Timidger
7da50d065b
Fixed style issues 2018-05-10 19:03:58 -07:00
Timidger
8fd25cbc5b
Fixed indentation 2018-05-10 19:03:57 -07:00
Timidger
b3ca73c0ac
Multi-pointer ported over 2018-05-10 19:03:57 -07:00
Timidger
ad6d40c7c6
Moved cat out of support, removed support 2018-05-10 19:03:56 -07:00
Drew DeVault
a35a5786b0 Remove width_mm from wlr_pointer events 2018-03-28 10:46:50 -04:00
emersion
c63d94483b
Redesign wlr_texture
- Textures are now immutable (apart from those created from raw
  pixels), no more invalid textures
- Move all wl_drm stuff in wlr_renderer
- Most of wlr_texture fields are now private
- Remove some duplicated DMA-BUF code in the DRM backend
- Add more assertions
- Stride is now always given as bytes rather than pixels
- Drop wl_shm functions

Fun fact: this patch has been written 10,000 meters up in the air.
2018-03-24 23:48:32 -04:00
emersion
c41de2d1be
render: split render.h into wlr_renderer.h and wlr_texture.h 2018-03-19 23:16:29 +01:00
emersion
b6a3f240c7
matrix: move to types/ 2018-03-15 09:11:27 +01:00
emersion
0365b587f0
output: add damage tracking via buffer age 2018-01-21 00:06:35 +01:00
emersion
e29a0df8c1
output: fix software cursors damage tracking 2018-01-19 14:08:47 +01:00
Timidger
264ef0c261
Fixed logging for examples 2018-01-15 22:51:00 -05:00
emersion
3b4b8953d9
Update output layout when scale or transform changes 2017-12-12 21:58:00 +01:00
emersion
ac1573b0e7
Add scale parameter to wlr_cursor_set_image 2017-11-11 17:27:44 +01:00
Drew DeVault
4f73498b78 Move shared example code 2017-11-01 15:47:58 -04:00
emersion
6b6895168b
Fix segfaults on exit in examples/mutli-pointer 2017-10-31 15:02:41 +01:00
emersion
7dc716a2bb
Fix memory leak in wlr_cursor 2017-10-31 14:58:58 +01:00
emersion
ae9a46fc9b
Remove outdated TODOs, use wlr_surface_has_buffer 2017-10-31 12:30:57 +01:00
emersion
6a74a3586f
Fix wlr_cursor_destroy, handle device remove in examples/multi-cursor 2017-10-31 12:30:57 +01:00
emersion
044173d1df
Add multi-pointer example 2017-10-31 12:30:57 +01:00