@@ -402,6 +402,13 @@ where
402
402
conn : & Connection ,
403
403
qh : & QueueHandle < D > ,
404
404
) {
405
+ let inner = state
406
+ . output_state ( )
407
+ . outputs
408
+ . iter_mut ( )
409
+ . find ( |inner| & inner. wl_output == output)
410
+ . expect ( "Received event for dead output" ) ;
411
+
405
412
match event {
406
413
wl_output:: Event :: Geometry {
407
414
x,
@@ -413,13 +420,6 @@ where
413
420
model,
414
421
transform,
415
422
} => {
416
- let inner = state
417
- . output_state ( )
418
- . outputs
419
- . iter_mut ( )
420
- . find ( |inner| & inner. wl_output == output)
421
- . expect ( "Received event for dead output" ) ;
422
-
423
423
inner. pending_info . location = ( x, y) ;
424
424
inner. pending_info . physical_size = ( physical_width, physical_height) ;
425
425
inner. pending_info . subpixel = match subpixel {
@@ -436,13 +436,6 @@ where
436
436
}
437
437
438
438
wl_output:: Event :: Mode { flags, width, height, refresh } => {
439
- let inner = state
440
- . output_state ( )
441
- . outputs
442
- . iter_mut ( )
443
- . find ( |inner| & inner. wl_output == output)
444
- . expect ( "Received event for dead output" ) ;
445
-
446
439
if let Some ( ( index, _) ) =
447
440
inner. pending_info . modes . iter ( ) . enumerate ( ) . find ( |( _, mode) | {
448
441
mode. dimensions == ( width, height) && mode. refresh_rate == refresh
@@ -492,49 +485,21 @@ where
492
485
}
493
486
494
487
wl_output:: Event :: Scale { factor } => {
495
- let inner = state
496
- . output_state ( )
497
- . outputs
498
- . iter_mut ( )
499
- . find ( |inner| & inner. wl_output == output)
500
- . expect ( "Received event for dead output" ) ;
501
-
502
488
inner. pending_info . scale_factor = factor;
503
489
inner. pending_wl = true ;
504
490
}
505
491
506
492
wl_output:: Event :: Name { name } => {
507
- let inner = state
508
- . output_state ( )
509
- . outputs
510
- . iter_mut ( )
511
- . find ( |inner| & inner. wl_output == output)
512
- . expect ( "Received event for dead output" ) ;
513
-
514
493
inner. pending_info . name = Some ( name) ;
515
494
inner. pending_wl = true ;
516
495
}
517
496
518
497
wl_output:: Event :: Description { description } => {
519
- let inner = state
520
- . output_state ( )
521
- . outputs
522
- . iter_mut ( )
523
- . find ( |inner| & inner. wl_output == output)
524
- . expect ( "Received event for dead output" ) ;
525
-
526
498
inner. pending_info . description = Some ( description) ;
527
499
inner. pending_wl = true ;
528
500
}
529
501
530
502
wl_output:: Event :: Done => {
531
- let inner = state
532
- . output_state ( )
533
- . outputs
534
- . iter_mut ( )
535
- . find ( |inner| & inner. wl_output == output)
536
- . expect ( "Received event for dead output" ) ;
537
-
538
503
let info = inner. pending_info . clone ( ) ;
539
504
inner. current_info = Some ( info. clone ( ) ) ;
540
505
inner. pending_wl = false ;
0 commit comments