[Xfce4-commits] [apps/xfdashboard] 03/10: Add touch handling to buttons

noreply at xfce.org noreply at xfce.org
Wed Oct 4 10:28:17 CEST 2017


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

n   o   m   a   d       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfdashboard.

commit 6473ccb132b6623e579e7ae1b1cf3f2091bdcb80
Author: TheZoq2 <frans.skarman at gmail.com>
Date:   Tue Oct 3 15:30:28 2017 +0200

    Add touch handling to buttons
---
 libxfdashboard/button.c                  |  7 +++++--
 libxfdashboard/live-window.c             | 10 ++++++++--
 libxfdashboard/live-workspace.c          |  7 +++++--
 libxfdashboard/search-result-container.c |  7 +++++--
 4 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/libxfdashboard/button.c b/libxfdashboard/button.c
index 1710f0f..0ce2285 100644
--- a/libxfdashboard/button.c
+++ b/libxfdashboard/button.c
@@ -82,8 +82,11 @@ static void _xfdashboard_button_clicked(XfdashboardClickAction *inAction,
 	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)==XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON)
+	/* Only emit any of these signals if click was perform with left button 
+	 * or is a short touchscreen touch event.
+	 */
+	if(xfdashboard_click_action_get_button(inAction)!=XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON &&
+			xfdashboard_click_action_get_button(inAction)!=0) return;
 	{
 		/* Emit 'clicked' signal */
 		g_signal_emit(self, XfdashboardButtonSignals[SIGNAL_CLICKED], 0);
diff --git a/libxfdashboard/live-window.c b/libxfdashboard/live-window.c
index 9e87853..6bbddfe 100644
--- a/libxfdashboard/live-window.c
+++ b/libxfdashboard/live-window.c
@@ -357,8 +357,14 @@ static void _xfdashboard_live_window_on_clicked(XfdashboardLiveWindow *self,
 	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(action)!=XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON) return;
+	/* Only emit any of these signals if click was perform with left button 
+	 * or is a short touchscreen touch event.
+	 */
+	if(xfdashboard_click_action_get_button(action)!=XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON &&
+			xfdashboard_click_action_get_button(action)!=0)
+	{
+		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 1fc5315..f72af6b 100644
--- a/libxfdashboard/live-workspace.c
+++ b/libxfdashboard/live-workspace.c
@@ -345,8 +345,11 @@ static void _xfdashboard_live_workspace_on_clicked(XfdashboardLiveWorkspace *sel
 
 	action=XFDASHBOARD_CLICK_ACTION(inUserData);
 
-	/* Only emit signal if click was perform with left button */
-	if(xfdashboard_click_action_get_button(action)==XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON)
+	/* Only emit any of these signals if click was perform with left button 
+	 * or is a short touchscreen touch event.
+	 */
+	if(xfdashboard_click_action_get_button(action)!=XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON &&
+			xfdashboard_click_action_get_button(action)!=0)
 	{
 		/* Emit "clicked" signal */
 		g_signal_emit(self, XfdashboardLiveWorkspaceSignals[SIGNAL_CLICKED], 0);
diff --git a/libxfdashboard/search-result-container.c b/libxfdashboard/search-result-container.c
index a82d187..f4379d2 100644
--- a/libxfdashboard/search-result-container.c
+++ b/libxfdashboard/search-result-container.c
@@ -393,8 +393,11 @@ static void _xfdashboard_search_result_container_on_result_item_actor_clicked(Xf
 
 	self=XFDASHBOARD_SEARCH_RESULT_CONTAINER(inUserData);
 
-	/* Only emit signal if click was perform with left button */
-	if(xfdashboard_click_action_get_button(inAction)==XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON)
+	/* Only emit any of these signals if click was perform with left button 
+	 * or is a short touchscreen touch event.
+	 */
+	if(xfdashboard_click_action_get_button(inAction)!=XFDASHBOARD_CLICK_ACTION_LEFT_BUTTON &&
+			xfdashboard_click_action_get_button(inAction)!=0) return;
 	{
 		/* Activate result item by actor clicked */
 		_xfdashboard_search_result_container_activate_result_item_by_actor(self, inActor);

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


More information about the Xfce4-commits mailing list