summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Lureau <marcandre.lureau@redhat.com>2014-08-27 19:22:07 +0200
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-04-10 15:57:46 +0200
commit28618682aeabf98a2d177e87c3814666a7cda8f5 (patch)
tree2c01c0cb53329bb961f9f66e794cb1fa8f440945
parent21f49275318caafa7b81d61f95422eea306e3d59 (diff)
downloadvd_agent-28618682aeabf98a2d177e87c3814666a7cda8f5.tar.gz
vd_agent-28618682aeabf98a2d177e87c3814666a7cda8f5.tar.xz
vd_agent-28618682aeabf98a2d177e87c3814666a7cda8f5.zip
randr: remove monitors.xml on auto-configuration
GNOME will restore monitors.xml configuration whenever the timestamp "config > change". The "change" timestamp is the last user applied configuration, whereas the "config" timestamp is updated when the screen is updated or ouput/crtc modes are added/removed. These condition are triggered by vdagent during monitor config. Since we can't control the timestamps (playing with delay will be inherently event more racy), the only sane way I can think of is to disable gsd behaviour. This can be achieved by deleting the ~/.config/monitors.xml, which is the intended configuration to restore, so vdagent will override whatever configuration was saved previously. Somehow, if vdagent would be better integrated with gnome2, it would use the gnome-rr and/or org.gnome.SettingsDaemon.XRANDR dbus API. Thanksfully, in gnome3, the monitor auto-configuration has been merged in. https://bugzilla.redhat.com/show_bug.cgi?id=1086657
-rw-r--r--src/vdagent-x11-randr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
index c332a40..2491824 100644
--- a/src/vdagent-x11-randr.c
+++ b/src/vdagent-x11-randr.c
@@ -21,6 +21,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <glib.h>
#include <string.h>
#include <syslog.h>
#include <stdlib.h>
@@ -747,6 +748,10 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
goto exit;
}
+ gchar *config = g_build_filename (g_get_user_config_dir (), "monitors.xml", NULL);
+ g_unlink(config);
+ g_free(config);
+
for (i = mon_config->num_of_monitors; i < x11->randr.res->noutput; i++)
xrandr_disable_output(x11, i);