mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-29 07:58:24 -04:00
scene: use wl_list_for_each_safe to iterate outputs
The outputs loop in handle_scene_buffer_outputs_update may remove entries from the list while iterating, so use wl_list_for_each_safe instead of wl_list_for_each. Fixes:39e918edc8("scene: avoid redundant wl_surface.enter/leave events") (cherry picked from commit3cb2cf9425)
This commit is contained in:
parent
9c3bfbeb48
commit
ba32abbddb
1 changed files with 2 additions and 2 deletions
|
|
@ -112,8 +112,8 @@ static void handle_scene_buffer_outputs_update(
|
|||
// 2. When a surface transitions from being visible on 0 outputs to being visible on >0 outputs
|
||||
// send leave events for all entered outputs on which the surface is no longer visible as
|
||||
// well as enter events for any outputs not already entered.
|
||||
struct wlr_surface_output *entered_output;
|
||||
wl_list_for_each(entered_output, &surface->surface->current_outputs, link) {
|
||||
struct wlr_surface_output *entered_output, *tmp;
|
||||
wl_list_for_each_safe(entered_output, tmp, &surface->surface->current_outputs, link) {
|
||||
bool active = false;
|
||||
for (size_t i = 0; i < event->size; i++) {
|
||||
if (entered_output->output == event->active[i]->output) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue