Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/windowed/x11windowed_output.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
49 | 49 | | |||
50 | void X11WindowedOutput::init(const QPoint &logicalPosition, const QSize &pixelSize) | 50 | void X11WindowedOutput::init(const QPoint &logicalPosition, const QSize &pixelSize) | ||
51 | { | 51 | { | ||
52 | KWayland::Server::OutputDeviceInterface::Mode mode; | 52 | KWayland::Server::OutputDeviceInterface::Mode mode; | ||
53 | mode.id = 0; | 53 | mode.id = 0; | ||
54 | mode.size = pixelSize; | 54 | mode.size = pixelSize; | ||
55 | mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; | 55 | mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; | ||
56 | mode.refreshRate = 60000; // TODO: get refresh rate via randr | 56 | mode.refreshRate = 60000; // TODO: get refresh rate via randr | ||
57 | | ||||
58 | // Physicial size must be adjusted, such that QPA calculates correct sizes of | ||||
59 | // internal elements. | ||||
60 | const QSize physicalSize = pixelSize / 96.0 * 25.4 / scale(); | ||||
57 | AbstractWaylandOutput::initWaylandOutputDevice("model_TODO", "manufacturer_TODO", | 61 | AbstractWaylandOutput::initWaylandOutputDevice("model_TODO", "manufacturer_TODO", | ||
58 | "UUID_TODO", { mode }); | 62 | "UUID_TODO", physicalSize, { mode }); | ||
59 | 63 | | |||
60 | setEnabled(true); | 64 | setEnabled(true); | ||
61 | setGeometry(logicalPosition, pixelSize); | 65 | setGeometry(logicalPosition, pixelSize); | ||
62 | setScale(m_backend->initialOutputScale()); | 66 | setScale(m_backend->initialOutputScale()); | ||
63 | 67 | | |||
64 | uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; | 68 | uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; | ||
65 | const uint32_t values[] = { | 69 | const uint32_t values[] = { | ||
66 | m_backend->screen()->black_pixel, | 70 | m_backend->screen()->black_pixel, | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | |||||
132 | #else | 136 | #else | ||
133 | Q_UNUSED(window) | 137 | Q_UNUSED(window) | ||
134 | #endif | 138 | #endif | ||
135 | } | 139 | } | ||
136 | 140 | | |||
137 | void X11WindowedOutput::setGeometry(const QPoint &logicalPosition, const QSize &pixelSize) | 141 | void X11WindowedOutput::setGeometry(const QPoint &logicalPosition, const QSize &pixelSize) | ||
138 | { | 142 | { | ||
139 | // TODO: set mode to have updated pixelSize | 143 | // TODO: set mode to have updated pixelSize | ||
140 | | ||||
141 | // Physicial size must be adjusted, such that QPA calculates correct sizes of | | |||
142 | // internal elements. | | |||
143 | setRawPhysicalSize(pixelSize / 96.0 * 25.4 / scale()); | | |||
144 | | ||||
145 | setGlobalPos(logicalPosition); | 144 | setGlobalPos(logicalPosition); | ||
146 | } | 145 | } | ||
147 | 146 | | |||
148 | void X11WindowedOutput::setWindowTitle(const QString &title) | 147 | void X11WindowedOutput::setWindowTitle(const QString &title) | ||
149 | { | 148 | { | ||
150 | m_winInfo->setName(title.toUtf8().constData()); | 149 | m_winInfo->setName(title.toUtf8().constData()); | ||
151 | } | 150 | } | ||
152 | 151 | | |||
Show All 11 Lines |