qt: Raise minimum Xi2 version requirement to 2.1
This is needed for click-and-drag to work with both Qt5 and Qt6, especially the latter which was previously broken, without any hacks.
This commit is contained in:
@@ -75,15 +75,10 @@ RendererStack::RendererStack(QWidget *parent, int monitor_index)
|
|||||||
if (!mouse_type || (mouse_type[0] == '\0') || !stricmp(mouse_type, "auto")) {
|
if (!mouse_type || (mouse_type[0] == '\0') || !stricmp(mouse_type, "auto")) {
|
||||||
if (QApplication::platformName().contains("wayland"))
|
if (QApplication::platformName().contains("wayland"))
|
||||||
strcpy(auto_mouse_type, "wayland");
|
strcpy(auto_mouse_type, "wayland");
|
||||||
# if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
else if (QApplication::platformName() == "eglfs")
|
else if (QApplication::platformName() == "eglfs")
|
||||||
strcpy(auto_mouse_type, "evdev");
|
strcpy(auto_mouse_type, "evdev");
|
||||||
else if (QApplication::platformName() == "xcb")
|
else if (QApplication::platformName() == "xcb")
|
||||||
strcpy(auto_mouse_type, "xinput2");
|
strcpy(auto_mouse_type, "xinput2");
|
||||||
# else
|
|
||||||
else if (QApplication::platformName() == "eglfs" || QApplication::platformName() == "xcb")
|
|
||||||
strcpy(auto_mouse_type, "evdev");
|
|
||||||
# endif
|
|
||||||
else
|
else
|
||||||
auto_mouse_type[0] = '\0';
|
auto_mouse_type[0] = '\0';
|
||||||
mouse_type = auto_mouse_type;
|
mouse_type = auto_mouse_type;
|
||||||
|
@@ -81,8 +81,7 @@ void xinput2_proc()
|
|||||||
Window win;
|
Window win;
|
||||||
win = DefaultRootWindow(disp);
|
win = DefaultRootWindow(disp);
|
||||||
|
|
||||||
// XIAllMasterDevices doesn't work for click-and-drag operations.
|
ximask.deviceid = XIAllMasterDevices;
|
||||||
ximask.deviceid = XIAllDevices;
|
|
||||||
ximask.mask_len = XIMaskLen(XI_LASTEVENT);
|
ximask.mask_len = XIMaskLen(XI_LASTEVENT);
|
||||||
ximask.mask = (unsigned char*)calloc(ximask.mask_len, sizeof(unsigned char));
|
ximask.mask = (unsigned char*)calloc(ximask.mask_len, sizeof(unsigned char));
|
||||||
|
|
||||||
@@ -166,7 +165,7 @@ void xinput2_init()
|
|||||||
qWarning() << "Cannot open current X11 display";
|
qWarning() << "Cannot open current X11 display";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto event = 0, err = 0, minor = 0, major = 2;
|
auto event = 0, err = 0, minor = 1, major = 2;
|
||||||
if (XQueryExtension(disp, "XInputExtension", &xi2opcode, &event, &err))
|
if (XQueryExtension(disp, "XInputExtension", &xi2opcode, &event, &err))
|
||||||
{
|
{
|
||||||
if (XIQueryVersion(disp, &major, &minor) == Success)
|
if (XIQueryVersion(disp, &major, &minor) == Success)
|
||||||
|
Reference in New Issue
Block a user