11#include <QtGui/QGuiApplication>
13#include <qpa/qwindowsysteminterface.h>
14#include <qpa/qplatformwindow.h>
26 :
QtWayland::wl_output(waylandDisplay->wl_registry(),
id,
qMin(version, 3))
28 , mWaylandDisplay(waylandDisplay)
34 if (version < WL_OUTPUT_DONE_SINCE_VERSION) {
35 qCWarning(lcQpaWayland) <<
"wl_output done event not supported by compositor,"
36 <<
"QScreen may not work correctly";
45 if (zxdg_output_v1::isInitialized())
46 zxdg_output_v1::destroy();
47 if (wl_output::isInitialized() && wl_output::version() >= WL_OUTPUT_RELEASE_SINCE_VERSION)
77 if (zxdg_output_v1::isInitialized())
84 if (zxdg_output_v1::isInitialized())
87 zxdg_output_v1::init(xdgOutputManager->get_xdg_output(wl_output::object()));
107 if (zxdg_output_v1::isInitialized()) {
140 static int forceDpi =
qgetenv(
"QT_WAYLAND_FORCE_DPI").
toInt();
142 return QDpi(forceDpi, forceDpi);
203 if (
auto *
o = QtWayland::wl_output::fromObject(
output))
210 if (!(
flags & WL_OUTPUT_MODE_CURRENT))
250 if (zxdg_output_v1::isInitialized())
262 case WL_OUTPUT_TRANSFORM_NORMAL:
265 case WL_OUTPUT_TRANSFORM_90:
268 case WL_OUTPUT_TRANSFORM_180:
271 case WL_OUTPUT_TRANSFORM_270:
275 case WL_OUTPUT_TRANSFORM_FLIPPED:
276 case WL_OUTPUT_TRANSFORM_FLIPPED_90:
277 case WL_OUTPUT_TRANSFORM_FLIPPED_180:
278 case WL_OUTPUT_TRANSFORM_FLIPPED_270:
288 if (!zxdg_output_v1::isInitialized())
306 qWarning(lcQpaWayland) <<
"zxdg_output_v1.done received on version 3 or newer, this is most likely a bug in the compositor";
318 qWarning(lcQpaWayland) <<
"zxdg_output_v1.name received after output has been initialized, this is most likely a bug in the compositor";
326 Q_ASSERT(zxdg_output_v1::isInitialized());
int toInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an int using base base, which is ten by default.
Format
The following image formats are available in Qt.
qsizetype size() const noexcept
void reserve(qsizetype size)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr void moveTopLeft(const QPoint &p) noexcept
Moves the rectangle, leaving the top-left corner at the given position.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr void setSize(const QSize &s) noexcept
Sets the size of the rectangle to the given size.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QWaylandXdgOutputManagerV1()
Constructs a QWaylandXdgOutputManagerV1 object.
static void handleScreenGeometryChange(QScreen *screen, const QRect &newGeometry, const QRect &newAvailableGeometry)
static void handleScreenOrientationChange(QScreen *screen, Qt::ScreenOrientation newOrientation)
static void handleScreenRefreshRateChange(QScreen *screen, qreal newRefreshRate)
QPlatformPlaceholderScreen * placeholderScreen() const
void handleScreenInitialized(QWaylandScreen *screen)
QWaylandXdgOutputManagerV1 * xdgOutputManager() const
QList< QWaylandScreen * > screens() const
void zxdg_output_v1_name(const QString &name) override
void zxdg_output_v1_done() override
QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id)
void output_mode(uint32_t flags, int width, int height, int refresh) override
uint requiredEvents() const
qreal refreshRate() const override
Reimplement this function in subclass to return the vertical refresh rate of the screen,...
void output_geometry(int32_t x, int32_t y, int32_t width, int32_t height, int subpixel, const QString &make, const QString &model, int32_t transform) override
QString manufacturer() const override
Reimplement this function in subclass to return the manufacturer of this screen.
QWaylandDisplay * display() const
void initXdgOutput(QWaylandXdgOutputManagerV1 *xdgOutputManager)
void output_scale(int32_t factor) override
~QWaylandScreen() override
int depth() const override
Reimplement in subclass to return current depth of the screen.
void output_done() override
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
void updateOutputProperties()
QString model() const override
Reimplement this function in subclass to return the model of this screen.
QWaylandDisplay * mWaylandDisplay
void updateXdgOutputProperties()
QString name() const override
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
static QWaylandScreen * waylandScreenFromWindow(QWindow *window)
void zxdg_output_v1_logical_position(int32_t x, int32_t y) override
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the screen.
::wl_output * output() const override
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
static QWaylandScreen * fromWlOutput(::wl_output *output)
QList< QPlatformScreen * > virtualSiblings() const override
Returns a list of all the platform screens that are part of the same virtual desktop.
void zxdg_output_v1_logical_size(int32_t width, int32_t height) override
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
Qt::ScreenOrientation m_orientation
struct wl_display * display
Combined button and popup list for selecting options.
@ InvertedLandscapeOrientation
@ InvertedPortraitOrientation
QPair< qreal, qreal > QDpi
#define qCWarning(category,...)
constexpr const T & qMin(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLenum GLenum transform
#define QStringLiteral(str)
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QT_BEGIN_NAMESPACE typedef uchar * output
QSqlQueryModel * model
[16]