Backport upstream patch for opening properties popup by keypress issue

(upstream bug 96)
i9cf
Mamoru TASAKA 4 years ago
parent 54e1aa00db
commit d299fcb369

@ -0,0 +1,96 @@
From aa40e0ee762dce8f33af945a002bab52257486ad Mon Sep 17 00:00:00 2001
From: Uwe Scholz <u.scholz83@gmx.de>
Date: Mon, 22 Feb 2021 22:48:38 +0100
Subject: [PATCH] Open properties popup by keypress at the position of the
file/directory in the file list, fixing #96
---
NEWS | 1 +
doc/C/releases.xml | 3 +++
src/gnome-cmd-file-list.cc | 47 ++++++++++++++++++++++++++------------
3 files changed, 36 insertions(+), 15 deletions(-)
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index d4f1d417..d21578e2 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -808,28 +808,45 @@ static char *build_selected_file_list (GnomeCmdFileList *fl, int *file_list_len)
}
-static void show_file_popup (GnomeCmdFileList *fl, GdkEventButton *event)
+static void get_popup_pos (GtkMenu *menu, gint *x, gint *y, gboolean push_in, GnomeCmdFileList *gnomeCmdFileList)
{
- // create the popup menu
- GtkWidget *menu = gnome_cmd_file_popmenu_new (fl);
- if (!menu) return;
+ g_return_if_fail (GNOME_CMD_IS_FILE_LIST (gnomeCmdFileList));
- g_object_ref (menu);
- g_object_set_data_full (*fl, "file_popup_menu", menu, g_object_unref);
+ gint w, h;
- gtk_menu_popup (GTK_MENU (menu), nullptr, nullptr, nullptr, fl, event->button, event->time);
+ get_focus_row_coordinates (gnomeCmdFileList, *x, *y, w, h);
}
-inline void show_file_popup_with_warp (GnomeCmdFileList *fl)
+static void show_file_popup (GnomeCmdFileList *fl, GdkEventButton *event)
{
- gint x, y, w, h;
-
- get_focus_row_coordinates (fl, x, y, w, h);
+ // create the popup menu
+ GtkWidget *menu = gnome_cmd_file_popmenu_new (fl);
+ if (!menu) return;
- //FIXME: Warp the pointer to x, y here
+ g_object_ref (menu);
+ g_object_set_data_full (*fl, "file_popup_menu", menu, g_object_unref);
- show_file_popup (fl, nullptr);
+ if (event)
+ {
+ gtk_menu_popup (GTK_MENU (menu),
+ nullptr,
+ nullptr,
+ nullptr,
+ fl,
+ event->button,
+ event->time);
+ }
+ else
+ {
+ gtk_menu_popup (GTK_MENU (menu),
+ nullptr,
+ nullptr,
+ (GtkMenuPositionFunc) get_popup_pos,
+ fl,
+ 0,
+ gtk_get_current_event_time ());
+ }
}
@@ -2480,7 +2497,7 @@ gboolean GnomeCmdFileList::key_pressed(GdkEventKey *event)
return TRUE;
case GDK_F10:
- show_file_popup_with_warp (this);
+ show_file_popup (this, nullptr);
return TRUE;
case GDK_Left:
@@ -2662,7 +2679,7 @@ gboolean GnomeCmdFileList::key_pressed(GdkEventKey *event)
return TRUE;
case GDK_Menu:
- show_file_popup_with_warp (this);
+ show_file_popup (this, nullptr);
return TRUE;
default:
--
GitLab

@ -31,7 +31,7 @@
%global use_autotool 0
%global update_po 0
%global if_pre 0
%global main_release 1
%global main_release 2
#%%global extratag %{git_pull_JST}git%{shorthash}
%undefine extratag
%global mimeedit_rev 1958
@ -68,6 +68,9 @@ Source0: ftp://ftp.gnome.org/pub/GNOME/sources/%{name}/1.10/%{name}-%{vers
Source1: gnome-commander.sh
Source10: mimeedit-svn%{mimeedit_rev}.sh
Patch1: gnome-commander-1.6.0-path-fedora-specific.patch
# https://gitlab.gnome.org/GNOME/gnome-commander/-/issues/96
# https://gitlab.gnome.org/GNOME/gnome-commander/-/commit/aa40e0ee762dce8f33af945a002bab52257486ad
Patch101: gnome-commander-1.10.3-open-property-keypress-bz96.patch
BuildRequires: gcc-c++
@ -136,6 +139,7 @@ ansluta till FTP-servrar och SMB-nätverk.
#%%setup -q -n %{name}-%{githash}
%patch1 -p1 -b .path
%patch101 -p1 -b .upst101
%if 0%{use_autotool} > 0
( export NOCONFIGURE=1 ; sh autogen.sh )
@ -260,6 +264,10 @@ desktop-file-install \
%{_datadir}/pixmaps/%{name}/
%changelog
* Tue Feb 23 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 4:1.10.3-2
- Backport upstream patch for opening properties popup by keypress issue
(upstream bug 96)
* Tue Jun 30 2020 Mamoru TASAKA <mtasaka@fedoraproject.org> - 4:1.10.3-1
- 1.10.3

Loading…
Cancel
Save