[Xfce4-commits] [apps/xfdashboard] 01/02: Change signal handlers for 'clicked' signals emitted by XfdashboardClickAction to check also for left-button pressed.

noreply at xfce.org noreply at xfce.org
Tue Jun 21 10:41:42 CEST 2016


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

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 405f0dcf9dbf3f5be8ffcf1e070b6de70d67e469
Author: Stephan Haller <nomad at froevel.de>
Date:   Tue Jun 21 10:37:27 2016 +0200

    Change signal handlers for 'clicked' signals emitted by XfdashboardClickAction to check also for left-button pressed.
---
 libxfdashboard/button.c                  | 12 ++++++++++--
 libxfdashboard/live-window.c             |  3 +++
 libxfdashboard/live-workspace.c          |  8 ++++++--
 libxfdashboard/quicklaunch.c             |  3 +++
 libxfdashboard/search-result-container.c |  8 ++++++--
 5 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/libxfdashboard/button.c b/libxfdashboard/button.c
index cdc883c..df3a8f7 100644
--- a/libxfdashboard/button.c
+++ b/libxfdashboard/button.c
@@ -1067,11 +1067,19 @@ static void _xfdashboard_button_allocate(ClutterActor *inActor,
 }
 
 /* proxy ClickAction signals */
-static void _xfdashboard_button_clicked(ClutterClickAction *inAction,
+static void _xfdashboard_button_clicked(XfdashboardClickAction *inAction,
 										ClutterActor *self,
 										gpointer inUserData)
 {
-	g_signal_emit(self, XfdashboardButtonSignals[SIGNAL_CLICKED], 0);
+	g_return_if_fail(XFDASHBOARD_IS_CLICK_ACTION(inAction));
+	g_return_if_fail(XFDASHBOARD_IS_BUTTON(self));
+
+	/* Only emit signal if click was perform with left button */
+	if(xfdashboard_click_action_get_button(inAction)==1)
+	{
+		/* Emit 'clicked' signal */
+		g_signal_emit(self, XfdashboardButtonSignals[SIGNAL_CLICKED], 0);
+	}
 }
 
 /* Destroy this actor */
diff --git a/libxfdashboard/live-window.c b/libxfdashboard/live-window.c
index b11ec72..f518655 100644
--- a/libxfdashboard/live-window.c
+++ b/libxfdashboard/live-window.c
@@ -140,6 +140,9 @@ static void _xfdashboard_live_window_on_clicked(XfdashboardLiveWindow *self, Clu
 	priv=self->priv;
 	action=XFDASHBOARD_CLICK_ACTION(inUserData);
 
+	/* Only emit any of these signals if click was perform with left button */
+	if(xfdashboard_click_action_get_button(inAction)!=1) return;
+
 	/* Check if click happened in "close button" */
 	if(clutter_actor_is_visible(priv->actorClose))
 	{
diff --git a/libxfdashboard/live-workspace.c b/libxfdashboard/live-workspace.c
index 6dd8b07..a1afec9 100644
--- a/libxfdashboard/live-workspace.c
+++ b/libxfdashboard/live-workspace.c
@@ -228,8 +228,12 @@ static void _xfdashboard_live_workspace_on_clicked(XfdashboardLiveWorkspace *sel
 {
 	g_return_if_fail(XFDASHBOARD_IS_LIVE_WORKSPACE(self));
 
-	/* Emit "clicked" signal */
-	g_signal_emit(self, XfdashboardLiveWorkspaceSignals[SIGNAL_CLICKED], 0);
+	/* Only emit signal if click was perform with left button */
+	if(xfdashboard_click_action_get_button(inAction)==1)
+	{
+		/* Emit "clicked" signal */
+		g_signal_emit(self, XfdashboardLiveWorkspaceSignals[SIGNAL_CLICKED], 0);
+	}
 }
 
 /* A window was closed */
diff --git a/libxfdashboard/quicklaunch.c b/libxfdashboard/quicklaunch.c
index 023c2d0..571efbb 100644
--- a/libxfdashboard/quicklaunch.c
+++ b/libxfdashboard/quicklaunch.c
@@ -321,6 +321,9 @@ static void _xfdashboard_quicklaunch_on_favourite_clicked(XfdashboardQuicklaunch
 	priv=self->priv;
 	button=XFDASHBOARD_APPLICATION_BUTTON(inUserData);
 
+	/* Only emit any of these signals if click was perform with left button */
+	if(xfdashboard_click_action_get_button(inAction)!=1) return;
+
 	/* If user wants to activate the last active windows for a running instance
 	 * of application whose button was clicked, then check if a window exists
 	 * and activate it. Otherwise launch a new instance.
diff --git a/libxfdashboard/search-result-container.c b/libxfdashboard/search-result-container.c
index 6b361d5..29881e3 100644
--- a/libxfdashboard/search-result-container.c
+++ b/libxfdashboard/search-result-container.c
@@ -392,8 +392,12 @@ static void _xfdashboard_search_result_container_on_result_item_actor_clicked(Xf
 
 	self=XFDASHBOARD_SEARCH_RESULT_CONTAINER(inUserData);
 
-	/* Activate result item by actor clicked */
-	_xfdashboard_search_result_container_activate_result_item_by_actor(self, inActor);
+	/* Only emit signal if click was perform with left button */
+	if(xfdashboard_click_action_get_button(inAction)==1)
+	{
+		/* Activate result item by actor clicked */
+		_xfdashboard_search_result_container_activate_result_item_by_actor(self, inActor);
+	}
 }
 
 /* Get and set up actor for result item from search provider */

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


More information about the Xfce4-commits mailing list