<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote" dir="auto">ping</div><div class="gmail_quote" dir="auto"><br></div><div class="gmail_quote"><<a href="mailto:janku.jakub.jj@gmail.com">janku.jakub.jj@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is a preparatory patch for GTK+ vdagent redesign.<br>
<br>
Since most of the vdagent code still uses X11 lib,<br>
force GDK to use X11 backend by calling<br>
gdk_set_allowed_backends("x11"<wbr>).<br>
---<br>
Makefile.am | 2 ++<br>
<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 1 +<br>
src/vdagent/vdagent.c | 5 +++++<br>
3 files changed, 8 insertions(+)<br>
<br>
diff --git a/Makefile.am b/Makefile.am<br>
index 4689713..5a5b014 100644<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
@@ -15,6 +15,7 @@ src_spice_vdagent_CFLAGS = \<br>
$(X_CFLAGS) \<br>
$(SPICE_CFLAGS) \<br>
$(GLIB2_CFLAGS) \<br>
+ $(GTK_CFLAGS) \<br>
$(ALSA_CFLAGS) \<br>
-I$(srcdir)/src \<br>
-DUDSCS_NO_SERVER \<br>
@@ -24,6 +25,7 @@ src_spice_vdagent_LDADD = \<br>
$(X_LIBS) \<br>
$(SPICE_LIBS) \<br>
$(GLIB2_LIBS) \<br>
+ $(GTK_LIBS) \<br>
$(ALSA_LIBS) \<br>
$(NULL)<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index d92b527..4f4bc0a 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -86,6 +86,7 @@ AC_ARG_ENABLE([static-uinput],<br>
[enable_static_uinput="no"])<br>
<br>
PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= 2.34])<br>
+PKG_CHECK_MODULES([GTK], [gtk+-3.0])<br>
PKG_CHECK_MODULES(X, [xfixes xrandr >= 1.3 xinerama x11])<br>
PKG_CHECK_MODULES(SPICE, [spice-protocol >= 0.12.13])<br>
PKG_CHECK_MODULES(ALSA, [alsa >= 1.0.22])<br>
diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c<br>
index ac90634..4710a44 100644<br>
--- a/src/vdagent/vdagent.c<br>
+++ b/src/vdagent/vdagent.c<br>
@@ -36,6 +36,7 @@<br>
#include <spice/vd_agent.h><br>
#include <poll.h><br>
#include <glib-unix.h><br>
+#include <gtk/gtk.h><br>
<br>
#include "udscs.h"<br>
#include "vdagentd-proto.h"<br>
@@ -400,6 +401,7 @@ int main(int argc, char *argv[])<br>
g_option_context_set_summary(<wbr>context,<br>
"\tSpice session guest agent: X11\n"<br>
"\tVersion: " VERSION);<br>
+ g_option_context_add_group(<wbr>context, gtk_get_option_group(FALSE));<br>
g_option_context_parse(<wbr>context, &argc, &argv, &error);<br>
g_option_context_free(context)<wbr>;<br>
<br>
@@ -427,6 +429,9 @@ int main(int argc, char *argv[])<br>
if (do_daemonize)<br>
parent_socket = daemonize();<br>
<br>
+ gdk_set_allowed_backends("x11"<wbr>);<br>
+ gtk_init(NULL, NULL);<br>
+<br>
reconnect:<br>
if (version_mismatch) {<br>
syslog(LOG_INFO, "Version mismatch, restarting");<br>
<font color="#888888">--<br>
2.13.6<br>
<br>
</font></blockquote></div><br></div></div></div>