@@ -487,6 +487,8 @@ pub enum WindowEvent {
487487 Close ,
488488 TakeFocus ,
489489 HitTest ,
490+ ICCProfChanged ,
491+ DisplayChanged ( i32 ) ,
490492}
491493
492494impl WindowEvent {
@@ -510,6 +512,8 @@ impl WindowEvent {
510512 14 => WindowEvent :: Close ,
511513 15 => WindowEvent :: TakeFocus ,
512514 16 => WindowEvent :: HitTest ,
515+ 17 => WindowEvent :: ICCProfChanged ,
516+ 18 => WindowEvent :: DisplayChanged ( data1) ,
513517 _ => WindowEvent :: None ,
514518 }
515519 }
@@ -533,6 +537,8 @@ impl WindowEvent {
533537 WindowEvent :: Close => ( 14 , 0 , 0 ) ,
534538 WindowEvent :: TakeFocus => ( 15 , 0 , 0 ) ,
535539 WindowEvent :: HitTest => ( 16 , 0 , 0 ) ,
540+ WindowEvent :: ICCProfChanged => ( 17 , 0 , 0 ) ,
541+ WindowEvent :: DisplayChanged ( d1) => ( 18 , d1, 0 ) ,
536542 }
537543 }
538544
@@ -554,7 +560,9 @@ impl WindowEvent {
554560 | ( Self :: FocusLost , Self :: FocusLost )
555561 | ( Self :: Close , Self :: Close )
556562 | ( Self :: TakeFocus , Self :: TakeFocus )
557- | ( Self :: HitTest , Self :: HitTest ) => true ,
563+ | ( Self :: HitTest , Self :: HitTest )
564+ | ( Self :: ICCProfChanged , Self :: ICCProfChanged )
565+ | ( Self :: DisplayChanged ( _) , Self :: DisplayChanged ( _) ) => true ,
558566 _ => false ,
559567 }
560568 }
@@ -664,6 +672,8 @@ pub enum Event {
664672 x : i32 ,
665673 y : i32 ,
666674 direction : MouseWheelDirection ,
675+ precise_x : f32 ,
676+ precise_y : f32 ,
667677 } ,
668678
669679 JoyAxisMotion {
@@ -1193,6 +1203,8 @@ impl Event {
11931203 x,
11941204 y,
11951205 direction,
1206+ precise_x,
1207+ precise_y,
11961208 } => {
11971209 let event = sys:: SDL_MouseWheelEvent {
11981210 type_ : SDL_EventType :: SDL_MOUSEWHEEL as u32 ,
@@ -1202,6 +1214,8 @@ impl Event {
12021214 x,
12031215 y,
12041216 direction : direction. to_ll ( ) ,
1217+ preciseX : precise_x,
1218+ preciseY : precise_y,
12051219 } ;
12061220 unsafe {
12071221 ptr:: copy ( & event, ret. as_mut_ptr ( ) as * mut sys:: SDL_MouseWheelEvent , 1 ) ;
@@ -1664,6 +1678,8 @@ impl Event {
16641678 x : event. x ,
16651679 y : event. y ,
16661680 direction : mouse:: MouseWheelDirection :: from_ll ( event. direction ) ,
1681+ precise_x : event. preciseX ,
1682+ precise_y : event. preciseY ,
16671683 }
16681684 }
16691685
@@ -2336,6 +2352,8 @@ impl Event {
23362352 /// timestamp: 0,
23372353 /// window_id: 0,
23382354 /// which: 0,
2355+ /// precise_x: 0.0,
2356+ /// precise_y: 0.0,
23392357 /// x: 0,
23402358 /// y: 0,
23412359 /// direction: MouseWheelDirection::Normal,
@@ -2905,6 +2923,8 @@ mod test {
29052923 x : 23 ,
29062924 y : 91 ,
29072925 direction : MouseWheelDirection :: Flipped ,
2926+ precise_x : 1.6 ,
2927+ precise_y : 2.7 ,
29082928 } ;
29092929 let e2 = Event :: from_ll ( e. clone ( ) . to_ll ( ) . unwrap ( ) ) ;
29102930 assert_eq ! ( e, e2) ;
0 commit comments