]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
open-vm-tools: build for FreeBSD fails in fakeMouseWayland
authorOliver Kurth <okurth@vmware.com>
Fri, 6 Jul 2018 22:02:37 +0000 (15:02 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 6 Jul 2018 22:02:37 +0000 (15:02 -0700)
Root Cause:
In the file fakeMouseWayland.cpp, several Linux related header files are included:
    <linux/input.h>
    <linux/ioctl.h>
    <linux/uinput.h>

These header files do not exist for FreeBSD and Solaris.

Solution:
Lib fakeMouse is not needed by FreeBSD and Solaris, so update the makefile to build the fakemouse related code only on Linux.

open-vm-tools/services/plugins/dndcp/Makefile.am
open-vm-tools/services/plugins/dndcp/dndUIX11.cpp

index fce1b9e1a2c3b0b7db385aae003ca233cf5f5388..8097fa61b5522cff04da85a324be36a7747a7eb9 100644 (file)
@@ -27,7 +27,6 @@ libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/dnd
 libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/dndGuest
 libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/stringxx
 libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/xutils
-libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/fakeMouse
 libdndcp_la_CPPFLAGS += -I$(top_srcdir)/include
 libdndcp_la_CPPFLAGS += @XDR_CPPFLAGS@
 
@@ -79,8 +78,6 @@ libdndcp_la_SOURCES += dndGuest/dndCPTransportGuestRpc.cpp
 libdndcp_la_SOURCES += stringxx/string.cc
 libdndcp_la_SOURCES += xutils/xutils.cc
 
-libdndcp_la_SOURCES += fakeMouseWayland/fakeMouseWayland.cpp
-
 libdndcp_la_SOURCES += copyPasteCompat.c
 libdndcp_la_SOURCES += copyPasteCompatX11.c
 libdndcp_la_SOURCES += copyPasteDnDWrapper.cpp
@@ -91,6 +88,12 @@ libdndcp_la_SOURCES += dndcp.cpp
 libdndcp_la_SOURCES += dragDetWndX11.cpp
 libdndcp_la_SOURCES += pointer.cpp
 
+if LINUX
+libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/fakeMouse
+libdndcp_la_SOURCES  += fakeMouseWayland/fakeMouseWayland.cpp
+libdndcp_la_CPPFLAGS += -DUSE_UINPUT
+endif
+
 if HAVE_MKDTEMP
 libdndcp_la_CPPFLAGS += -DDND_IS_XDG
 libdndcp_la_SOURCES  += dnd/dndXdg.c
index d7409245940e147a25d3de3b3ecad832685b8109..674dc973b9c661a9916efc2c7085f29666a51225 100644 (file)
@@ -47,7 +47,9 @@ extern "C" {
 #include "rpcout.h"
 }
 
+#ifdef USE_UINPUT
 #include "fakeMouseWayland/fakeMouseWayland.h"
+#endif
 #include "dnd.h"
 #include "dndMsg.h"
 #include "hostinfo.h"
@@ -106,6 +108,7 @@ DnDUIX11::DnDUIX11(ToolsAppCtx *ctx)
     */
    OnWorkAreaChanged(Gdk::Screen::get_default());
 
+#ifdef USE_UINPUT
    //Initialize the uinput device if available
    if (ctx->uinputFD != -1) {
       Screen * scrn = DefaultScreenOfDisplay(XOpenDisplay(NULL));
@@ -115,6 +118,8 @@ DnDUIX11::DnDUIX11(ToolsAppCtx *ctx)
          mScreenHeight = scrn->height;
       }
    }
+#endif
+
    g_debug("%s: Use UInput? %d.\n", __FUNCTION__, mUseUInput);
 }
 
@@ -372,6 +377,7 @@ DnDUIX11::OnSrcDragBegin(const CPClipboard *clip,       // IN
    CPClipboard_Clear(&mClipboard);
    CPClipboard_Copy(&mClipboard, clip);
 
+#ifdef USE_UINPUT
    if (mUseUInput) {
       /*
        * Check if the screen size changes, if so then update the
@@ -391,6 +397,7 @@ DnDUIX11::OnSrcDragBegin(const CPClipboard *clip,       // IN
          FakeMouse_Update(mScreenWidth, mScreenHeight);
       }
    }
+#endif
 
    /*
     * Before the DnD, we should make sure that the mouse is released
@@ -1926,8 +1933,10 @@ DnDUIX11::SendFakeXEvents(
     * happen more reliably on KDE, but isn't necessary on GNOME.
     */
    if (mUseUInput) {
+#ifdef USE_UINPUT
       FakeMouse_Move(x, y);
       FakeMouse_Move(x + 1, y + 1);
+#endif
    } else {
       XTestFakeMotionEvent(dndXDisplay, -1, x, y, CurrentTime);
       XTestFakeMotionEvent(dndXDisplay, -1, x + 1, y + 1, CurrentTime);
@@ -1938,7 +1947,9 @@ DnDUIX11::SendFakeXEvents(
       g_debug("%s: faking left mouse button %s\n", __FUNCTION__,
               buttonPress ? "press" : "release");
       if (mUseUInput) {
+#ifdef USE_UINPUT
          FakeMouse_Click(buttonPress);
+#endif
       } else {
          XTestFakeButtonEvent(dndXDisplay, 1, buttonPress, CurrentTime);
          XSync(dndXDisplay, False);