Include linux/input.h without performing any checks
Currently drag-and-drop doesn't work on FreeBSD because relevant input parts of kwayland-server are not compiled there. HAVE_LINUX_INPUT_H is set to 0 on FreeBSD because linux/input.h is in /usr/local/include and check_include_file() doesn't look there. Regardless of that, as FreeBSD developers pointed out, including linux/input.h is the recommended way to get input event codes so let's make it a hard dependency.
This commit is contained in:
parent
6cdf056047
commit
a711f90a69
4 changed files with 26 additions and 46 deletions
|
@ -23,19 +23,17 @@ ecm_mark_as_test(testWaylandSurface)
|
||||||
########################################################
|
########################################################
|
||||||
# Test WaylandSeat
|
# Test WaylandSeat
|
||||||
########################################################
|
########################################################
|
||||||
if (HAVE_LINUX_INPUT_H)
|
set( testWaylandSeat_SRCS
|
||||||
set( testWaylandSeat_SRCS
|
test_wayland_seat.cpp
|
||||||
test_wayland_seat.cpp
|
|
||||||
)
|
|
||||||
ecm_add_qtwayland_client_protocol(testWaylandSeat_SRCS
|
|
||||||
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml
|
|
||||||
BASENAME pointer-gestures-unstable-v1
|
|
||||||
)
|
)
|
||||||
add_executable(testWaylandSeat ${testWaylandSeat_SRCS})
|
ecm_add_qtwayland_client_protocol(testWaylandSeat_SRCS
|
||||||
target_link_libraries( testWaylandSeat Qt::Test Qt::Gui KF5::WaylandClient Plasma::KWaylandServer Wayland::Client Wayland::Server)
|
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml
|
||||||
add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat)
|
BASENAME pointer-gestures-unstable-v1
|
||||||
ecm_mark_as_test(testWaylandSeat)
|
)
|
||||||
endif()
|
add_executable(testWaylandSeat ${testWaylandSeat_SRCS})
|
||||||
|
target_link_libraries( testWaylandSeat Qt::Test Qt::Gui KF5::WaylandClient Plasma::KWaylandServer Wayland::Client Wayland::Server)
|
||||||
|
add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat)
|
||||||
|
ecm_mark_as_test(testWaylandSeat)
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
# Test ShmPool
|
# Test ShmPool
|
||||||
|
@ -183,15 +181,13 @@ ecm_mark_as_test(testShadow)
|
||||||
########################################################
|
########################################################
|
||||||
# Test FakeInput
|
# Test FakeInput
|
||||||
########################################################
|
########################################################
|
||||||
if (HAVE_LINUX_INPUT_H)
|
set( testFakeInput_SRCS
|
||||||
set( testFakeInput_SRCS
|
test_fake_input.cpp
|
||||||
test_fake_input.cpp
|
)
|
||||||
)
|
add_executable(testFakeInput ${testFakeInput_SRCS})
|
||||||
add_executable(testFakeInput ${testFakeInput_SRCS})
|
target_link_libraries( testFakeInput Qt::Test Qt::Gui KF5::WaylandClient Plasma::KWaylandServer)
|
||||||
target_link_libraries( testFakeInput Qt::Test Qt::Gui KF5::WaylandClient Plasma::KWaylandServer)
|
add_test(NAME kwayland-testFakeInput COMMAND testFakeInput)
|
||||||
add_test(NAME kwayland-testFakeInput COMMAND testFakeInput)
|
ecm_mark_as_test(testFakeInput)
|
||||||
ecm_mark_as_test(testFakeInput)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
# Test TextInputV2
|
# Test TextInputV2
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
#cmakedefine01 HAVE_LINUX_INPUT_H
|
|
|
@ -30,11 +30,8 @@
|
||||||
#include "textinput_v3_interface_p.h"
|
#include "textinput_v3_interface_p.h"
|
||||||
#include "touch_interface_p.h"
|
#include "touch_interface_p.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
// linux
|
|
||||||
#include <config-kwaylandserver.h>
|
|
||||||
#if HAVE_LINUX_INPUT_H
|
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
@ -631,7 +628,6 @@ PointerInterface *SeatInterface::pointer() const
|
||||||
|
|
||||||
static quint32 qtToWaylandButton(Qt::MouseButton button)
|
static quint32 qtToWaylandButton(Qt::MouseButton button)
|
||||||
{
|
{
|
||||||
#if HAVE_LINUX_INPUT_H
|
|
||||||
static const QHash<Qt::MouseButton, quint32> s_buttons({
|
static const QHash<Qt::MouseButton, quint32> s_buttons({
|
||||||
{Qt::LeftButton, BTN_LEFT},
|
{Qt::LeftButton, BTN_LEFT},
|
||||||
{Qt::RightButton, BTN_RIGHT},
|
{Qt::RightButton, BTN_RIGHT},
|
||||||
|
@ -652,10 +648,6 @@ static quint32 qtToWaylandButton(Qt::MouseButton button)
|
||||||
// further mapping not possible, 0x120 is BTN_JOYSTICK
|
// further mapping not possible, 0x120 is BTN_JOYSTICK
|
||||||
});
|
});
|
||||||
return s_buttons.value(button, 0);
|
return s_buttons.value(button, 0);
|
||||||
#else
|
|
||||||
Q_UNUSED(button)
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SeatInterface::isPointerButtonPressed(Qt::MouseButton button) const
|
bool SeatInterface::isPointerButtonPressed(Qt::MouseButton button) const
|
||||||
|
@ -1061,7 +1053,6 @@ void SeatInterface::notifyTouchDown(qint32 id, const QPointF &globalPosition)
|
||||||
d->globalTouch.focus.firstTouchPos = globalPosition;
|
d->globalTouch.focus.firstTouchPos = globalPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_LINUX_INPUT_H
|
|
||||||
if (id == 0 && hasPointer() && focusedTouchSurface()) {
|
if (id == 0 && hasPointer() && focusedTouchSurface()) {
|
||||||
TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.data());
|
TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.data());
|
||||||
if (touchPrivate->touchesForClient(focusedTouchSurface()->client()).isEmpty()) {
|
if (touchPrivate->touchesForClient(focusedTouchSurface()->client()).isEmpty()) {
|
||||||
|
@ -1072,7 +1063,6 @@ void SeatInterface::notifyTouchDown(qint32 id, const QPointF &globalPosition)
|
||||||
d->pointer->sendFrame();
|
d->pointer->sendFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
d->globalTouch.ids[id] = serial;
|
d->globalTouch.ids[id] = serial;
|
||||||
}
|
}
|
||||||
|
@ -1119,7 +1109,6 @@ void SeatInterface::notifyTouchUp(qint32 id)
|
||||||
}
|
}
|
||||||
d->touch->sendUp(id, serial);
|
d->touch->sendUp(id, serial);
|
||||||
|
|
||||||
#if HAVE_LINUX_INPUT_H
|
|
||||||
if (id == 0 && hasPointer() && focusedTouchSurface()) {
|
if (id == 0 && hasPointer() && focusedTouchSurface()) {
|
||||||
TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.data());
|
TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.data());
|
||||||
if (touchPrivate->touchesForClient(focusedTouchSurface()->client()).isEmpty()) {
|
if (touchPrivate->touchesForClient(focusedTouchSurface()->client()).isEmpty()) {
|
||||||
|
@ -1129,7 +1118,6 @@ void SeatInterface::notifyTouchUp(qint32 id)
|
||||||
d->pointer->sendFrame();
|
d->pointer->sendFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
d->globalTouch.ids.remove(id);
|
d->globalTouch.ids.remove(id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,19 +27,16 @@ add_executable(pasteClient pasteclient.cpp)
|
||||||
target_link_libraries(pasteClient Qt::Concurrent KF5::WaylandClient)
|
target_link_libraries(pasteClient Qt::Concurrent KF5::WaylandClient)
|
||||||
ecm_mark_as_test(pasteClient)
|
ecm_mark_as_test(pasteClient)
|
||||||
|
|
||||||
if (HAVE_LINUX_INPUT_H)
|
add_executable(touchClientTest touchclienttest.cpp)
|
||||||
add_executable(touchClientTest touchclienttest.cpp)
|
target_link_libraries(touchClientTest KF5::WaylandClient)
|
||||||
target_link_libraries(touchClientTest KF5::WaylandClient)
|
|
||||||
|
|
||||||
|
add_executable(panelTest paneltest.cpp)
|
||||||
|
target_link_libraries(panelTest KF5::WaylandClient)
|
||||||
|
ecm_mark_as_test(panelTest)
|
||||||
|
|
||||||
add_executable(panelTest paneltest.cpp)
|
add_executable(subsurface-test subsurfacetest.cpp)
|
||||||
target_link_libraries(panelTest KF5::WaylandClient)
|
target_link_libraries(subsurface-test Qt::Core Qt::Gui KF5::WaylandClient)
|
||||||
ecm_mark_as_test(panelTest)
|
ecm_mark_as_test(subsurface-test)
|
||||||
|
|
||||||
add_executable(subsurface-test subsurfacetest.cpp)
|
|
||||||
target_link_libraries(subsurface-test Qt::Core Qt::Gui KF5::WaylandClient)
|
|
||||||
ecm_mark_as_test(subsurface-test)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_executable(shadowTest shadowtest.cpp)
|
add_executable(shadowTest shadowtest.cpp)
|
||||||
target_link_libraries(shadowTest KF5::WaylandClient)
|
target_link_libraries(shadowTest KF5::WaylandClient)
|
||||||
|
|
Loading…
Reference in a new issue