[Xfce4-commits] [apps/xfdashboard] 01/01: Revert "Differ between "clicked" which is usually associated to a left-click and a "click" with any other button at XfdashboardClickAction."

noreply at xfce.org noreply at xfce.org
Tue Jun 21 10:18:09 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 a8ad339609a8453a6784cd9a7e29b95bb149da65
Author: Stephan Haller <nomad at froevel.de>
Date:   Tue Jun 21 10:17:18 2016 +0200

    Revert "Differ between "clicked" which is usually associated to a left-click and a "click" with any other button at XfdashboardClickAction."
    
    This reverts commit db21a8ddc3a449ff968d3743029f94ec912e3720.
    
    It does not make sense. It is better to extend the 'clicked' signal handlers to check if left-button was pressed. It is more work but cleaner.
---
 libxfdashboard/click-action.c | 74 ++++++-------------------------------------
 libxfdashboard/click-action.h |  2 --
 libxfdashboard/marshal.list   |  2 --
 3 files changed, 9 insertions(+), 69 deletions(-)

diff --git a/libxfdashboard/click-action.c b/libxfdashboard/click-action.c
index 3804d24..1b813e5 100644
--- a/libxfdashboard/click-action.c
+++ b/libxfdashboard/click-action.c
@@ -99,9 +99,7 @@ GParamSpec* XfdashboardClickActionProperties[PROP_LAST]={ 0, };
 enum
 {
 	SIGNAL_CLICKED,
-	SIGNAL_BUTTON_CLICKED,
 	SIGNAL_LONG_PRESS,
-	SIGNAL_LONG_BUTTON_PRESS,
 
 	SIGNAL_LAST
 };
@@ -179,17 +177,9 @@ static gboolean _xfdashboard_click_action_emit_long_press(gpointer inUserData)
 	/* Reset variables */
 	priv->longPressID=0;
 
-	/* Get target actor of long-press used in emitting signal */
+	/* Emit signal */
 	actor=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(inUserData));
-
-	/* Emit 'long-press' signal only when left-button was pressed for perform click */
-	if(priv->pressButton==1)
-	{
-		g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_PRESS], 0, actor, CLUTTER_LONG_PRESS_ACTIVATE, &result);
-	}
-
-	/* Always emit 'long-button-press' signal */
-	g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_BUTTON_PRESS], 0, actor, CLUTTER_LONG_PRESS_ACTIVATE, priv->pressButton, &result);
+	g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_PRESS], 0, actor, CLUTTER_LONG_PRESS_ACTIVATE, &result);
 
 	/* Disconnect signal handlers */
 	if(priv->captureID!=0)
@@ -228,20 +218,15 @@ static void _xfdashboard_click_action_query_long_press(XfdashboardClickAction *s
 	}
 		else timeout=priv->longPressDuration;
 
-	/* Emit signal to determine if long-press should be supported.
-	 * First we try to normal use-case of long press of left button. If this is
-	 * not supported (returning FALSE) then re-try with the specific button pressed.
-	 */
+	/* Emit signal to determine if long-press should be supported */
 	actor=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(self));
 	g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_PRESS], 0, actor, CLUTTER_LONG_PRESS_QUERY, &result);
-	if(!result) g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_BUTTON_PRESS], 0, actor, CLUTTER_LONG_PRESS_QUERY, priv->pressButton, &result);
 
 	if(result)
 	{
-		priv->longPressID=
-			clutter_threads_add_timeout(timeout,
-										_xfdashboard_click_action_emit_long_press,
-										self);
+		priv->longPressID=clutter_threads_add_timeout(timeout,
+														_xfdashboard_click_action_emit_long_press,
+														self);
 	}
 }
 
@@ -264,17 +249,9 @@ static void _xfdashboard_click_action_cancel_long_press(XfdashboardClickAction *
 		g_source_remove(priv->longPressID);
 		priv->longPressID=0;
 
-		/* Get target actor of long-press used in emitting signal */
+		/* Emit signal */
 		actor=clutter_actor_meta_get_actor(CLUTTER_ACTOR_META(self));
-
-		/* Emit 'long-press' signal only when left-button was pressed for perform click */
-		if(priv->pressButton==1)
-		{
-			g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_PRESS], 0, actor, CLUTTER_LONG_PRESS_CANCEL, &result);
-		}
-
-		/* Always emit 'long-button-press' signal */
-		g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_BUTTON_PRESS], 0, actor, CLUTTER_LONG_PRESS_CANCEL, priv->pressButton, &result);
+		g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_LONG_PRESS], 0, actor, CLUTTER_LONG_PRESS_CANCEL, &result);
 	}
 }
 
