Bring a new GTK 3 window to the forefront of OSX

How to bring the new GTK 3 window to the forefront of the OSX sierra? Any open window (using gtk-rs or python) first ends in the background. I tried:

  • set_modal(true)
  • set_keep_above(true)
  • present()

Nothing helps, and I could not find a bug report in that direction. Any idea how to achieve this?

GTK is installed through homegrown:

 languitar@miles ~/code/rust (master)> brew info gtk+3 gtk+3: stable 3.22.4 (bottled) Toolkit for creating graphical user interfaces http://gtk.org/ /usr/local/Cellar/gtk+3/3.22.4 (1,395 files, 70.0M) * Poured from bottle on 2016-11-26 at 17:11:24 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/gtk+3.rb ==> Dependencies Build: pkg-config ✔ Required: gdk-pixbuf ✔, atk ✔, gobject-introspection ✔, libepoxy ✔, pango ✔, glib ✔, hicolor-icon-theme ✔ Recommended: gsettings-desktop-schemas ✔ Optional: jasper ✔ 
+6
source share
1 answer

Exit to a limb, and this question ends shortly without the code shown. So I will post what code should look like. Not to say that you have not tried this. Just trying to help.

 use article::Article; use homepage; use gtk; use gtk::traits::*; use gdk::ffi::GdkRGBA; use pango; fn configure_window(window: &gtk::Window) { window.set_title("Phoronix Reader"); let (width, height) = (600, 500); window.set_default_size(width, height); window.connect_delete_event(|_,_| { gtk::main_quit(); gtk::signal::Inhibit(true) }); } pub fn launch() { gtk::init().unwrap_or_else(|_| panic!("Failed to initialize GTK.")); let window = gtk::Window::new(gtk::WindowType::Toplevel).unwrap(); configure_window(&window); window.show_all(); gtk::main(); } 
0
source

Source: https://habr.com/ru/post/1012676/


All Articles