[gnome-settings-daemon] media-keys: Remove video-out and rotate-video handling
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] media-keys: Remove video-out and rotate-video handling
- Date: Wed, 19 Jul 2017 09:35:21 +0000 (UTC)
commit e4ad6105a8db8d99739d720caceaf1a4acf427a3
Author: Rui Matos <tiagomatos gmail com>
Date: Wed May 3 19:28:02 2017 +0200
media-keys: Remove video-out and rotate-video handling
These are the sole remaining users of the xrandr plugin DBus API which
we want to remove in order to move the functionality to mutter. The
key binding handling will be moved to mutter as well.
https://bugzilla.gnome.org/show_bug.cgi?id=782231
plugins/media-keys/gsd-media-keys-manager.c | 115 ---------------------------
plugins/media-keys/media-keys.h | 2 -
plugins/media-keys/shortcuts-list.h | 5 -
3 files changed, 0 insertions(+), 122 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index afb3656..deb8a39 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -218,8 +218,6 @@ struct GsdMediaKeysManagerPrivate
GDBusNodeInfo *introspection_data;
GDBusConnection *connection;
GCancellable *bus_cancellable;
- GDBusProxy *xrandr_proxy;
- GCancellable *cancellable; /* Only used for XRandR operations */
guint start_idle_id;
@@ -1663,83 +1661,6 @@ do_multimedia_player_action (GsdMediaKeysManager *manager,
}
static void
-on_xrandr_action_call_finished (GObject *source_object,
- GAsyncResult *res,
- GsdMediaKeysManager *manager)
-{
- GError *error = NULL;
- GVariant *variant;
- char *action;
-
- action = g_object_get_data (G_OBJECT (source_object),
- "gsd-media-keys-manager-xrandr-action");
-
- variant = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error);
-
- g_object_unref (manager->priv->cancellable);
- manager->priv->cancellable = NULL;
-
- if (error != NULL) {
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_warning ("Failed to complete XRandR action: %s", error->message);
- g_error_free (error);
- } else {
- g_variant_unref (variant);
- }
-
- g_free (action);
-}
-
-static void
-do_xrandr_action (GsdMediaKeysManager *manager,
- const char *action,
- gint64 timestamp)
-{
- GsdMediaKeysManagerPrivate *priv = manager->priv;
-
- if (priv->connection == NULL || priv->xrandr_proxy == NULL) {
- g_warning ("No existing D-Bus connection trying to handle XRANDR keys");
- return;
- }
-
- if (priv->cancellable != NULL) {
- g_debug ("xrandr action already in flight");
- return;
- }
-
- priv->cancellable = g_cancellable_new ();
-
- g_object_set_data (G_OBJECT (priv->xrandr_proxy),
- "gsd-media-keys-manager-xrandr-action",
- g_strdup (action));
-
- g_dbus_proxy_call (priv->xrandr_proxy,
- action,
- g_variant_new ("(x)", timestamp),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- priv->cancellable,
- (GAsyncReadyCallback) on_xrandr_action_call_finished,
- manager);
-}
-
-static gboolean
-do_video_out_action (GsdMediaKeysManager *manager,
- gint64 timestamp)
-{
- do_xrandr_action (manager, "VideoModeSwitch", timestamp);
- return FALSE;
-}
-
-static gboolean
-do_video_rotate_action (GsdMediaKeysManager *manager,
- gint64 timestamp)
-{
- do_xrandr_action (manager, "Rotate", timestamp);
- return FALSE;
-}
-
-static void
sensor_properties_changed (GDBusProxy *proxy,
GVariant *changed_properties,
GStrv invalidated_properties,
@@ -2428,12 +2349,6 @@ do_action (GsdMediaKeysManager *manager,
return do_multimedia_player_action (manager, "Repeat");
case RANDOM_KEY:
return do_multimedia_player_action (manager, "Shuffle");
- case VIDEO_OUT_KEY:
- do_video_out_action (manager, timestamp);
- break;
- case ROTATE_VIDEO_KEY:
- do_video_rotate_action (manager, timestamp);
- break;
case ROTATE_VIDEO_LOCK_KEY:
do_video_rotate_lock_action (manager, timestamp);
break;
@@ -2995,11 +2910,6 @@ gsd_media_keys_manager_stop (GsdMediaKeysManager *manager)
g_clear_object (&priv->iio_sensor_proxy);
g_clear_pointer (&priv->chassis_type, g_free);
- if (priv->cancellable != NULL) {
- g_cancellable_cancel (priv->cancellable);
- g_clear_object (&priv->cancellable);
- }
-
g_clear_pointer (&priv->introspection_data, g_dbus_node_info_unref);
g_clear_object (&priv->connection);
@@ -3168,21 +3078,6 @@ gsd_media_keys_manager_finalize (GObject *object)
}
static void
-xrandr_ready_cb (GObject *source_object,
- GAsyncResult *res,
- GsdMediaKeysManager *manager)
-{
- GError *error = NULL;
-
- manager->priv->xrandr_proxy = g_dbus_proxy_new_finish (res, &error);
- if (manager->priv->xrandr_proxy == NULL) {
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_warning ("Failed to get proxy for XRandR operations: %s", error->message);
- g_error_free (error);
- }
-}
-
-static void
power_keyboard_proxy_signal_cb (GDBusProxy *proxy,
const gchar *sender_name,
const gchar *signal_name,
@@ -3292,16 +3187,6 @@ on_bus_gotten (GObject *source_object,
g_dbus_proxy_new (manager->priv->connection,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
- GSD_DBUS_NAME ".XRANDR",
- GSD_DBUS_PATH "/XRANDR",
- GSD_DBUS_BASE_INTERFACE ".XRANDR_2",
- NULL,
- (GAsyncReadyCallback) xrandr_ready_cb,
- manager);
-
- g_dbus_proxy_new (manager->priv->connection,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL,
GSD_DBUS_NAME ".Power",
GSD_DBUS_PATH "/Power",
GSD_DBUS_BASE_INTERFACE ".Power",
diff --git a/plugins/media-keys/media-keys.h b/plugins/media-keys/media-keys.h
index ba37934..85af02b 100644
--- a/plugins/media-keys/media-keys.h
+++ b/plugins/media-keys/media-keys.h
@@ -59,8 +59,6 @@ typedef enum {
FORWARD_KEY,
REPEAT_KEY,
RANDOM_KEY,
- VIDEO_OUT_KEY,
- ROTATE_VIDEO_KEY,
ROTATE_VIDEO_LOCK_KEY,
MAGNIFIER_KEY,
SCREENREADER_KEY,
diff --git a/plugins/media-keys/shortcuts-list.h b/plugins/media-keys/shortcuts-list.h
index 88f80b7..00a15b6 100644
--- a/plugins/media-keys/shortcuts-list.h
+++ b/plugins/media-keys/shortcuts-list.h
@@ -84,11 +84,6 @@ static struct {
{ FORWARD_KEY, NULL, N_("Forward"), "XF86AudioForward", SHELL_ACTION_MODE_ALL },
{ REPEAT_KEY, NULL, N_("Repeat"), "XF86AudioRepeat", SHELL_ACTION_MODE_ALL },
{ RANDOM_KEY, NULL, N_("Random Play"), "XF86AudioRandomPlay", SHELL_ACTION_MODE_ALL },
- { VIDEO_OUT_KEY, NULL, N_("Video Out"), "<Super>p", SHELL_ACTION_MODE_ALL },
- /* Key code of the XF86Display key (Fn-F7 on Thinkpads, Fn-F4 on HP machines, etc.) */
- { VIDEO_OUT_KEY, NULL, N_("Video Out"), "XF86Display", SHELL_ACTION_MODE_ALL },
- /* Key code of the XF86RotateWindows key (present on some tablets) */
- { ROTATE_VIDEO_KEY, NULL, N_("Rotate Screen"), "XF86RotateWindows", SHELL_ACTION_MODE_NORMAL },
{ ROTATE_VIDEO_LOCK_KEY, NULL, N_("Orientation Lock"), "<Super>o", SHELL_ACTION_MODE_ALL },
{ MAGNIFIER_KEY, "magnifier", NULL, NULL, SHELL_ACTION_MODE_ALL },
{ SCREENREADER_KEY, "screenreader", NULL, NULL, SHELL_ACTION_MODE_ALL },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]