mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
cursor: ensure mapping box is always initialized
Commit 498f30aad1
changed the logic of
get_mapping() in types/wlr_cursor.c to use updated version of
wlr_output_layout_get_box(). However, the case where c_device isn't NULL
but doesn't have output or geometry mappings wasn't handled properly,
resulting in leaving the output value uninitialized. This commit fixes
`c_device != NULL` branch by returning from the function only when a
mapping is found.
Fixes https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3369
This commit is contained in:
parent
ab3b9f9a77
commit
3cfe29b598
1 changed files with 2 additions and 1 deletions
|
@ -248,11 +248,12 @@ static void get_mapping(struct wlr_cursor *cur,
|
|||
if (c_device) {
|
||||
if (!wlr_box_empty(&c_device->mapped_box)) {
|
||||
*box = c_device->mapped_box;
|
||||
return;
|
||||
} else if (c_device->mapped_output) {
|
||||
wlr_output_layout_get_box(cur->state->layout,
|
||||
c_device->mapped_output, box);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wlr_box_empty(&cur->state->mapped_box)) {
|
||||
|
|
Loading…
Reference in a new issue