Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/windowed/x11windowed_backend.cpp
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 118 | const uint32_t values[] = { | |||
---|---|---|---|---|---|
122 | XCB_EVENT_MASK_BUTTON_PRESS | | 122 | XCB_EVENT_MASK_BUTTON_PRESS | | ||
123 | XCB_EVENT_MASK_BUTTON_RELEASE | | 123 | XCB_EVENT_MASK_BUTTON_RELEASE | | ||
124 | XCB_EVENT_MASK_POINTER_MOTION | | 124 | XCB_EVENT_MASK_POINTER_MOTION | | ||
125 | XCB_EVENT_MASK_ENTER_WINDOW | | 125 | XCB_EVENT_MASK_ENTER_WINDOW | | ||
126 | XCB_EVENT_MASK_LEAVE_WINDOW | | 126 | XCB_EVENT_MASK_LEAVE_WINDOW | | ||
127 | XCB_EVENT_MASK_STRUCTURE_NOTIFY | | 127 | XCB_EVENT_MASK_STRUCTURE_NOTIFY | | ||
128 | XCB_EVENT_MASK_EXPOSURE | 128 | XCB_EVENT_MASK_EXPOSURE | ||
129 | }; | 129 | }; | ||
130 | o.size = initialWindowSize(); | 130 | o.scale = initialOutputScale(); | ||
131 | o.size = initialWindowSize() * o.scale; | ||||
131 | if (!m_windows.isEmpty()) { | 132 | if (!m_windows.isEmpty()) { | ||
132 | const auto &p = m_windows.last(); | 133 | const auto &p = m_windows.last(); | ||
133 | o.internalPosition = QPoint(p.internalPosition.x() + p.size.width(), 0); | 134 | o.internalPosition = QPoint(p.internalPosition.x() + p.size.width() / p.scale, 0); | ||
134 | } | 135 | } | ||
135 | xcb_create_window(m_connection, XCB_COPY_FROM_PARENT, o.window, m_screen->root, | 136 | xcb_create_window(m_connection, XCB_COPY_FROM_PARENT, o.window, m_screen->root, | ||
136 | 0, 0, o.size.width(), o.size.height(), | 137 | 0, 0, o.size.width(), o.size.height(), | ||
137 | 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, mask, values); | 138 | 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, mask, values); | ||
138 | 139 | | |||
139 | o.winInfo = new NETWinInfo(m_connection, o.window, m_screen->root, NET::WMWindowType, NET::Properties2()); | 140 | o.winInfo = new NETWinInfo(m_connection, o.window, m_screen->root, NET::WMWindowType, NET::Properties2()); | ||
140 | o.winInfo->setWindowType(NET::Normal); | 141 | o.winInfo->setWindowType(NET::Normal); | ||
141 | o.winInfo->setPid(QCoreApplication::applicationPid()); | 142 | o.winInfo->setPid(QCoreApplication::applicationPid()); | ||
▲ Show 20 Lines • Show All 241 Lines • ▼ Show 20 Line(s) | 383 | { | |||
383 | auto it = std::find_if(m_windows.begin(), m_windows.end(), [event] (const Output &o) { return o.window == event->window; }); | 384 | auto it = std::find_if(m_windows.begin(), m_windows.end(), [event] (const Output &o) { return o.window == event->window; }); | ||
384 | if (it == m_windows.end()) { | 385 | if (it == m_windows.end()) { | ||
385 | return; | 386 | return; | ||
386 | } | 387 | } | ||
387 | (*it).xPosition = QPoint(event->x, event->y); | 388 | (*it).xPosition = QPoint(event->x, event->y); | ||
388 | QSize s = QSize(event->width, event->height); | 389 | QSize s = QSize(event->width, event->height); | ||
389 | if (s != (*it).size) { | 390 | if (s != (*it).size) { | ||
390 | (*it).size = s; | 391 | (*it).size = s; | ||
391 | int x = (*it).internalPosition.x() + s.width(); | 392 | int x = (*it).internalPosition.x() + (*it).size.width() / (*it).scale; | ||
392 | it++; | 393 | it++; | ||
393 | for (; it != m_windows.end(); ++it) { | 394 | for (; it != m_windows.end(); ++it) { | ||
394 | (*it).internalPosition.setX(x); | 395 | (*it).internalPosition.setX(x); | ||
395 | x += (*it).size.width(); | 396 | x += (*it).size.width() / (*it).scale; | ||
396 | } | 397 | } | ||
397 | emit sizeChanged(); | 398 | emit sizeChanged(); | ||
398 | } | 399 | } | ||
399 | } | 400 | } | ||
400 | 401 | | |||
401 | void X11WindowedBackend::createCursor(const QImage &img, const QPoint &hotspot) | 402 | void X11WindowedBackend::createCursor(const QImage &img, const QPoint &hotspot) | ||
402 | { | 403 | { | ||
403 | const xcb_pixmap_t pix = xcb_generate_id(m_connection); | 404 | const xcb_pixmap_t pix = xcb_generate_id(m_connection); | ||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |