retrieve correctly the parent window for context menus

This commit is contained in:
Alberto Fanjul 2022-10-12 11:45:39 +02:00
parent c2c52f5b9a
commit 25fd23996d
2 changed files with 4 additions and 4 deletions

View File

@ -1404,7 +1404,7 @@ namespace GitgCommit
private void do_edit_items(Gitg.StageStatusItem[] items)
{
var screen = d_main.get_screen();
var window = (Gtk.Window)d_main.get_toplevel();
var root = application.repository.get_workdir();
foreach (var item in items)
@ -1413,7 +1413,7 @@ namespace GitgCommit
try
{
Gtk.show_uri(screen, file.get_uri(), Gdk.CURRENT_TIME);
Gtk.show_uri_on_window(window, file.get_uri(), Gdk.CURRENT_TIME);
}
catch (Error e)
{

View File

@ -244,7 +244,7 @@ class Gitg.DiffViewFile : Gtk.Grid
open_file.activate.connect(() => {
try
{
Gtk.show_uri_on_window((Gtk.Window)d_expander.get_window(), location.get_uri(), Gdk.CURRENT_TIME);
Gtk.show_uri_on_window((Gtk.Window)d_expander.get_toplevel(), location.get_uri(), Gdk.CURRENT_TIME);
}
catch (Error e)
{
@ -260,7 +260,7 @@ class Gitg.DiffViewFile : Gtk.Grid
open_folder.activate.connect(() => {
try
{
Gtk.show_uri_on_window((Gtk.Window)d_expander.get_window(), location.get_parent().get_uri(), Gdk.CURRENT_TIME);
Gtk.show_uri_on_window((Gtk.Window)d_expander.get_toplevel(), location.get_parent().get_uri(), Gdk.CURRENT_TIME);
}
catch (Error e)
{