2506f0e78a
KWayland provides a FakeInput interface which KWin as a compositor supports. This can be used to fake input events on Wayland. As it's a KWin specific interface it won't work with other Wayland compositors. If the compositor does not support the required interface, the module just doesn't do anything. Support in the implementation is completely optional. Adding fake input events circumvents the Wayland security model. Because of that the interface is designed in a way that the security decision can be done by the compositor and can be delegated to the user. On first input event kdeconnect tries to "authenticate" with the compositor. This gives the compositor the possibility to e.g. ask the user whether it should be allowed. It's not done on startup or of load module as that would show such a message way to early and the user would not be able to connect it with his action on the smartphone. REVIEW: 124238
22 lines
778 B
CMake
22 lines
778 B
CMake
set(kdeconnect_mousepad_SRCS
|
|
mousepadplugin.cpp
|
|
)
|
|
|
|
find_package(XTest REQUIRED)
|
|
find_package(X11 REQUIRED)
|
|
find_package(LibFakeKey REQUIRED)
|
|
find_package(Qt5X11Extras REQUIRED)
|
|
find_package(KF5Wayland)
|
|
|
|
set(HAVE_WAYLAND ${KF5Wayland_FOUND})
|
|
configure_file(config-mousepad.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-mousepad.h )
|
|
|
|
kdeconnect_add_plugin(kdeconnect_mousepad JSON kdeconnect_mousepad.json SOURCES ${kdeconnect_mousepad_SRCS})
|
|
|
|
include_directories(${XTEST_INCLUDE_DIRS} ${X11_INCLUDE_DIR} ${LibFakeKey_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(kdeconnect_mousepad kdeconnectcore Qt5::Gui Qt5::X11Extras ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES} KF5::I18n)
|
|
|
|
if(HAVE_WAYLAND)
|
|
target_link_libraries(kdeconnect_mousepad KF5::WaylandClient)
|
|
endif()
|