diff --git a/src/3rdparty/wayland/protocols/xdg-output/xdg-output-unstable-v1.xml b/src/3rdparty/wayland/protocols/xdg-output/xdg-output-unstable-v1.xml index fe3a70aab0d..a7306e4193e 100644 --- a/src/3rdparty/wayland/protocols/xdg-output/xdg-output-unstable-v1.xml +++ b/src/3rdparty/wayland/protocols/xdg-output/xdg-output-unstable-v1.xml @@ -35,12 +35,12 @@ Typically, the global compositor space on a desktop system is made of a contiguous or overlapping set of rectangular regions. - Some of the information provided in this protocol might be identical - to their counterparts already available from wl_output, in which case - the information provided by this protocol should be preferred to their - equivalent in wl_output. The goal is to move the desktop specific - concepts (such as output location within the global compositor space, - the connector name and types, etc.) out of the core wl_output protocol. + The logical_position and logical_size events defined in this protocol + might provide information identical to their counterparts already + available from wl_output, in which case the information provided by this + protocol should be preferred to their equivalent in wl_output. The goal is + to move the desktop specific concepts (such as output location within the + global compositor space, etc.) out of the core wl_output protocol. Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible @@ -117,10 +117,6 @@ The logical_size event describes the size of the output in the global compositor space. - For example, a surface without any buffer scale, transformation - nor rotation set, with the size matching the logical_size will - have the same size as the corresponding output when displayed. - Most regular Wayland clients should not pay attention to the logical size and would rather rely on xdg_shell interfaces. @@ -131,14 +127,14 @@ For example, for a wl_output mode 3840×2160 and a scale factor 2: - - A compositor not scaling the surface buffers will advertise a - logical size of 3840×2160, + - A compositor not scaling the monitor viewport in its compositing space + will advertise a logical size of 3840×2160, - - A compositor automatically scaling the surface buffers will + - A compositor scaling the monitor viewport with scale factor 2 will advertise a logical size of 1920×1080, - - A compositor using a fractional scale of 1.5 will advertise a - logical size to 2560×1620. + - A compositor scaling the monitor viewport using a fractional scale of + 1.5 will advertise a logical size of 2560×1440. For example, for a wl_output mode 1920×1080 and a 90 degree rotation, the compositor will advertise a logical size of 1080x1920. @@ -155,7 +151,7 @@ summary="height in global compositor space"/> - + This event is sent after all other properties of an xdg_output have been sent. @@ -191,6 +187,9 @@ xdg_output_manager.get_xdg_output). This event is only sent once per xdg_output, and the name does not change over the lifetime of the wl_output global. + + This event is deprecated, instead clients should use wl_output.name. + Compositors must still support this event. @@ -212,6 +211,9 @@ For objects of version 2 and lower, this event is only sent once per xdg_output, and the description does not change over the lifetime of the wl_output global. + + This event is deprecated, instead clients should use + wl_output.description. Compositors must still support this event. diff --git a/src/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland/qwaylandscreen.cpp index e902ff27cc8..1cd3591083a 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen.cpp +++ b/src/plugins/platforms/wayland/qwaylandscreen.cpp @@ -60,9 +60,10 @@ uint QWaylandScreen::requiredEvents() const uint ret = OutputDoneEvent; if (mWaylandDisplay->xdgOutputManager()) { - if (mWaylandDisplay->xdgOutputManager()->version() >= 2) + if (mWaylandDisplay->xdgOutputManager()->version() >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) ret |= XdgOutputNameEvent; + // For objects version 3 onwards, zxdg_output_v1.done is deprecated. if (mWaylandDisplay->xdgOutputManager()->version() < 3) ret |= XdgOutputDoneEvent; } @@ -387,12 +388,23 @@ void QWaylandScreen::zxdg_output_v1_name(const QString &name) if (Q_UNLIKELY(mInitialized)) qCWarning(lcQpaWayland) << "zxdg_output_v1.name received after output has been initialized, this is most likely a bug in the compositor"; - mOutputName = name; + if (Q_UNLIKELY(mProcessedEvents & XdgOutputNameEvent)) { + qCWarning(lcQpaWayland) << "zxdg_output_v1.name received more than once, this is most likely a bug in the compositor"; + return; + } + + // This event is deprecated, instead clients should use wl_output.name. + if (!(mProcessedEvents & OutputNameEvent)) { + if (!name.isEmpty()) + mOutputName = name; + } + mProcessedEvents |= XdgOutputNameEvent; } void QWaylandScreen::updateXdgOutputProperties() { + Q_ASSERT(mInitialized); Q_ASSERT(zxdg_output_v1::isInitialized()); QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), geometry()); }