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@
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
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
#include "rpcout.h"
}
+#ifdef USE_UINPUT
#include "fakeMouseWayland/fakeMouseWayland.h"
+#endif
#include "dnd.h"
#include "dndMsg.h"
#include "hostinfo.h"
*/
OnWorkAreaChanged(Gdk::Screen::get_default());
+#ifdef USE_UINPUT
//Initialize the uinput device if available
if (ctx->uinputFD != -1) {
Screen * scrn = DefaultScreenOfDisplay(XOpenDisplay(NULL));
mScreenHeight = scrn->height;
}
}
+#endif
+
g_debug("%s: Use UInput? %d.\n", __FUNCTION__, mUseUInput);
}
CPClipboard_Clear(&mClipboard);
CPClipboard_Copy(&mClipboard, clip);
+#ifdef USE_UINPUT
if (mUseUInput) {
/*
* Check if the screen size changes, if so then update the
FakeMouse_Update(mScreenWidth, mScreenHeight);
}
}
+#endif
/*
* Before the DnD, we should make sure that the mouse is released
* 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);
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);