diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-01-16 10:39:42 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-01-17 10:55:28 +0000 |
commit | ce7fef539a3e8a155d1c821686479503164f5983 (patch) | |
tree | 77203332b0917ce76ba8e9a601fdddeb219ac5fa /src/client | |
parent | 061934bd54757cdac423571c2096eb405bcee297 (diff) |
Client: Implement xdg-output-unstable-v1 version 2
Adds handler for the new name event and updates tests accordingly.
This means QScreen::name() will now typically return strings like: "VGA-1",
"WL-1", "DP-2", "HDMI-A-1" instead of "Screen25", "Screen26", "Screen27" etc.
Change-Id: I3d5748a2fd0d772e2344ac53f0ed808790a84ba5
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 2 | ||||
-rw-r--r-- | src/client/qwaylandscreen.cpp | 5 | ||||
-rw-r--r-- | src/client/qwaylandscreen_p.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 91c1d4115..fc4241f82 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -278,7 +278,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin forceRoundTrip(); } } else if (interface == QLatin1String("zxdg_output_manager_v1")) { - mXdgOutputManager.reset(new QtWayland::zxdg_output_manager_v1(registry, id, 1)); + mXdgOutputManager.reset(new QtWayland::zxdg_output_manager_v1(registry, id, qMin(2, int(version)))); for (auto *screen : qAsConst(mScreens)) screen->initXdgOutput(xdgOutputManager()); forceRoundTrip(); diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index 38d61f88c..a6caae0da 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -292,6 +292,11 @@ void QWaylandScreen::zxdg_output_v1_done() QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), geometry()); } +void QWaylandScreen::zxdg_output_v1_name(const QString &name) +{ + mOutputName = name; } +} // namespace QtWaylandClient + QT_END_NAMESPACE diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index 6e4ed94f7..36009cce8 100644 --- a/src/client/qwaylandscreen_p.h +++ b/src/client/qwaylandscreen_p.h @@ -122,6 +122,7 @@ private: void zxdg_output_v1_logical_position(int32_t x, int32_t y) override; void zxdg_output_v1_logical_size(int32_t width, int32_t height) override; void zxdg_output_v1_done() override; + void zxdg_output_v1_name(const QString &name) override; int m_outputId; QWaylandDisplay *mWaylandDisplay = nullptr; |