summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Ropé <jrope@redhat.com>2020-06-29 14:43:42 +0200
committerJulien Ropé <jrope@redhat.com>2020-10-19 17:59:11 +0200
commit5ab5fe3475956740995c2cfed136b865fcd226f6 (patch)
tree0b2c38b10e80397521a619b2afe22053b47e12fc
parent6c475b368d34f24509bd03412b0a8a4d81a9f2e7 (diff)
Using GTK, there is no way to modify the monitor resolution.
Since vdagent_x11_set_monitor_config() can work only under the X11 backend, make sure we don't call it when under Wayland - it will fail anyway. Signed-off-by: Julien Ropé <jrope@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--src/vdagent/display.c8
-rw-r--r--src/vdagent/x11.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/vdagent/display.c b/src/vdagent/display.c
index a6de9c0..b341ab5 100644
--- a/src/vdagent/display.c
+++ b/src/vdagent/display.c
@@ -476,5 +476,13 @@ void vdagent_display_handle_graphics_device_info(VDAgentDisplay *display, uint8_
void vdagent_display_set_monitor_config(VDAgentDisplay *display, VDAgentMonitorsConfig *mon_config,
int fallback)
{
+#ifdef USE_GTK_FOR_MONITORS
+ if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
+ // FIXME: there is no equivalent call to set the monitor config under wayland
+ // Send the configuration back - the client need to know the resolution was not taken into account.
+ vdagent_display_send_daemon_guest_res(display, TRUE);
+ return;
+ }
+#endif
vdagent_x11_set_monitor_config(display->x11, mon_config, fallback);
}
diff --git a/src/vdagent/x11.c b/src/vdagent/x11.c
index b867a5a..bb738c5 100644
--- a/src/vdagent/x11.c
+++ b/src/vdagent/x11.c
@@ -193,7 +193,7 @@ gchar *vdagent_x11_get_wm_name(struct vdagent_x11 *x11)
}
struct vdagent_x11 *vdagent_x11_create(UdscsConnection *vdagentd,
- int debug, int sync)
+ int debug, int sync)
{
struct vdagent_x11 *x11;
XWindowAttributes attrib;