Index: ev-media-player-keys.c
===================================================================
--- ev-media-player-keys.c	(revision 3101)
+++ ev-media-player-keys.c	(working copy)
@@ -129,10 +129,14 @@
 					 G_CALLBACK (proxy_destroy),
 					 keys, 0);
 	}
-
+	/*
+	 * The uint as second argument is time. We give a very low value so that
+	 * if a media player is there it gets higher priority on the keys (0 is
+	 * a special value having maximum priority).
+	 */
 	dbus_g_proxy_call (keys->media_player_keys_proxy,
 			   "GrabMediaPlayerKeys", NULL,
-			   G_TYPE_STRING, "Evince", G_TYPE_UINT, 0, G_TYPE_INVALID,
+			   G_TYPE_STRING, "Evince", G_TYPE_UINT, 10, G_TYPE_INVALID,
 			   G_TYPE_INVALID);
 
 	dbus_g_object_register_marshaller (ev_marshal_VOID__STRING_STRING,
@@ -155,7 +159,7 @@
 		if (window != NULL) {
 			dbus_g_proxy_call (keys->media_player_keys_proxy,
 					   "GrabMediaPlayerKeys", NULL,
-					   G_TYPE_STRING, "Evince", G_TYPE_UINT, 0, G_TYPE_INVALID,
+					   G_TYPE_STRING, "Evince", G_TYPE_UINT, 10, G_TYPE_INVALID,
 					   G_TYPE_INVALID);
 			keys->window = g_object_ref (window);
 		}
@@ -170,7 +174,7 @@
 	if (keys->media_player_keys_proxy != NULL) {
 		dbus_g_proxy_call (keys->media_player_keys_proxy,
 				   "ReleaseMediaPlayerKeys", NULL,
-				   G_TYPE_STRING, "Ev", G_TYPE_INVALID, G_TYPE_INVALID);
+				   G_TYPE_STRING, "Evince", G_TYPE_INVALID, G_TYPE_INVALID);
 		g_object_unref (keys->media_player_keys_proxy);
 		keys->media_player_keys_proxy = NULL;
 	}
