diff --git a/configure.ac b/configure.ac index 9c11ab79..8cad5e8e 100644 --- a/configure.ac +++ b/configure.ac @@ -199,7 +199,7 @@ AC_SUBST([GTHREAD_LIBS]) AC_SUBST([GTHREAD_CFLAGS]) dnl GTKMM -PKG_CHECK_MODULES([GTKMM], [gtkmm-3.0 >= 3.0.0]) +PKG_CHECK_MODULES([GTKMM], [gtkmm-3.0 >= 3.4.0]) AC_SUBST([GTKMM_LIBS]) AC_SUBST([GTKMM_CFLAGS]) diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index a30329ba..ea29baa7 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -1748,28 +1748,44 @@ void Win_GParted::show_help_dialog( const Glib::ustring & filename /* E.g., gpar uri = uri + "?" + link_id ; } - gscreen = gdk_screen_get_default() ; - + gscreen = get_window()->get_screen()->gobj(); gtk_show_uri( gscreen, uri .c_str(), gtk_get_current_event_time(), &error ) ; if ( error != NULL ) { //Try opening yelp application directly - g_clear_error( &error ); // Clear error from trying to open gparted help manual above (gtk_show_uri). - Glib::ustring command = "yelp " + uri ; - gdk_spawn_command_line_on_screen( gscreen, command .c_str(), &error ) ; - } - if ( error != NULL ) - { - Gtk::MessageDialog dialog( *this - , _( "Unable to open GParted Manual help file" ) - , false - , Gtk::MESSAGE_ERROR - , Gtk::BUTTONS_OK - , true - ) ; - dialog .set_secondary_text( error ->message ) ; - dialog .run() ; + Glib::RefPtr yelp + = Gio::AppInfo::create_from_commandline("yelp", "", Gio::APP_INFO_CREATE_SUPPORTS_URIS); + + Glib::RefPtr context + = get_window()->get_display()->get_app_launch_context(); + + context->set_timestamp(gtk_get_current_event_time()); + + bool launched; + try + { + launched = yelp->launch_uris(std::vector(1, uri), context); + } + catch (Glib::Error& e) + { + std::cerr << e.what() << std::endl; + launched = false; + } + + if (!launched) + { + Gtk::MessageDialog dialog(*this, + _( "Unable to open GParted Manual help file" ), + false, + Gtk::MESSAGE_ERROR, + Gtk::BUTTONS_OK, + true); + dialog.set_secondary_text(error->message); + dialog.run(); + } + + g_clear_error(&error); } }