Patch for a Wayland related crash in the desktopEvents plugin (RHBZ#1526952).

gdk_set_allowed_backends() is available in version 3.10 and later only.
This commit is contained in:
Ravindra Kumar 2017-12-29 14:59:01 -08:00
parent 9c4eb55d20
commit fec5bc0e04
2 changed files with 45 additions and 3 deletions

View File

@ -28,7 +28,7 @@
Name: open-vm-tools
Version: %{toolsversion}
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Open Virtual Machine Tools for virtual machines hosted on VMware
Group: Applications/System
License: GPLv2
@ -42,6 +42,8 @@ ExclusiveArch: x86_64
ExclusiveArch: %{ix86} x86_64
%endif
Patch1: wayland-crash.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
@ -57,8 +59,8 @@ BuildRequires: glib2-devel >= 2.14.0
# gdk-pixbuf2-xlib-devel. Therefore, we need to pull in
# gdk-pixbuf2-xlib-devel dependency ourselves.
BuildRequires: gdk-pixbuf2-xlib-devel
BuildRequires: gtk3-devel >= 3.0.0
BuildRequires: gtkmm30-devel >= 3.0.0
BuildRequires: gtk3-devel >= 3.10.0
BuildRequires: gtkmm30-devel >= 3.10.0
%else
BuildRequires: gtk2-devel >= 2.4.0
BuildRequires: gtkmm24-devel
@ -140,6 +142,7 @@ machines.
%prep
%setup -q -n %{name}-%{version}-%{toolsbuild}
%patch1 -p1
%build
# Required for regenerating configure script when
@ -314,6 +317,10 @@ fi
%{_bindir}/vmware-vgauth-smoketest
%changelog
* Fri Dec 29 2017 Ravindra Kumar <ravindrakumar@vmware.com> - 10.2.0-3
- Patch for a Wayland related crash in the desktopEvents plugin (RHBZ#1526952).
- gdk_set_allowed_backends() is available in version 3.10 and later only.
* Mon Dec 18 2017 Ravindra Kumar <ravindrakumar@vmware.com> - 10.2.0-2
- Build with gtk3 only on newer distros.

35
wayland-crash.patch Normal file
View File

@ -0,0 +1,35 @@
diff -ru open-vm-tools-10.2.0-7253323.orig/services/plugins/desktopEvents/x11Lock.c open-vm-tools-10.2.0-7253323/services/plugins/desktopEvents/x11Lock.c
--- open-vm-tools-10.2.0-7253323.orig/services/plugins/desktopEvents/x11Lock.c 2017-12-15 11:09:51.000000000 -0800
+++ open-vm-tools-10.2.0-7253323/services/plugins/desktopEvents/x11Lock.c 2017-12-29 14:39:35.821511531 -0800
@@ -364,6 +364,13 @@
g_set_prgname(VMUSER_TITLE);
argv[0] = VMUSER_TITLE;
+#if defined(GTK3) && GTK_MINOR_VERSION >= 10
+ /*
+ * There is no Wayland support yet, only X11 backend is supported.
+ */
+ gdk_set_allowed_backends("x11");
+#endif
+
/* XXX: is calling gtk_init() multiple times safe? */
gtk_init(&argc, (char ***) &argv);
diff -ru open-vm-tools-10.2.0-7253323.orig/services/plugins/dndcp/copyPasteDnDX11.cpp open-vm-tools-10.2.0-7253323/services/plugins/dndcp/copyPasteDnDX11.cpp
--- open-vm-tools-10.2.0-7253323.orig/services/plugins/dndcp/copyPasteDnDX11.cpp 2017-12-15 11:09:51.000000000 -0800
+++ open-vm-tools-10.2.0-7253323/services/plugins/dndcp/copyPasteDnDX11.cpp 2017-12-29 14:39:51.587510648 -0800
@@ -211,6 +211,14 @@
CopyPasteDnDX11::Init(ToolsAppCtx *ctx)
{
TRACE_CALL();
+
+#if defined(GTK3) && GTK_MINOR_VERSION >= 10
+ /*
+ * There is no Wayland support yet, only X11 backend is supported.
+ */
+ gdk_set_allowed_backends("x11");
+#endif
+
CopyPasteDnDWrapper *wrapper = CopyPasteDnDWrapper::GetInstance();
ASSERT(ctx);