@@ -266,27 +266,32 @@ void egmde::FullscreenClient::on_output_changed(Output const* output)
266
266
draw_screen (p->second , should_draw_crash ());
267
267
}
268
268
269
- auto i = begin (hidden_outputs);
270
- while (i != end (hidden_outputs))
271
- {
272
- mir::geometry::Rectangle const screen_rect{{(*i)->x , (*i)->y }, {(*i)->width , (*i)->height }};
273
-
274
- if (!display_area.bounding_rectangle ().overlaps (screen_rect))
275
- {
276
- display_area.add (screen_rect);
277
- draw_screen (outputs.insert ({*i, SurfaceInfo{*i}}).first ->second , should_draw_crash ());
278
- break ;
279
- }
269
+ check_for_exposed_output ();
270
+ }
271
+ wl_display_flush (display);
272
+ }
280
273
281
- ++i;
282
- }
274
+ void egmde::FullscreenClient::check_for_exposed_output ()
275
+ {
276
+ auto i = begin (hidden_outputs);
277
+ while (i != end (hidden_outputs))
278
+ {
279
+ Rectangle const screen_rect{{(*i)->x , (*i)->y }, {(*i)->width , (*i)->height }};
283
280
284
- if (i != end (hidden_outputs ))
281
+ if (!display_area. bounding_rectangle (). overlaps (screen_rect ))
285
282
{
286
- hidden_outputs.erase (i);
283
+ display_area.add (screen_rect);
284
+ draw_screen (outputs.insert ({*i, SurfaceInfo{*i}}).first ->second , should_draw_crash ());
285
+ break ;
287
286
}
287
+
288
+ ++i;
289
+ }
290
+
291
+ if (i != end (hidden_outputs))
292
+ {
293
+ hidden_outputs.erase (i);
288
294
}
289
- wl_display_flush (display);
290
295
}
291
296
292
297
void egmde::FullscreenClient::on_output_gone (Output const * output)
@@ -316,25 +321,7 @@ void egmde::FullscreenClient::on_output_gone(Output const* output)
316
321
display_area.remove ({{output->x , output->y }, {output->width , output->height }});
317
322
}
318
323
319
- i = begin (hidden_outputs);
320
- while (i != end (hidden_outputs))
321
- {
322
- mir::geometry::Rectangle const screen_rect{{(*i)->x , (*i)->y }, {(*i)->width , (*i)->height }};
323
-
324
- if (!display_area.bounding_rectangle ().overlaps (screen_rect))
325
- {
326
- display_area.add (screen_rect);
327
- draw_screen (outputs.insert ({*i, SurfaceInfo{*i}}).first ->second , should_draw_crash ());
328
- break ;
329
- }
330
-
331
- ++i;
332
- }
333
-
334
- if (i != end (hidden_outputs))
335
- {
336
- hidden_outputs.erase (i);
337
- }
324
+ check_for_exposed_output ();
338
325
}
339
326
wl_display_flush (display);
340
327
}
0 commit comments