display: Remove support for old D-Bus interface
version 1 support for the protocol is gone. All the gnome-settings-daemon for the past 2 years have supported the new interface.
This commit is contained in:
parent
b1af38f23d
commit
91faba68b2
1 changed files with 4 additions and 42 deletions
|
@ -85,11 +85,6 @@ struct App
|
||||||
DBusGConnection *connection;
|
DBusGConnection *connection;
|
||||||
DBusGProxy *proxy;
|
DBusGProxy *proxy;
|
||||||
DBusGProxyCall *proxy_call;
|
DBusGProxyCall *proxy_call;
|
||||||
|
|
||||||
enum {
|
|
||||||
APPLYING_VERSION_1,
|
|
||||||
APPLYING_VERSION_2
|
|
||||||
} apply_configuration_state;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void rebuild_gui (App *app);
|
static void rebuild_gui (App *app);
|
||||||
|
@ -2138,7 +2133,6 @@ begin_version2_apply_configuration (App *app, GdkWindow *parent_window, guint32
|
||||||
"org.gnome.SettingsDaemon.XRANDR_2");
|
"org.gnome.SettingsDaemon.XRANDR_2");
|
||||||
g_assert (app->proxy != NULL); /* that call does not fail unless we pass bogus names */
|
g_assert (app->proxy != NULL); /* that call does not fail unless we pass bogus names */
|
||||||
|
|
||||||
app->apply_configuration_state = APPLYING_VERSION_2;
|
|
||||||
app->proxy_call = dbus_g_proxy_begin_call (app->proxy, "ApplyConfiguration",
|
app->proxy_call = dbus_g_proxy_begin_call (app->proxy, "ApplyConfiguration",
|
||||||
apply_configuration_returned_cb, app,
|
apply_configuration_returned_cb, app,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -2152,27 +2146,6 @@ begin_version2_apply_configuration (App *app, GdkWindow *parent_window, guint32
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
begin_version1_apply_configuration (App *app)
|
|
||||||
{
|
|
||||||
app->proxy = dbus_g_proxy_new_for_name (app->connection,
|
|
||||||
"org.gnome.SettingsDaemon",
|
|
||||||
"/org/gnome/SettingsDaemon/XRANDR",
|
|
||||||
"org.gnome.SettingsDaemon.XRANDR");
|
|
||||||
g_assert (app->proxy != NULL); /* that call does not fail unless we pass bogus names */
|
|
||||||
|
|
||||||
app->apply_configuration_state = APPLYING_VERSION_1;
|
|
||||||
app->proxy_call = dbus_g_proxy_begin_call (app->proxy, "ApplyConfiguration",
|
|
||||||
apply_configuration_returned_cb, app,
|
|
||||||
NULL,
|
|
||||||
G_TYPE_INVALID,
|
|
||||||
G_TYPE_INVALID);
|
|
||||||
/* FIXME: we don't check for app->proxy_call == NULL, which could happen if
|
|
||||||
* the connection was disconnected. This is left as an exercise for the
|
|
||||||
* reader.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_current_configuration_is_saved (void)
|
ensure_current_configuration_is_saved (void)
|
||||||
{
|
{
|
||||||
|
@ -2215,22 +2188,11 @@ apply_configuration_returned_cb (DBusGProxy *proxy,
|
||||||
success = dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID);
|
success = dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
if (app->apply_configuration_state == APPLYING_VERSION_2
|
|
||||||
&& g_error_matches (error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD)) {
|
|
||||||
g_error_free (error);
|
|
||||||
|
|
||||||
g_object_unref (app->proxy);
|
|
||||||
app->proxy = NULL;
|
|
||||||
|
|
||||||
begin_version1_apply_configuration (app);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
/* We don't pop up an error message; gnome-settings-daemon already does that
|
/* We don't pop up an error message; gnome-settings-daemon already does that
|
||||||
* in case the selected RANDR configuration could not be applied.
|
* in case the selected RANDR configuration could not be applied.
|
||||||
*/
|
*/
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
g_object_unref (app->proxy);
|
g_object_unref (app->proxy);
|
||||||
app->proxy = NULL;
|
app->proxy = NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue