[Xfce4-commits] [xfce/xfdesktop] 16/16: Fix double menu popup
noreply at xfce.org
noreply at xfce.org
Wed Apr 19 17:46:33 CEST 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository xfce/xfdesktop.
commit 58c9309e5364e2b06d94def4324c2ed7d2b455d5
Author: Eric Koegel <eric.koegel at gmail.com>
Date: Wed Apr 19 16:47:18 2017 +0300
Fix double menu popup
When right clicking on an icon, the button release event gets
called twice and was popping up the menu twice.
---
src/xfce-desktop.c | 15 ++++++++-------
src/xfdesktop-icon-view.c | 5 +++--
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c
index f1047d3..fd95ffd 100644
--- a/src/xfce-desktop.c
+++ b/src/xfce-desktop.c
@@ -1184,7 +1184,7 @@ xfce_desktop_button_press_event(GtkWidget *w,
guint state = evt->state;
XfceDesktop *desktop = XFCE_DESKTOP(w);
- TRACE("entering");
+ DBG("entering");
g_return_val_if_fail(XFCE_IS_DESKTOP(w), FALSE);
@@ -1196,11 +1196,12 @@ xfce_desktop_button_press_event(GtkWidget *w,
return FALSE;
#endif
/* no icons on the desktop, grab the focus and pop up the menu */
- if(!gtk_widget_has_grab(w))
+ if(!gtk_widget_has_grab(w)) {
gtk_grab_add(w);
xfce_desktop_popup_root_menu(desktop, button, evt->time);
return TRUE;
+ }
} else if(button == 2 || (button == 1 && (state & GDK_SHIFT_MASK)
&& (state & GDK_CONTROL_MASK)))
{
@@ -1220,7 +1221,7 @@ static gboolean
xfce_desktop_button_release_event(GtkWidget *w,
GdkEventButton *evt)
{
- TRACE("entering");
+ DBG("entering");
gtk_grab_remove(w);
@@ -1235,7 +1236,7 @@ xfce_desktop_popup_menu(GtkWidget *w)
GdkEventButton *evt;
guint button, etime;
- TRACE("entering");
+ DBG("entering");
evt = (GdkEventButton *)gtk_get_current_event();
if(evt && GDK_BUTTON_PRESS == evt->type) {
@@ -1710,7 +1711,7 @@ xfce_desktop_do_menu_popup(XfceDesktop *desktop,
GtkWidget *menu;
GList *menu_children;
- TRACE("entering");
+ DBG("entering");
if(gtk_widget_has_screen(GTK_WIDGET(desktop)))
screen = gtk_widget_get_screen(GTK_WIDGET(desktop));
@@ -1751,7 +1752,7 @@ xfce_desktop_popup_root_menu(XfceDesktop *desktop,
guint button,
guint activate_time)
{
- TRACE("entering");
+ DBG("entering");
xfce_desktop_do_menu_popup(desktop, button, activate_time,
signals[SIG_POPULATE_ROOT_MENU]);
@@ -1763,7 +1764,7 @@ xfce_desktop_popup_secondary_root_menu(XfceDesktop *desktop,
guint button,
guint activate_time)
{
- TRACE("entering");
+ DBG("entering");
xfce_desktop_do_menu_popup(desktop, button, activate_time,
signals[SIG_POPULATE_SECONDARY_ROOT_MENU]);
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index 239441a..a504302 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -917,7 +917,7 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
g_signal_emit(G_OBJECT(icon_view), __signals[SIG_ICON_ACTIVATED],
0, NULL);
xfdesktop_icon_activated(icon);
- //xfdesktop_icon_view_unselect_item(icon_view, icon);
+
xfdesktop_icon_view_unselect_all(icon_view);
}
}
@@ -1001,7 +1001,8 @@ xfdesktop_icon_view_button_release(GtkWidget *widget,
if((evt->button == 3 || (evt->button == 1 && (evt->state & GDK_SHIFT_MASK))) &&
icon_view->priv->definitely_dragging == FALSE &&
- icon_view->priv->definitely_rubber_banding == FALSE)
+ icon_view->priv->definitely_rubber_banding == FALSE &&
+ icon_view->priv->maybe_begin_drag == TRUE)
{
/* If we're in single click mode we may already have the icon, don't
* find it again. */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list