Commit graph

27 commits

Author SHA1 Message Date
Simon Ser
967e788bc8 backend/session: add docs 2024-02-01 16:08:47 +01:00
Simon Ser
63792b38e4 backend/session: take wl_event_loop instead of wl_display
wl_display holds a lot more than wlr_session needs: wlr_session
only needs to wait for a FD to become readable, but wl_display
provides full access to the Wayland client and protocol objects.

Switch to wl_event_loop to better reflect the above.
2023-11-23 11:15:07 +00:00
Simon Ser
ba13f471ea backend/session: drop unused <libudev.h>
We don't actually need to pull that header here.
2022-11-24 21:50:28 +00:00
Simon Ser
28d89779af Reformat doc comments
Unify the way we document our APIs. See CONTRIBUTING.md for the
rules.
2022-05-25 14:22:58 +00:00
Simon Ser
a37f538ca0 Introduce WLR_DEVICE_LEASE events
This will allow the DRM backend to reload its lessee list.
2021-11-19 16:06:07 +00:00
Simon Ser
2ff4e113e2 backend/session: introduce wlr_device_change_event
This struct contains additional information for session device
change events, such as the DRM connector ID that has changed.
2021-11-02 13:30:51 +01:00
Simon Ser
5597776914 backend/session: add wlr_device.events.remove 2021-04-27 09:11:44 +02:00
Kenny Levinsen
7f09085461 backend/session: Remove session_impl
libseat provides all session functionality, so there is no longer need
for a session backend abstraction. The libseat device ID, seat handle
and event loop handle are moved to the main wlr_session and wlr_device
structs.
2021-04-14 23:25:07 +02:00
Kenny Levinsen
d50bbf0bbc backend/session: Remove logind backend
This is instead delegated to libseat.
2021-04-11 10:03:13 +02:00
Simon Ser
e8d56ca415 backend/session: allow wlr_session_find_gpus to return an error
Sometimes wlr_session_find_gpus will encounter an error. This is
different from finding zero GPUs.

On error, wlr_session_find_gpus already returns -1. However, this is
casted to size_t, so callers uncorrectly assume this is a success.

Instead, make wlr_session_find_gpus return a ssize_t and allow callers
to handle the error accordingly.
2021-01-04 19:46:44 +01:00
Simon Ser
0e76f92de7 backend/session: replace session_signal with events.active
This is more idiomatic wlroots API. The new name makes it clear that the
signal is emitted when wlr_session.active changes.
2020-11-19 22:47:49 +01:00
Simon Ser
fbf11a41e1 backend/session: wait for DRM device if none found
Wait for a DRM device if none is found in wlr_session_find_gpus. This
can happen if the compositor is loaded before the display kernel driver.

This supersedes the logind CanGraphical property.

To test, e.g. with i915 and sway:

    rmmod -f i915
    sway &
    modprobe i915

Closes: https://github.com/swaywm/wlroots/issues/2093
2020-11-19 22:47:49 +01:00
Simon Ser
76bcddf071 backend/session: introduce wlr_session.events.add_drm_card
This is triggered when a new DRM card is added.

An easy way to test this patch is `modprobe vkms`.
2020-11-19 22:47:49 +01:00
Simon Ser
44a4792fd8 backend/session: operate on wlr_device
Instead of operating on FDs in {open,close}_device, operate on
wlr_devices. This avoids the device lookup in wlr_session and allows
callers to have access to wlr_device fields.

For now, we use it to remove wlr_session_signal_add and replace it with
a more idiomatic wlr_session.events.change field. In the future, other
events will be added.
2020-11-19 22:47:49 +01: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
Alexander Bakker
20db29779e Add destroy signals to types that are destroyed by wl_display_destroy 2018-08-26 23:23:12 +02:00
Scott Anderson
47985d2dc5 Multiseat fixes 2018-06-14 20:46:16 +12:00
morganamilo
6305e6327f
Fix typos in comments and strings 2018-05-03 21:59:43 +01:00
emersion
c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion
6001235b04
Listen to display destroy in session
It's not the backend's responsibility to destroy the session anymore.
2017-12-08 11:17:56 +01:00
Eric Molitor
5be11a5c95 Remove VLA from session.h
VLAs are optional C11 features and not supported by C++.
2017-11-10 15:12:00 +00:00
Scott Anderson
fa3d0ed929 Change wlr_session to open every GPU 2017-10-01 16:47:05 +13:00
emersion
427bdb5b55
Use more consistent include guard names 2017-09-23 10:26:01 +02:00
Scott Anderson
d16b2977f6 Remove single GPU assumptions from wlr_session 2017-08-26 14:50:16 +12:00
Scott Anderson
fb93628bda Merge wlr_udev into wlr_session 2017-08-26 14:02:04 +12:00
Scott Anderson
46823152ea Rename functions to be consistent with #93 2017-08-26 11:56:43 +12:00
Scott Anderson
2ae5cd6539 Moved session/ into backend/ 2017-08-06 13:25:26 +12:00
Renamed from include/wlr/session.h (Browse further)