aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2013-04-11 19:59:28 +0000
committerTarmac <Unknown>2013-04-11 19:59:28 +0000
commit3bb48084c8cf683146cd5a3f6596e8d6d22de7df (patch)
treec19dbe15bcff064cc296a2ac73089c954ad74b9b
parentd774ac38dd84f52394bfcbb557b0e3475f999f34 (diff)
parent0c7736720fe80163f9a59f2c7c83ddd5be88e034 (diff)
downloadayatana-indicator-sound-3bb48084c8cf683146cd5a3f6596e8d6d22de7df.tar.gz
ayatana-indicator-sound-3bb48084c8cf683146cd5a3f6596e8d6d22de7df.tar.bz2
ayatana-indicator-sound-3bb48084c8cf683146cd5a3f6596e8d6d22de7df.zip
TransportMenuitem: ignore events not coming from transport-menu-items.
Fix not working MPRIS commands. Fixes: https://bugs.launchpad.net/bugs/1167908. Approved by PS Jenkins bot, Mathieu Trudel-Lapierre.
-rw-r--r--src/common-defs.h5
-rw-r--r--src/transport-menu-item.vala2
-rw-r--r--src/transport-widget.c8
-rw-r--r--vapi/common-defs.vapi1
4 files changed, 9 insertions, 7 deletions
diff --git a/src/common-defs.h b/src/common-defs.h
index a20fb03..efca5b2 100644
--- a/src/common-defs.h
+++ b/src/common-defs.h
@@ -64,8 +64,9 @@ typedef enum {
#define DBUSMENU_MUTE_MENUITEM_TYPE "x-canonical-sound-menu-mute-type"
#define DBUSMENU_MUTE_MENUITEM_VALUE "x-canonical-sound-menu-mute-value"
-#define DBUSMENU_TRANSPORT_MENUITEM_TYPE "x-canonical-sound-menu-player-transport-type"
-#define DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE "x-canonical-sound-menu-player-transport-state"
+#define DBUSMENU_TRANSPORT_MENUITEM_TYPE "x-canonical-sound-menu-player-transport-type"
+#define DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE "x-canonical-sound-menu-player-transport-state"
+#define DBUSMENU_TRANSPORT_MENUITEM_STATE_CHANGE "Transport state change"
#define DBUSMENU_TRACK_SPECIFIC_MENUITEM_TYPE "x-canonical-sound-menu-player-track-specific-type"
diff --git a/src/transport-menu-item.vala b/src/transport-menu-item.vala
index 0af3118..2a77d5a 100644
--- a/src/transport-menu-item.vala
+++ b/src/transport-menu-item.vala
@@ -70,7 +70,7 @@ public class TransportMenuitem : PlayerItem
Variant input_value,
uint timestamp)
{
- if (name != Dbusmenu.MENUITEM_EVENT_ACTIVATED)
+ if (name != DbusmenuTransport.MENUITEM_STATE_CHANGE)
return;
Variant v = input_value;
diff --git a/src/transport-widget.c b/src/transport-widget.c
index ebe8282..7df656e 100644
--- a/src/transport-widget.c
+++ b/src/transport-widget.c
@@ -450,7 +450,7 @@ transport_widget_seek (gpointer userdata)
new_transport_state = g_variant_new_int32 ((int)TRANSPORT_ACTION_FORWIND);
dbusmenu_menuitem_handle_event ( priv->twin_item,
- "Transport state change",
+ DBUSMENU_TRANSPORT_MENUITEM_STATE_CHANGE,
new_transport_state,
0 );
@@ -460,7 +460,7 @@ transport_widget_seek (gpointer userdata)
new_transport_state = g_variant_new_int32 ((int)TRANSPORT_ACTION_REWIND);
dbusmenu_menuitem_handle_event ( priv->twin_item,
- "Transport state change",
+ DBUSMENU_TRANSPORT_MENUITEM_STATE_CHANGE,
new_transport_state,
0 );
}
@@ -482,7 +482,7 @@ transport_widget_button_release_event (GtkWidget *menuitem,
priv->skip_frequency == 0){
GVariant* new_transport_state = g_variant_new_int32 ((int)result);
dbusmenu_menuitem_handle_event ( priv->twin_item,
- "Transport state change",
+ DBUSMENU_TRANSPORT_MENUITEM_STATE_CHANGE,
new_transport_state,
0 );
}
@@ -533,7 +533,7 @@ transport_widget_react_to_key_release_event ( TransportWidget* transport,
GVariant* new_transport_event = g_variant_new_int32((int)transport_event);
if (priv->skip_frequency == 0){
dbusmenu_menuitem_handle_event ( priv->twin_item,
- "Transport state change",
+ DBUSMENU_TRANSPORT_MENUITEM_STATE_CHANGE,
new_transport_event,
0 );
}
diff --git a/vapi/common-defs.vapi b/vapi/common-defs.vapi
index 33b4aad..a53d636 100644
--- a/vapi/common-defs.vapi
+++ b/vapi/common-defs.vapi
@@ -34,6 +34,7 @@ namespace DbusmenuMetadata{
namespace DbusmenuTransport{
public const string MENUITEM_TYPE;
public const string MENUITEM_PLAY_STATE;
+ public const string MENUITEM_STATE_CHANGE;
}
[CCode (cheader_filename = "common-defs.h")]