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
29
30
31
32
33
use glib::object::IsA;
use glib::translate::*;
use gtk_sys;
use Window;
pub trait GtkWindowExtManual: 'static {
fn present(&self);
}
#[cfg(target_os = "macos")]
extern "C" {
fn macos_force_foreground_level();
}
impl<O: IsA<Window>> GtkWindowExtManual for O {
fn present(&self) {
unsafe {
gtk_sys::gtk_window_present(self.as_ref().to_glib_none().0);
}
#[cfg(target_os = "macos")]
unsafe {
macos_force_foreground_level();
}
}
}