- if (strcmp ("Evince", application) == 0 && keys->window != NULL) {
- /* Note how Previous/Next only go to the
- * next/previous page despite their icon telling you
- * they should go to the beginning/end.
- *
- * There's very few keyboards with FFW/RWD though,
- * so we stick the most useful keybinding on the most
- * often seen keys
- */
- if (strcmp ("Play", key) == 0) {
- ev_window_start_presentation (keys->window);
- } else if (strcmp ("Previous", key) == 0) {
- ev_window_go_previous_page (keys->window);
- } else if (strcmp ("Next", key) == 0) {
- ev_window_go_next_page (keys->window);
- } else if (strcmp ("FastForward", key) == 0) {
- ev_window_go_last_page (keys->window);
- } else if (strcmp ("Rewind", key) == 0) {
- ev_window_go_first_page (keys->window);
- }
- }
+ /*
+ * 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->proxy,
+ "GrabMediaPlayerKeys", NULL,
+ G_TYPE_STRING, "Evince",
+ G_TYPE_UINT, 1,
+ G_TYPE_INVALID, G_TYPE_INVALID);
+}
+
+static void
+ev_media_player_keys_release_keys (EvMediaPlayerKeys *keys)
+{
+ dbus_g_proxy_call (keys->proxy,
+ "ReleaseMediaPlayerKeys", NULL,
+ G_TYPE_STRING, "Evince",
+ G_TYPE_INVALID, G_TYPE_INVALID);