From: Kruti Pendharkar Date: Fri, 17 Oct 2025 04:25:49 +0000 (-0700) Subject: Change to common source files not applicable to open-vm-tools at this time. X-Git-Tag: stable-13.1.0~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a680029382a50d774343e849796ac40ffb2b56f;p=thirdparty%2Fopen-vm-tools.git Change to common source files not applicable to open-vm-tools at this time. --- diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp b/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp index b28f29559..4756e0d38 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp @@ -195,15 +195,14 @@ BlockService::Shutdown() * Constructor. */ - -#ifdef VMTOOLS_USE_LEGACY_GTK CopyPasteDnDX11::CopyPasteDnDX11() : +#ifdef VMTOOLS_USE_LEGACY_GTK m_main(NULL), +#endif m_copyPasteUI(NULL), m_dndUI(NULL) { } -#endif /** @@ -234,6 +233,7 @@ CopyPasteDnDX11::Init(ToolsAppCtx *ctx) ASSERT(ctx); + #ifdef VMTOOLS_USE_LEGACY_GTK int argc = 1; const char *argv[] = {"", NULL}; @@ -284,8 +284,6 @@ CopyPasteDnDX11::~CopyPasteDnDX11() CopyPaste_Unregister(gUserMainWidget); if (gUserMainWidget) { - - #ifdef VMTOOLS_USE_LEGACY_GTK gtk_widget_destroy(gUserMainWidget); #endif @@ -354,6 +352,8 @@ CopyPasteDnDX11::RegisterDnD() TRACE_CALL(); CopyPasteDnDWrapper *wrapper = CopyPasteDnDWrapper::GetInstance(); + + if (!wrapper->IsDnDEnabled()) { return FALSE; } @@ -434,11 +434,9 @@ CopyPasteDnDX11::UnregisterDnD() void CopyPasteDnDX11::SetDnDAllowed(bool allowed) { -#ifdef VMTOOLS_USE_LEGACY_GTK ASSERT(m_dndUI); TRACE_CALL(); m_dndUI->SetDnDAllowed(allowed); -#endif } diff --git a/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h b/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h index 3b6799331..9acc3cc6a 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h +++ b/open-vm-tools/services/plugins/dndcp/dndGuestBase/copyPasteDnDX11.h @@ -67,12 +67,10 @@ public: void SetCopyPasteAllowed(bool allowed); private: CopyPasteUIX11 *m_copyPasteUI; - + DnDUIX11 *m_dndUI; #ifdef VMTOOLS_USE_LEGACY_GTK Gtk::Main *m_main; #endif - - DnDUIX11 *m_dndUI; }; #endif // __COPYPASTEDNDX11_H__ diff --git a/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h b/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h index 15a917891..3e4f59d8a 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h +++ b/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h @@ -28,9 +28,6 @@ #ifndef __DND_UI_X11_H__ #define __DND_UI_X11_H__ -#define VMTOOLS_USE_LEGACY_GTK - - #include "stringxx/string.hh" #include "dnd.h" #include "str.h" @@ -123,7 +120,6 @@ private: /* * Gtk+ Callbacks: Drag Destination. */ -#ifdef VMTOOLS_USE_LEGACY_GTK void OnGtkDragDataReceived(const Glib::RefPtr &dc, int x, int y, const Gtk::SelectionData &sd, guint info, guint time); @@ -146,7 +142,7 @@ private: */ void SourceDragStartDone(); void SourceUpdateFeedback(DND_DROPEFFECT effect); -#endif /* end VMTOOLS_USE_LEGACY_GTK */ + /* * Target function for GH DnD. Makes call to common layer. */ diff --git a/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnD.hh b/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnD.hh index f20f8c7e1..42f5b4f88 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnD.hh +++ b/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnD.hh @@ -203,4 +203,3 @@ private: }; #endif // GUEST_DND_HH - diff --git a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp index 690318f8d..628442d50 100644 --- a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp @@ -26,13 +26,7 @@ #define G_LOG_DOMAIN "dndcp" -#define VMTOOLS_USE_LEGACY_GTK - - -#ifdef VMTOOLS_USE_LEGACY_GTK -/* TODO: support xutils with GTK4 */ #include "xutils/xutils.hh" -#endif #include "dndUIX11.h" #include "guestDnDCPMgr.hh" @@ -41,10 +35,7 @@ extern "C" { #include /* for XTest*() */ #include -#ifdef VMTOOLS_USE_LEGACY_GTK #include -#endif - #include #include "vmware/guestrpc/tclodefs.h" @@ -111,10 +102,8 @@ DnDUIX11::DnDUIX11(ToolsAppCtx *ctx) { TRACE_CALL(); -#ifdef VMTOOLS_USE_LEGACY_GTK xutils::Init(); xutils::workAreaChanged.connect(sigc::mem_fun(this, &DnDUIX11::OnWorkAreaChanged)); -#endif /* * XXX Hard coded use of default screen means this doesn't work in dual- @@ -2759,7 +2748,6 @@ DnDUIX11::OnWorkAreaChanged(Glib::RefPtr screen) // IN { TRACE_CALL(); -#ifdef VMTOOLS_USE_LEGACY_GTK std::vector values; if (xutils::GetCardinalList(screen->get_root_window(), "_NET_WORKAREA", values) && values.size() > 0 @@ -2780,7 +2768,6 @@ DnDUIX11::OnWorkAreaChanged(Glib::RefPtr screen) // IN mOrigin.set_x(0); mOrigin.set_y(0); } -#endif g_debug("%s: new origin at (%d, %d)\n", __FUNCTION__, mOrigin.get_x(), mOrigin.get_y());