mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-25 01:40:56 -05:00
backend/drm: handle changes in the set of fixed output modes
In virtualised environments, it is possible for the set of fixed modes advertised by a connected output to change. This happens for example when resizing the window in the host system, which causes the preferred mode in the virtualised display to change to match the new size of the host window. This change keeps the value of `modes` in `struct wlr_output` updated when the available DRM modes change. Also, it adds a signal `available_modes` which notifies compositors when this occurs.
This commit is contained in:
parent
64da8f0c8d
commit
b7aa6ee176
4 changed files with 111 additions and 29 deletions
|
|
@ -226,6 +226,10 @@ void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width,
|
|||
wlr_signal_emit_safe(&output->events.mode, output);
|
||||
}
|
||||
|
||||
void wlr_output_update_available_modes(struct wlr_output *output) {
|
||||
wlr_signal_emit_safe(&output->events.available_modes, output);
|
||||
}
|
||||
|
||||
void wlr_output_set_transform(struct wlr_output *output,
|
||||
enum wl_output_transform transform) {
|
||||
if (output->transform == transform) {
|
||||
|
|
@ -343,6 +347,7 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
|
|||
wl_signal_init(&output->events.bind);
|
||||
wl_signal_init(&output->events.enable);
|
||||
wl_signal_init(&output->events.mode);
|
||||
wl_signal_init(&output->events.available_modes);
|
||||
wl_signal_init(&output->events.scale);
|
||||
wl_signal_init(&output->events.transform);
|
||||
wl_signal_init(&output->events.description);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue