Rust-SDL2 / rust-sdl2

SDL2 bindings for Rust
MIT License
2.74k stars 468 forks source link

`SDL_FlashWindow`? #1174

Open ctrlcctrlv opened 2 years ago

ctrlcctrlv commented 2 years ago

Seems no API yet for SDL_FlashWindow. Until then I am abusing FFI:

impl Interface {
    pub fn flash_window(&mut self) {
        use std::ffi::c_void;
        extern "C" {
            fn SDL_FlashWindow(w: *mut c_void, o: isize);
        }
        unsafe {
            //                                                    2 == SDL_FLASH_UNTIL_FOCUSED
            SDL_FlashWindow(self.sdl_window.raw() as *mut c_void, 2); 
        }
    }
}
Cobrand commented 2 years ago

This is available since SDL2.0.16 so that explains it.

It should be fairly simple to add though.

fayccal commented 2 years ago

Hi, i am a CS student i would like to contribute to the project, i created #1204 pull request about this issue could you review it ? Thanks you :)