From 305aec78caf0266c69005c4d01e7955025af7b21 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Mon, 8 Mar 2021 09:28:50 +0100 Subject: [PATCH 1/2] Fixes necessary to build open-vm-tools with newer gtk and gcc RH-Author: Miroslav Rezanina (mrezanin) RH-MergeRequest: 2: Fixes necessary to build open-vm-tools with newer gtk and gcc RH-Commit: [1/2] a91a8017174b4788132aeb5832187e0c91b6419d (mrezanin/rhel-src-open-vm-tools) RH-Bugzilla: 1936382 RH-Acked-by: Cathy Avery gtk updates present in RHEL 9 makes some functions used by open-vm-tools deprecated so they raise warning during build. Code has to be updated to use non-deprecated functionality. In addition, some small fixes are necessary for proper build using gcc version available in RHEL 9. Signed-off-by: Miroslav Rezanina --- open-vm-tools/lib/include/tracer.hh | 2 -- open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp | 1 + .../plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp | 2 -- open-vm-tools/services/plugins/dndcp/dndUIX11.cpp | 4 ++-- open-vm-tools/services/plugins/dndcp/dndcp.cpp | 4 ++-- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/open-vm-tools/lib/include/tracer.hh b/open-vm-tools/lib/include/tracer.hh index 697caedb..71642ea1 100644 --- a/open-vm-tools/lib/include/tracer.hh +++ b/open-vm-tools/lib/include/tracer.hh @@ -28,9 +28,7 @@ #include "vm_basic_defs.h" -extern "C" { #include "glib.h" -} #ifdef VMX86_DEVEL diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp b/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp index 68212ab8..a7882b80 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp @@ -1666,6 +1666,7 @@ CopyPasteUIX11::FileBlockMonitorThread(void *arg) // IN char buf[sizeof(VMBLOCK_FUSE_READ_RESPONSE)]; ssize_t size; size = read(fd, buf, sizeof(VMBLOCK_FUSE_READ_RESPONSE)); + (void) size; /* Prevent unused variable warning */ /* * The current thread will block in read function until * any other application accesses the file params->fileBlockName diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp b/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp index 9b70984f..300c9323 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp @@ -31,13 +31,11 @@ #include "dnd.h" -extern "C" { #ifdef VMX86_TOOLS #include "vmware/tools/guestrpc.h" #else #include "guest_rpc.h" #endif -} #define GUEST_RPC_CMD_STR_DND "dnd.transport" #define GUEST_RPC_CMD_STR_CP "copypaste.transport" diff --git a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp index 50c2bf5e..9bb3ad64 100644 --- a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp @@ -467,8 +467,8 @@ DnDUIX11::OnSrcDragBegin(const CPClipboard *clip, // IN #ifndef GTK3 event.device = gdk_device_get_core_pointer(); #else - GdkDeviceManager* manager = gdk_display_get_device_manager(gdk_window_get_display(event.window)); - event.device = gdk_device_manager_get_client_pointer(manager); + GdkSeat* seat = gdk_display_get_default_seat(gdk_window_get_display(event.window)); + event.device = gdk_seat_get_pointer(seat); #endif event.x_root = mOrigin.get_x(); event.y_root = mOrigin.get_y(); diff --git a/open-vm-tools/services/plugins/dndcp/dndcp.cpp b/open-vm-tools/services/plugins/dndcp/dndcp.cpp index d1013f4a..e0bf2906 100644 --- a/open-vm-tools/services/plugins/dndcp/dndcp.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndcp.cpp @@ -33,9 +33,9 @@ extern "C" { #include "vmware/guestrpc/tclodefs.h" -#include "vmware/tools/plugin.h" -#include "vmware/tools/utils.h" } +#include "vmware/tools/utils.h" +#include "vmware/tools/plugin.h" #include #include "copyPasteDnDWrapper.h" -- 2.27.0