[Xfce4-commits] [xfce/xfdesktop] 01/01: Editing menu items with right click optional (Bug #11031)

noreply at xfce.org noreply at xfce.org
Mon Oct 27 11:17:00 CET 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit 2287081a6e62e136fbc4976958623f60e7607b92
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Oct 27 13:08:17 2014 +0300

    Editing menu items with right click optional (Bug #11031)
    
    "/desktop-icons/right-click-edits-menu" xfconf option has been
    added. Setting it to FALSE will disable the right click menu
    editor and revert to the previous behavior. The menu can still
    be edited with a shift+left click in either case.
---
 src/xfdesktop-app-menu-item.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c
index f443ec9..a9161e0 100644
--- a/src/xfdesktop-app-menu-item.c
+++ b/src/xfdesktop-app-menu-item.c
@@ -32,8 +32,10 @@
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4ui/libxfce4ui.h>
 #include <exo/exo.h>
+#include <xfconf/xfconf.h>
 
 #include "xfdesktop-app-menu-item.h"
+#include "xfdesktop-common.h"
 
 struct _XfdesktopAppMenuItem
 {
@@ -367,9 +369,11 @@ xfdesktop_app_menu_item_edit_launcher(XfdesktopAppMenuItem *app_menu_item)
 static void
 xfdesktop_app_menu_item_activate (XfdesktopAppMenuItem *app_menu_item)
 {
+   XfconfChannel *channel;
    gchar *command;
    GdkEventButton *evt;
    guint button;
+   gboolean right_click_edits;
    GError *error = NULL;
 
    TRACE("entering");
@@ -380,11 +384,17 @@ xfdesktop_app_menu_item_activate (XfdesktopAppMenuItem *app_menu_item)
 
    evt = (GdkEventButton *)gtk_get_current_event();
 
-   /* Right click edits the launchers */
+   channel = xfconf_channel_get (XFDESKTOP_CHANNEL);
+   right_click_edits = xfconf_channel_get_bool (channel,
+                                                "/desktop-icons/right-click-edits-menu",
+                                                TRUE);
+
+   /* See if we're trying to edit the launcher */
    if(evt && GDK_BUTTON_RELEASE == evt->type) {
        button = evt->button;
 
-       if(button == 3 || (button == 1 && (evt->state & GDK_SHIFT_MASK))) {
+       /* right click can optionally edit launchers. Shift + left always will */
+       if((button == 3 && right_click_edits) || (button == 1 && (evt->state & GDK_SHIFT_MASK))) {
             if(xfdesktop_app_menu_item_edit_launcher(app_menu_item)) {
                 gdk_event_free((GdkEvent*)evt);
                 return;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list