Skip to content

Commit

Permalink
Fixed regression in setting acceleration
Browse files Browse the repository at this point in the history
The regression was introduced in #645, probably because `Float` wasn't a member of `QVariant`. (Dear contributors, please don't include unrelated changes into a single PR!)

The patch fixes the problem by using`QMetaType::Type`. As Qt doc says, the return value of `QVariant::Type QVariant::type()` should be interpreted as `QMetaType::Type` (see https://doc.qt.io/qt-5/qvariant.html#type).

Fixes #676
  • Loading branch information
tsujan authored and Chih-Hsuan Yen committed Nov 11, 2020
1 parent 22f8760 commit 6dc047e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lxqt-config-input/touchpaddevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ static bool xi2_set_device_property(int deviceid, const char* prop, QList<QVaria

XFree(data);

auto dataType = values[0].type();
auto dataType = static_cast<QMetaType::Type>(values[0].type());
switch (dataType)
{
case QVariant::Int:
case QMetaType::Int:
Q_ASSERT(act_type == XA_INTEGER);

data = new unsigned char[values.size() * act_format / 8];
Expand All @@ -133,7 +133,7 @@ static bool xi2_set_device_property(int deviceid, const char* prop, QList<QVaria
}
}
break;
case QVariant::Double:
case QMetaType::Float:
Q_ASSERT(act_type == XInternAtom(dpy, "FLOAT", False));
Q_ASSERT(act_format == 32);
float_data = new float[values.size()];
Expand Down

0 comments on commit 6dc047e

Please sign in to comment.