Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: src/compositor/wayland_wrapper/qwloutput.cpp Change-Id: I05f7431aca46760f90632dfa7ef9c4d0abf392ec
This commit is contained in:
commit
b18f9ef9b3
@ -8,6 +8,8 @@ MODULE_PLUGIN_TYPES = \
|
|||||||
wayland-inputdevice-integration \
|
wayland-inputdevice-integration \
|
||||||
wayland-decoration-client
|
wayland-decoration-client
|
||||||
|
|
||||||
|
CONFIG += generated_privates
|
||||||
|
|
||||||
load(qt_module)
|
load(qt_module)
|
||||||
|
|
||||||
# We have a bunch of C code with casts, so we can't have this option
|
# We have a bunch of C code with casts, so we can't have this option
|
||||||
|
@ -237,6 +237,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
|
|||||||
mScreens.append(screen);
|
mScreens.append(screen);
|
||||||
// We need to get the output events before creating surfaces
|
// We need to get the output events before creating surfaces
|
||||||
forceRoundTrip();
|
forceRoundTrip();
|
||||||
|
screen->init();
|
||||||
mWaylandIntegration->screenAdded(screen);
|
mWaylandIntegration->screenAdded(screen);
|
||||||
} else if (interface == QStringLiteral("wl_compositor")) {
|
} else if (interface == QStringLiteral("wl_compositor")) {
|
||||||
mCompositorVersion = qMin((int)version, 3);
|
mCompositorVersion = qMin((int)version, 3);
|
||||||
@ -369,6 +370,11 @@ bool QWaylandDisplay::supportsWindowDecoration() const
|
|||||||
return integrationSupport;
|
return integrationSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWaylandWindow *QWaylandDisplay::lastInputWindow() const
|
||||||
|
{
|
||||||
|
return mLastInputWindow.data();
|
||||||
|
}
|
||||||
|
|
||||||
void QWaylandDisplay::setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *win)
|
void QWaylandDisplay::setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *win)
|
||||||
{
|
{
|
||||||
mLastInputDevice = device;
|
mLastInputDevice = device;
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QRect>
|
#include <QtCore/QRect>
|
||||||
|
#include <QtCore/QPointer>
|
||||||
|
|
||||||
#include <QtCore/QWaitCondition>
|
#include <QtCore/QWaitCondition>
|
||||||
|
|
||||||
@ -156,7 +157,7 @@ public:
|
|||||||
|
|
||||||
uint32_t lastInputSerial() const { return mLastInputSerial; }
|
uint32_t lastInputSerial() const { return mLastInputSerial; }
|
||||||
QWaylandInputDevice *lastInputDevice() const { return mLastInputDevice; }
|
QWaylandInputDevice *lastInputDevice() const { return mLastInputDevice; }
|
||||||
QWaylandWindow *lastInputWindow() const { return mLastInputWindow; }
|
QWaylandWindow *lastInputWindow() const;
|
||||||
void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window);
|
void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -200,7 +201,7 @@ private:
|
|||||||
int mCompositorVersion;
|
int mCompositorVersion;
|
||||||
uint32_t mLastInputSerial;
|
uint32_t mLastInputSerial;
|
||||||
QWaylandInputDevice *mLastInputDevice;
|
QWaylandInputDevice *mLastInputDevice;
|
||||||
QWaylandWindow *mLastInputWindow;
|
QPointer<QWaylandWindow> mLastInputWindow;
|
||||||
|
|
||||||
void registry_global(uint32_t id, const QString &interface, uint32_t version) Q_DECL_OVERRIDE;
|
void registry_global(uint32_t id, const QString &interface, uint32_t version) Q_DECL_OVERRIDE;
|
||||||
void registry_global_remove(uint32_t id) Q_DECL_OVERRIDE;
|
void registry_global_remove(uint32_t id) Q_DECL_OVERRIDE;
|
||||||
|
@ -118,6 +118,10 @@ QWaylandInputDevice::Keyboard::~Keyboard()
|
|||||||
#ifndef QT_NO_WAYLAND_XKB
|
#ifndef QT_NO_WAYLAND_XKB
|
||||||
releaseKeyMap();
|
releaseKeyMap();
|
||||||
#endif
|
#endif
|
||||||
|
if (mFocus)
|
||||||
|
QWindowSystemInterface::handleWindowActivated(0);
|
||||||
|
if (mFocusCallback)
|
||||||
|
wl_callback_destroy(mFocusCallback);
|
||||||
if (mParent->mVersion >= 3)
|
if (mParent->mVersion >= 3)
|
||||||
wl_keyboard_release(object());
|
wl_keyboard_release(object());
|
||||||
else
|
else
|
||||||
@ -295,17 +299,18 @@ Qt::KeyboardModifiers QWaylandInputDevice::Keyboard::modifiers() const
|
|||||||
Qt::KeyboardModifiers ret = Qt::NoModifier;
|
Qt::KeyboardModifiers ret = Qt::NoModifier;
|
||||||
|
|
||||||
#ifndef QT_NO_WAYLAND_XKB
|
#ifndef QT_NO_WAYLAND_XKB
|
||||||
|
if (!mXkbState)
|
||||||
|
return ret;
|
||||||
|
|
||||||
xkb_state_component cstate = static_cast<xkb_state_component>(XKB_STATE_DEPRESSED | XKB_STATE_LATCHED);
|
xkb_state_component cstate = static_cast<xkb_state_component>(XKB_STATE_DEPRESSED | XKB_STATE_LATCHED);
|
||||||
|
|
||||||
if (xkb_state_mod_name_is_active(mXkbState, "Shift", cstate))
|
if (xkb_state_mod_name_is_active(mXkbState, XKB_MOD_NAME_SHIFT, cstate))
|
||||||
ret |= Qt::ShiftModifier;
|
ret |= Qt::ShiftModifier;
|
||||||
if (xkb_state_mod_name_is_active(mXkbState, "Control", cstate))
|
if (xkb_state_mod_name_is_active(mXkbState, XKB_MOD_NAME_CTRL, cstate))
|
||||||
ret |= Qt::ControlModifier;
|
ret |= Qt::ControlModifier;
|
||||||
if (xkb_state_mod_name_is_active(mXkbState, "Alt", cstate))
|
if (xkb_state_mod_name_is_active(mXkbState, XKB_MOD_NAME_ALT, cstate))
|
||||||
ret |= Qt::AltModifier;
|
ret |= Qt::AltModifier;
|
||||||
if (xkb_state_mod_name_is_active(mXkbState, "Mod1", cstate))
|
if (xkb_state_mod_name_is_active(mXkbState, XKB_MOD_NAME_LOGO, cstate))
|
||||||
ret |= Qt::AltModifier;
|
|
||||||
if (xkb_state_mod_name_is_active(mXkbState, "Mod4", cstate))
|
|
||||||
ret |= Qt::MetaModifier;
|
ret |= Qt::MetaModifier;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -592,13 +597,30 @@ static const uint32_t KeyTbl[] = {
|
|||||||
XKB_KEY_Mode_switch, Qt::Key_Mode_switch,
|
XKB_KEY_Mode_switch, Qt::Key_Mode_switch,
|
||||||
XKB_KEY_script_switch, Qt::Key_Mode_switch,
|
XKB_KEY_script_switch, Qt::Key_Mode_switch,
|
||||||
|
|
||||||
|
XKB_KEY_XF86Back, Qt::Key_Back,
|
||||||
|
XKB_KEY_XF86Forward, Qt::Key_Forward,
|
||||||
|
|
||||||
XKB_KEY_XF86AudioPlay, Qt::Key_MediaTogglePlayPause, //there isn't a PlayPause keysym, however just play keys are not common
|
XKB_KEY_XF86AudioPlay, Qt::Key_MediaTogglePlayPause, //there isn't a PlayPause keysym, however just play keys are not common
|
||||||
XKB_KEY_XF86AudioPause, Qt::Key_MediaPause,
|
XKB_KEY_XF86AudioPause, Qt::Key_MediaPause,
|
||||||
XKB_KEY_XF86AudioStop, Qt::Key_MediaStop,
|
XKB_KEY_XF86AudioStop, Qt::Key_MediaStop,
|
||||||
XKB_KEY_XF86AudioPrev, Qt::Key_MediaPrevious,
|
XKB_KEY_XF86AudioPrev, Qt::Key_MediaPrevious,
|
||||||
XKB_KEY_XF86AudioNext, Qt::Key_MediaNext,
|
XKB_KEY_XF86AudioNext, Qt::Key_MediaNext,
|
||||||
|
XKB_KEY_XF86AudioRewind, Qt::Key_MediaPrevious,
|
||||||
|
XKB_KEY_XF86AudioForward, Qt::Key_MediaNext,
|
||||||
XKB_KEY_XF86AudioRecord, Qt::Key_MediaRecord,
|
XKB_KEY_XF86AudioRecord, Qt::Key_MediaRecord,
|
||||||
|
|
||||||
|
XKB_KEY_XF86AudioMute, Qt::Key_VolumeMute,
|
||||||
|
XKB_KEY_XF86AudioLowerVolume, Qt::Key_VolumeDown,
|
||||||
|
XKB_KEY_XF86AudioRaiseVolume, Qt::Key_VolumeUp,
|
||||||
|
|
||||||
|
XKB_KEY_XF86AudioRandomPlay, Qt::Key_AudioRandomPlay,
|
||||||
|
XKB_KEY_XF86AudioRepeat, Qt::Key_AudioRepeat,
|
||||||
|
|
||||||
|
XKB_KEY_XF86ZoomIn, Qt::Key_ZoomIn,
|
||||||
|
XKB_KEY_XF86ZoomOut, Qt::Key_ZoomOut,
|
||||||
|
|
||||||
|
XKB_KEY_XF86Eject, Qt::Key_Eject,
|
||||||
|
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -759,7 +781,6 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const xkb_keysym_t sym = xkb_state_key_get_one_sym(mXkbState, code);
|
const xkb_keysym_t sym = xkb_state_key_get_one_sym(mXkbState, code);
|
||||||
xkb_state_update_key(mXkbState, code, isDown ? XKB_KEY_DOWN : XKB_KEY_UP);
|
|
||||||
|
|
||||||
Qt::KeyboardModifiers modifiers = mParent->modifiers();
|
Qt::KeyboardModifiers modifiers = mParent->modifiers();
|
||||||
|
|
||||||
|
@ -226,6 +226,13 @@ QVariant QWaylandIntegration::styleHint(StyleHint hint) const
|
|||||||
if (hint == ShowIsFullScreen && mDisplay->windowManagerIntegration())
|
if (hint == ShowIsFullScreen && mDisplay->windowManagerIntegration())
|
||||||
return mDisplay->windowManagerIntegration()->showIsFullScreen();
|
return mDisplay->windowManagerIntegration()->showIsFullScreen();
|
||||||
|
|
||||||
|
switch (hint) {
|
||||||
|
case QPlatformIntegration::FontSmoothingGamma:
|
||||||
|
return qreal(1.0);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return QPlatformIntegration::styleHint(hint);
|
return QPlatformIntegration::styleHint(hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin
|
|||||||
, mFormat(QImage::Format_ARGB32_Premultiplied)
|
, mFormat(QImage::Format_ARGB32_Premultiplied)
|
||||||
, mOutputName(QStringLiteral("Screen%1").arg(id))
|
, mOutputName(QStringLiteral("Screen%1").arg(id))
|
||||||
, m_orientation(Qt::PrimaryOrientation)
|
, m_orientation(Qt::PrimaryOrientation)
|
||||||
, mWaylandCursor(new QWaylandCursor(this))
|
, mWaylandCursor(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +67,11 @@ QWaylandScreen::~QWaylandScreen()
|
|||||||
delete mWaylandCursor;
|
delete mWaylandCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QWaylandScreen::init()
|
||||||
|
{
|
||||||
|
mWaylandCursor = new QWaylandCursor(this);
|
||||||
|
}
|
||||||
|
|
||||||
QWaylandDisplay * QWaylandScreen::display() const
|
QWaylandDisplay * QWaylandScreen::display() const
|
||||||
{
|
{
|
||||||
return mWaylandDisplay;
|
return mWaylandDisplay;
|
||||||
|
@ -52,6 +52,7 @@ public:
|
|||||||
QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id);
|
QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id);
|
||||||
~QWaylandScreen();
|
~QWaylandScreen();
|
||||||
|
|
||||||
|
void init();
|
||||||
QWaylandDisplay *display() const;
|
QWaylandDisplay *display() const;
|
||||||
|
|
||||||
QRect geometry() const;
|
QRect geometry() const;
|
||||||
|
@ -88,6 +88,7 @@ struct WaylandArgument {
|
|||||||
struct WaylandEvent {
|
struct WaylandEvent {
|
||||||
bool request;
|
bool request;
|
||||||
QByteArray name;
|
QByteArray name;
|
||||||
|
QByteArray type;
|
||||||
QList<WaylandArgument> arguments;
|
QList<WaylandArgument> arguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -124,6 +125,7 @@ WaylandEvent readEvent(QXmlStreamReader &xml, bool request)
|
|||||||
WaylandEvent event;
|
WaylandEvent event;
|
||||||
event.request = request;
|
event.request = request;
|
||||||
event.name = byteArrayValue(xml, "name");
|
event.name = byteArrayValue(xml, "name");
|
||||||
|
event.type = byteArrayValue(xml, "type");
|
||||||
while (xml.readNextStartElement()) {
|
while (xml.readNextStartElement()) {
|
||||||
if (xml.name() == "arg") {
|
if (xml.name() == "arg") {
|
||||||
WaylandArgument argument;
|
WaylandArgument argument;
|
||||||
@ -998,6 +1000,8 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf(");\n");
|
printf(");\n");
|
||||||
|
if (e.type == "destructor")
|
||||||
|
printf(" m_%s = 0;\n", interfaceName);
|
||||||
printf(" }\n");
|
printf(" }\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user