1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use ffi;
use glib;
use glib::object::IsA;
use Window;
pub trait GtkWindowExtManual {
fn present(&self);
}
#[cfg(target_os = "macos")]
extern "C" {
fn macos_force_foreground_level();
}
impl<O: IsA<Window> + IsA<glib::object::Object> + glib::object::ObjectExt> GtkWindowExtManual for O {
fn present(&self) {
unsafe {
ffi::gtk_window_present(self.to_glib_none().0);
}
#[cfg(target_os = "macos")]
unsafe { macos_force_foreground_level(); }
}
}