@@ -352,15 +329,7 @@ static gboolean _xfdashboard_click_action_on_captured_event(XfdashboardClickActi
 			if(modifierState!=priv->modifierState) priv->modifierState=0;
 
 			_xfdashboard_click_action_set_pressed(self, FALSE);
-
-			/* Emit 'clicked' signal only when left-button was pressed for perform click */
-			if(priv->pressButton==1)
-			{
-				g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_CLICKED], 0, actor);
-			}
-
-			/* Always emit 'button-clicked' signal */
-			g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_BUTTON_CLICKED], 0, actor, priv->pressButton);
+			g_signal_emit(self, XfdashboardClickActionSignals[SIGNAL_CLICKED], 0, actor);
 			break;
 
 		case CLUTTER_MOTION:
@@ -659,18 +628,6 @@ static void xfdashboard_click_action_class_init(XfdashboardClickActionClass *kla
 						1,
 						CLUTTER_TYPE_ACTOR);
 
-	XfdashboardClickActionSignals[SIGNAL_BUTTON_CLICKED]=
-		g_signal_new("button-clicked",
-						G_TYPE_FROM_CLASS(klass),
-						G_SIGNAL_RUN_LAST,
-						G_STRUCT_OFFSET(XfdashboardClickActionClass, button_clicked),
-						NULL, NULL,
-						_xfdashboard_marshal_VOID__OBJECT_UINT,
-						G_TYPE_NONE,
-						2,
-						CLUTTER_TYPE_ACTOR,
-						G_TYPE_UINT);
-
 	XfdashboardClickActionSignals[SIGNAL_LONG_PRESS]=
 		g_signal_new("long-press",
 						G_TYPE_FROM_CLASS(klass),
@@ -682,19 +639,6 @@ static void xfdashboard_click_action_class_init(XfdashboardClickActionClass *kla
 						2,
 						CLUTTER_TYPE_ACTOR,
 						CLUTTER_TYPE_LONG_PRESS_STATE);
-
-	XfdashboardClickActionSignals[SIGNAL_LONG_BUTTON_PRESS]=
-		g_signal_new("long-button-press",
-						G_TYPE_FROM_CLASS(klass),
-						G_SIGNAL_RUN_LAST,
-						G_STRUCT_OFFSET(XfdashboardClickActionClass, long_button_press),
-						NULL, NULL,
-						_xfdashboard_marshal_BOOLEAN__OBJECT_ENUM_UINT,
-						G_TYPE_BOOLEAN,
-						3,
-						CLUTTER_TYPE_ACTOR,
-						CLUTTER_TYPE_LONG_PRESS_STATE,
-						G_TYPE_UINT);
 }
 
 /* Object initialization
diff --git a/libxfdashboard/click-action.h b/libxfdashboard/click-action.h
index 08a3ccb..88f85de 100644
--- a/libxfdashboard/click-action.h
+++ b/libxfdashboard/click-action.h
@@ -70,9 +70,7 @@ struct _XfdashboardClickActionClass
 	/*< public >*/
 	/* Virtual functions */
 	void (*clicked)(XfdashboardClickAction *self, ClutterActor *inActor);
-	void (*button_clicked)(XfdashboardClickAction *self, ClutterActor *inActor, guint inButton);
 	gboolean (*long_press)(XfdashboardClickAction *self, ClutterActor *inActor, ClutterLongPressState inState);
-	gboolean (*long_button_press)(XfdashboardClickAction *self, ClutterActor *inActor, ClutterLongPressState inState, guint inButton);
 };
 
 /* Public API */
diff --git a/libxfdashboard/marshal.list b/libxfdashboard/marshal.list
index 69ffce8..0120dfc 100644
--- a/libxfdashboard/marshal.list
+++ b/libxfdashboard/marshal.list
@@ -1,14 +1,12 @@
 VOID:FLOAT,FLOAT
 VOID:INT,INT
 VOID:INT,INT,INT,INT
-VOID:OBJECT,UINT
 VOID:OBJECT,OBJECT
 VOID:OBJECT,FLOAT,FLOAT
 VOID:OBJECT,OBJECT,OBJECT
 VOID:STRING,BOOLEAN
 BOOLEAN:OBJECT
 BOOLEAN:OBJECT,ENUM
-BOOLEAN:OBJECT,ENUM,UINT
 BOOLEAN:OBJECT,FLOAT,FLOAT
 BOOLEAN:OBJECT,STRING,OBJECT
 BOOLEAN:VOID

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


More information about the Xfce4-commits mailing list