mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-07 04:06:14 -05:00
output-management-v1: only create custom mode object for enabled heads
We were always creating a custom mode object when the output didn't have a fixed mode. This is important to handle two cases: - Virtual outputs with no concept of fixed modes. - DRM outputs with a list of fixed modes but with a custom mode set. However, in the case where an output didn't have a fixed mode and was disabled, we were also creating the custom mode object. Clients would then see a "ghost" mode: a mode object with no properties at all. Fix this by only creating the custom mode object if the output is enabled. Fixes:5de9e1a99d("wlr-output-management: Send custom modes to clients") Closes: https://github.com/swaywm/sway/issues/8420 (cherry picked from commit2c3053370c)
This commit is contained in:
parent
b29ebe4a1c
commit
0e002db57c
1 changed files with 2 additions and 2 deletions
|
|
@ -867,7 +867,7 @@ static void manager_send_head(struct wlr_output_manager_v1 *manager,
|
|||
head_send_mode(head, head_resource, mode);
|
||||
}
|
||||
|
||||
if (output->current_mode == NULL) {
|
||||
if (head->state.mode == NULL && head->state.enabled) {
|
||||
// Output doesn't have a fixed mode set. Send a virtual one.
|
||||
head_send_mode(head, head_resource, NULL);
|
||||
}
|
||||
|
|
@ -927,7 +927,7 @@ static bool manager_update_head(struct wlr_output_manager_v1 *manager,
|
|||
}
|
||||
}
|
||||
|
||||
if (next->mode == NULL && !head_has_custom_mode_resources(head)) {
|
||||
if (next->mode == NULL && next->enabled && !head_has_custom_mode_resources(head)) {
|
||||
struct wl_resource *resource;
|
||||
wl_resource_for_each(resource, &head->resources) {
|
||||
head_send_mode(head, resource, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue