10#include <QtGui/QRegion>
11#include <QtGui/private/qhighdpiscaling_p.h>
16#if QT_CONFIG(draganddrop)
26#include <qpa/qplatformintegration.h>
27#include <qpa/qplatformcursor.h>
31#include <xcb/xcb_icccm.h>
32#include <xcb/xfixes.h>
34#include <xcb/xinput.h>
36#include <private/qguiapplication_p.h>
37#include <private/qwindow_p.h>
39#include <qpa/qplatformbackingstore.h>
40#include <qpa/qwindowsysteminterface.h>
44#if QT_CONFIG(xcb_xlib)
51#define XCOORD_MAX 32767
130 qWarning(
"Using RGB32 fallback, if this works your X11 server is reporting a bad screen format.");
134 qWarning(
"Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.");
141#if QT_CONFIG(xcb_xlib)
142static inline XTextProperty* qstringToXTP(
Display *dpy,
const QString&
s)
144 #include <X11/Xatom.h>
146 static XTextProperty tp = {
nullptr, 0, 0, 0 };
147 static bool free_prop =
true;
161 errCode = XmbTextListToTextProperty(dpy, tl, 1, XStdICCTextStyle, &tp);
163 qCDebug(lcQpaXcb,
"XmbTextListToTextProperty result code %d", errCode);
169 tp.encoding = XA_STRING;
171 tp.nitems = qcs.
size();
182 if (
obj->isWindowType()) {
184 if (childWin->isVisible()) {
190 if (!
win->isTopLevel()
209 = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY
210 | XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_FOCUS_CHANGE,
213 | XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE
214 | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE
215 | XCB_EVENT_MASK_BUTTON_MOTION | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW
216 | XCB_EVENT_MASK_POINTER_MOTION,
219 | XCB_EVENT_MASK_VISIBILITY_CHANGE
220 | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT
221 | XCB_EVENT_MASK_COLOR_MAP_CHANGE | XCB_EVENT_MASK_OWNER_GRAB_BUTTON
243 const xcb_visualtype_t *visual =
nullptr;
249 qWarning(
"Could not use default visual id. Falling back to root_visual for screen.");
259 if (
rect.width() > 0 ||
rect.height() > 0) {
262 }
else if (minimumSize.
width() > 0 || minimumSize.
height() > 0) {
263 rect.setSize(minimumSize);
271 if (platformScreen != currentScreen)
274 xcb_window_t xcb_parent_id = platformScreen->
root();
281 window()->setFormat(parentFormat);
287 const xcb_visualtype_t *visual =
nullptr;
291 }
else if (
connection()->hasDefaultVisualId()) {
294 qWarning() <<
"Failed to use requested visual id.";
314 qWarning() <<
"Falling back to using screens root_visual.";
325 | XCB_CW_BORDER_PIXEL
327 | XCB_CW_OVERRIDE_REDIRECT
333 XCB_BACK_PIXMAP_NONE,
334 platformScreen->
screen()->black_pixel,
335 XCB_GRAVITY_NORTH_WEST,
352 XCB_WINDOW_CLASS_INPUT_OUTPUT,
362 int propertyCount = 0;
374 XCB_PROP_MODE_REPLACE,
396 XCB_PROP_MODE_REPLACE,
412 if (!clientMachine.
isEmpty()) {
420 xcb_icccm_wm_hints_t hints;
421 memset(&hints, 0,
sizeof(hints));
422 hints.flags = XCB_ICCCM_WM_HINT_WINDOW_GROUP;
436 32, 2, (
void *)
data);
448#if QT_CONFIG(draganddrop)
458 if (
window()->isTopLevel())
530 if (newScreen != currentScreen)
534 const quint32 mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
541 const quint32 mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
569 if (
reply &&
reply->type == XCB_ATOM_CARDINAL &&
reply->format == 32 &&
reply->value_len == 4) {
583 bool foundRoot =
false;
623 int top =
offset.y() + geom->border_width;
646 if (
window()->isTopLevel()) {
657 xcb_window_t transientXcbParent = 0;
660 if (tp && tp->handle())
661 transientXcbParent = tp->handle()->
winId();
664 if (!transientXcbParent)
666 if (transientXcbParent) {
668 XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32,
669 1, &transientXcbParent);
672 if (!transientXcbParent)
680 const auto showWithoutActivating =
window()->
property(
"_q_showWithoutActivating");
681 if (showWithoutActivating.isValid() && showWithoutActivating.toBool())
705 event.response_type = XCB_UNMAP_NOTIFY;
708 event.from_configure =
false;
710 XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (
const char *)&
event);
731 if (
window()->isModal()) {
738 QWindow *enterWindow =
nullptr;
748 if (enterWindow && enterWindow !=
window()) {
751 enterWindow = childWindow;
752 const QPoint localPos = enterWindow->mapFromGlobal(cursorPos);
764 while (
w &&
w->parent())
767 QWindow *modalWindow =
nullptr;
769 if (blocked && modalWindow !=
w) {
770 modalWindow->requestActivate();
828 XCB_ATOM_ATOM, 0, 1024);
831 const xcb_atom_t *
states =
static_cast<const xcb_atom_t *
>(xcb_get_property_value(
reply.get()));
832 const xcb_atom_t *statesEnd =
states +
reply->length;
873 const quint32 mask = XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK;
902 memset(&mwmhints, 0,
sizeof(mwmhints));
910 if (!(
flags & defaultFlags))
911 flags |= defaultFlags;
960 if (mwmhints.
flags) {
962 XCB_PROP_MODE_REPLACE,
976 xcb_client_message_event_t
event;
978 event.response_type = XCB_CLIENT_MESSAGE;
983 event.data.data32[0] =
set ? 1 : 0;
984 event.data.data32[1] = one;
985 event.data.data32[2] = two;
986 event.data.data32[3] = 0;
987 event.data.data32[4] = 0;
990 XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
991 (
const char *)&
event);
1053 XCB_ATOM_ATOM, 0, 1024);
1055 const xcb_atom_t *
data =
static_cast<const xcb_atom_t *
>(xcb_get_property_value(
reply.get()));
1057 memcpy((
void *)&atoms.
first(), (
void *)
data,
reply->value_len *
sizeof(xcb_atom_t));
1107 xcb_client_message_event_t
event;
1109 event.response_type = XCB_CLIENT_MESSAGE;
1114 event.data.data32[0] = XCB_ICCCM_WM_STATE_ICONIC;
1115 event.data.data32[1] = 0;
1116 event.data.data32[2] = 0;
1117 event.data.data32[3] = 0;
1118 event.data.data32[4] = 0;
1121 XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
1122 (
const char *)&
event);
1136 xcb_icccm_wm_hints_t hints;
1137 if (xcb_icccm_get_wm_hints_reply(
xcb_connection(), cookie, &hints,
nullptr)) {
1139 xcb_icccm_wm_hints_set_iconic(&hints);
1141 xcb_icccm_wm_hints_set_normal(&hints);
1163 XCB_COPY_FROM_PARENT,
1168 XCB_WINDOW_CLASS_INPUT_OUTPUT,
1180 }
else if (!isSupportedByWM) {
1191 XCB_ATOM_CARDINAL, 32, 1, ×tamp);
1199 xcb_rectangle_t rectangle;
1201 xcb_rectangle_t *
rect =
nullptr;
1215 xcb_xfixes_set_window_shape_region_checked(
xcb_connection(),
m_window, XCB_SHAPE_SK_INPUT, 0, 0, region);
1225 xcb_icccm_wm_hints_t hints;
1226 if (!xcb_icccm_get_wm_hints_reply(
xcb_connection(), cookie, &hints,
nullptr))
1229 xcb_icccm_wm_hints_set_input(&hints, !doesNotAcceptFocus);
1242 xcb_window_t xcb_parent_id;
1263 XCB_PROP_MODE_REPLACE,
1277 if (availableSizes.
isEmpty()) {
1284 for (
int i = 0;
i < availableSizes.
size(); ++
i) {
1301 qWarning() <<
"Ignoring window icon" << icon_data.
size()
1302 <<
"exceeds maximum xcb request length"
1307 XCB_PROP_MODE_REPLACE,
1313 (
unsigned char *) icon_data.
data());
1323 const quint32 mask = XCB_CONFIG_WINDOW_STACK_MODE;
1330 const quint32 mask = XCB_CONFIG_WINDOW_STACK_MODE;
1338 xcb_size_hints_t hints;
1339 memset(&hints, 0,
sizeof(hints));
1344 if (!
win->positionAutomatic)
1345 xcb_icccm_size_hints_set_position(&hints,
true,
rect.x(),
rect.y());
1347 xcb_icccm_size_hints_set_size(&hints,
true,
rect.width(),
rect.height());
1354 ? XCB_GRAVITY_NORTH_WEST : XCB_GRAVITY_STATIC;
1356 xcb_icccm_size_hints_set_win_gravity(&hints, gravity);
1363 if (minimumSize.
width() > 0 || minimumSize.
height() > 0)
1364 xcb_icccm_size_hints_set_min_size(&hints,
1369 xcb_icccm_size_hints_set_max_size(&hints,
1373 if (sizeIncrement.
width() > 0 || sizeIncrement.
height() > 0) {
1374 xcb_icccm_size_hints_set_base_size(&hints, baseSize.
width(), baseSize.
height());
1375 xcb_icccm_size_hints_set_resize_inc(&hints, sizeIncrement.
width(), sizeIncrement.
height());
1401 if (
window()->isTopLevel()
1405 xcb_client_message_event_t
event;
1407 event.response_type = XCB_CLIENT_MESSAGE;
1412 event.data.data32[0] = 1;
1414 event.data.data32[2] = focusWindow ? focusWindow->winId() : XCB_NONE;
1415 event.data.data32[3] = 0;
1416 event.data.data32[4] = 0;
1419 XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
1420 (
const char *)&
event);
1439 XCB_ATOM_ATOM, 0, 1024);
1441 const xcb_atom_t *
types =
static_cast<const xcb_atom_t *
>(xcb_get_property_value(
reply.get()));
1442 const xcb_atom_t *types_end =
types +
reply->length;
1447 result |= WindowType::Normal;
1450 result |= WindowType::Desktop;
1453 result |= WindowType::Dock;
1456 result |= WindowType::Toolbar;
1459 result |= WindowType::Menu;
1462 result |= WindowType::Utility;
1465 result |= WindowType::Splash;
1468 result |= WindowType::Dialog;
1471 result |= WindowType::DropDownMenu;
1474 result |= WindowType::PopupMenu;
1477 result |= WindowType::Tooltip;
1480 result |= WindowType::Notification;
1483 result |= WindowType::Combo;
1486 result |= WindowType::Dnd;
1489 result |= WindowType::KdeOverride;
1504 if (
types & WindowType::Normal)
1506 if (
types & WindowType::Desktop)
1508 if (
types & WindowType::Dock)
1510 if (
types & WindowType::Notification)
1514 if (
types & WindowType::Utility)
1516 if (
types & WindowType::Splash)
1518 if (
types & WindowType::Dialog)
1520 if (
types & WindowType::Tooltip)
1522 if (
types & WindowType::KdeOverride)
1528 if (
types & WindowType::Menu)
1530 if (
types & WindowType::DropDownMenu)
1532 if (
types & WindowType::PopupMenu)
1534 if (
types & WindowType::Toolbar)
1536 if (
types & WindowType::Combo)
1538 if (
types & WindowType::Dnd)
1546 if (!(
types & WindowType::Dialog))
1551 if (!(
types & WindowType::Utility))
1555 if (!(
types & WindowType::Tooltip))
1559 if (!(
types & WindowType::Splash))
1597 const quint32 values[] = { XCB_BACK_PIXMAP_PARENT_RELATIVE };
1625 if (
type != XCB_EXPOSE)
1627 auto expose =
reinterpret_cast<xcb_expose_event_t *
>(
event);
1630 if (expose->count == 0)
1646 if (
event->format != 32)
1650 xcb_atom_t protocolAtom =
event->data.data32[0];
1663 reply.response_type = XCB_CLIENT_MESSAGE;
1667 XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
1668 (
const char *)&
reply);
1676#ifndef QT_NO_WHATSTHIS
1678 QWindowSystemInterface::handleEnterWhatsThisEvent();
1681 qCWarning(lcQpaXcb,
"Unhandled WM_PROTOCOLS (%s)",
1682 connection()->atomName(protocolAtom).constData());
1684#if QT_CONFIG(draganddrop)
1822 int detail, Qt::KeyboardModifiers
modifiers, xcb_timestamp_t timestamp,
1831 w->requestActivate();
1845 QPoint local(event_x, event_y);
1852 angleDelta.
setY(120);
1854 angleDelta.
setY(-120);
1856 angleDelta.
setX(120);
1858 angleDelta.
setX(-120);
1872 int detail, Qt::KeyboardModifiers
modifiers, xcb_timestamp_t timestamp,
1875 QPoint local(event_x, event_y);
1899 return mouseButtonsPressed || conn->
hasXInput2();
1907 &&
mode == XCB_NOTIFY_MODE_GRAB &&
detail == XCB_NOTIFY_DETAIL_ANCESTOR)
1908 || (
mode == XCB_NOTIFY_MODE_UNGRAB &&
detail == XCB_NOTIFY_DETAIL_INFERIOR)
1909 ||
detail == XCB_NOTIFY_DETAIL_VIRTUAL
1910 ||
detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL);
1916 &&
mode == XCB_NOTIFY_MODE_UNGRAB &&
detail == XCB_NOTIFY_DETAIL_ANCESTOR)
1917 || (
mode != XCB_NOTIFY_MODE_NORMAL &&
mode != XCB_NOTIFY_MODE_UNGRAB)
1918 ||
detail == XCB_NOTIFY_DETAIL_VIRTUAL
1919 ||
detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL);
1935 const QPoint local(event_x, event_y);
1949 if (
type != XCB_ENTER_NOTIFY)
1951 auto enter =
reinterpret_cast<xcb_enter_notify_event_t *
>(
event);
1954 auto enter =
reinterpret_cast<xcb_enter_notify_event_t *
>(
event);
1958 QPoint local(enter->event_x, enter->event_y);
1969 Qt::KeyboardModifiers
modifiers, xcb_timestamp_t timestamp,
1972 QPoint local(event_x, event_y);
1979 if (isMouseButtonPressed && !hasMousePressWindow)
1981 else if (hasMousePressWindow && !isMouseButtonPressed)
2013#define qt_xcb_mask_is_set(ptr, event) (((unsigned char*)(ptr))[(event)>>3] & (1 << ((event) & 7)))
2018 auto *ev =
reinterpret_cast<xcb_input_button_press_event_t *
>(
event);
2020 if (ev->buttons_len > 0) {
2021 unsigned char *buttonMask = (
unsigned char *) &ev[1];
2027 if (
Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
2028 qCDebug(lcQpaXInput,
"XI2 mouse event from touch device %d was ignored", ev->sourceid);
2031 for (
int i = 1;
i <= 15; ++
i)
2045 const char *sourceName =
nullptr;
2046 if (
Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled())) {
2052 switch (ev->event_type) {
2053 case XCB_INPUT_BUTTON_PRESS:
2054 if (
Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
2055 qCDebug(lcQpaXInputEvents,
"XI2 mouse press, button %d, time %d, source %s",
button, ev->time, sourceName);
2059 case XCB_INPUT_BUTTON_RELEASE:
2060 if (
Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
2061 qCDebug(lcQpaXInputEvents,
"XI2 mouse release, button %d, time %d, source %s",
button, ev->time, sourceName);
2065 case XCB_INPUT_MOTION:
2066 if (
Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
2067 qCDebug(lcQpaXInputEvents,
"XI2 mouse motion %d,%d, time %d, source %s", event_x, event_y, ev->time, sourceName);
2071 qWarning() <<
"Unrecognized XI2 mouse event" << ev->event_type;
2078 auto *ev =
reinterpret_cast<xcb_input_enter_event_t *
>(
event);
2083 if (mouseGrabber && mouseGrabber !=
this
2091 switch (ev->event_type) {
2092 case XCB_INPUT_ENTER: {
2095 qCDebug(lcQpaXInputEvents,
"XI2 mouse enter %d,%d, mode %d, detail %d, time %d",
2096 event_x, event_y, ev->mode, ev->detail, ev->time);
2100 case XCB_INPUT_LEAVE:
2101 qCDebug(lcQpaXInputEvents,
"XI2 mouse leave, mode %d, detail %d, time %d",
2102 ev->mode, ev->detail, ev->time);
2137 const bool propertyDeleted =
event->state == XCB_PROPERTY_DELETE;
2140 if (propertyDeleted)
2148 XCB_ATOM_ANY, 0, 1024);
2151 if (
reply->length != 0)
2188 if (
event->detail == XCB_NOTIFY_DETAIL_POINTER)
2200 if (
event->detail == XCB_NOTIFY_DETAIL_POINTER)
2239 XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
2240 return reply &&
reply->status == XCB_GRAB_STATUS_SUCCESS;
2245 if (!grab &&
connection()->mouseGrabber() ==
this)
2265 (XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE
2266 | XCB_EVENT_MASK_BUTTON_MOTION | XCB_EVENT_MASK_ENTER_WINDOW
2267 | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_POINTER_MOTION),
2268 XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
2269 XCB_WINDOW_NONE, XCB_CURSOR_NONE,
2270 XCB_TIME_CURRENT_TIME);
2279 switch (
event->type()) {
2283 switch (focusEvent->
reason()) {
2319 if (!
connection()->wmSupport()->isSupportedByWM(moveResize))
2324 if (startedByTouch) {
2326 if (wmname !=
"kwin"_L1 && wmname !=
"openbox"_L1) {
2327 qCDebug(lcQpaXInputDevices) <<
"only KDE and OpenBox support startSystemMove/Resize which is triggered from touch events: XDG_CURRENT_DESKTOP="
2328 <<
qgetenv(
"XDG_CURRENT_DESKTOP");
2359 qWarning() <<
"Cannot convert " << edges <<
"to _NET_WM_MOVERESIZE direction.";
2365 qCDebug(lcQpaXInputDevices) <<
"triggered system move or resize via sending _NET_WM_MOVERESIZE client message";
2367 xcb_client_message_event_t xev;
2368 xev.response_type = XCB_CLIENT_MESSAGE;
2369 xev.type = moveResize;
2373 xev.data.data32[0] = globalPos.
x();
2374 xev.data.data32[1] = globalPos.
y();
2376 xev.data.data32[2] = 8;
2379 xev.data.data32[3] = XCB_BUTTON_INDEX_1;
2380 xev.data.data32[4] = 0;
2383 XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY,
2384 (
const char *)&xev);
2393 xcb_client_message_event_t
event;
2395 event.response_type = XCB_CLIENT_MESSAGE;
2401 event.data.data32[1] =
message;
2402 event.data.data32[2] =
detail;
2403 event.data.data32[3] = data1;
2404 event.data.data32[4] = data2;
2422 switch (
event->data.data32[1]) {
2433 switch (
event->data.data32[2]) {
2476 XCB_PROP_MODE_REPLACE,
2489 for (
const QRect &
r : region)
2500 XCB_SHAPE_SK_BOUNDING,
xcb_window(), 0, 0, XCB_NONE);
2504 XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
2505 xcb_window(), 0, 0, rects.size(), &rects[0]);
2548 XCB_PROP_MODE_REPLACE,
2556#if QT_CONFIG(xcb_xlib)
2558 XTextProperty *
text = qstringToXTP(dpy,
title);
2572 const char *
name =
reinterpret_cast<const char *
>(xcb_get_property_value(
reply.get()));
2578 XCB_ATOM_STRING, 0, 1024);
2580 const char *
name =
reinterpret_cast<const char *
>(xcb_get_property_value(
reply.get()));
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
Type
This enum type defines the valid event types in Qt.
The QFocusEvent class contains event parameters for widget focus events.
Qt::FocusReason reason() const
Returns the reason for this focus event.
static QGuiApplicationPrivate * instance()
static QWindow * currentMouseWindow
bool isWindowBlocked(QWindow *window, QWindow **blockingWindow=nullptr) const
static QWindow * modalWindow()
Returns the most recently shown modal window.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
static qreal factor(C *context)
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
QList< QSize > availableSizes(Mode mode=Normal, State state=Off) const
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
qsizetype size() const noexcept
const_pointer constData() const noexcept
bool isEmpty() const noexcept
void push_back(parameter_type t)
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void resize(qsizetype size)
void append(parameter_type t)
static QObjectPrivate * get(QObject *o)
const QObjectList & children() const
Returns a list of child objects.
QObject * parent() const
Returns a pointer to the parent object.
QVariant property(const char *name) const
Returns the value of the object's name property.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
constexpr QPoint transposed() const noexcept
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr void setY(int y) noexcept
Sets the y coordinate of this point to the given y coordinate.
constexpr int y() const noexcept
Returns the y coordinate of this point.
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
\inmodule QtCore\reentrant
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.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
The QRegion class specifies a clip region for a painter.
int rectCount() const noexcept
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
The QScreen class is used to query screen properties. \inmodule QtGui.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
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
QByteArray toLatin1() const &
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toLocal8Bit() const &
QByteArray toUtf8() const &
static QString machineHostName()
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
void stop()
Stops the timer.
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has userType() \l QMetaType::QByteArray or \l QMet...
QScreen * screenForGeometry(const QRect &rect) const
QPointer< QWindow > activated
static WindowSystemEvent * peekWindowSystemEvent(EventType t)
static bool handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, qintptr *result)
Passes a native event identified by eventType to the window.
static void handleWindowScreenChanged(QWindow *window, QScreen *newScreen)
static void handleLeaveEvent(QWindow *window)
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static bool handleCloseEvent(QWindow *window)
static void handleGeometryChange(QWindow *window, const QRect &newRect)
static void handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local=QPointF(), const QPointF &global=QPointF())
This method can be used to ensure leave and enter events are both in queue when moving from one QWind...
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
static void handleWindowActivated(QWindow *window, Qt::FocusReason r=Qt::OtherFocusReason)
static void handleEnterEvent(QWindow *window, const QPointF &local=QPointF(), const QPointF &global=QPointF())
static bool handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::ScrollPhase phase=Qt::NoScrollPhase, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static void handleWindowStateChanged(QWindow *window, Qt::WindowStates newState, int oldState=-1)
Qt::WindowFlags flags
the window flags of the window
@ Atom_NET_WM_STATE_MAXIMIZED_HORZ
@ Atom_NET_WM_WINDOW_TYPE_DROPDOWN_MENU
@ Atom_NET_WM_WINDOW_TYPE_COMBO
@ Atom_COMPIZ_DECOR_DELETE_PIXMAP
@ Atom_NET_WM_WINDOW_TYPE_MENU
@ Atom_NET_WM_WINDOW_TYPE
@ Atom_COMPIZ_DECOR_PENDING
@ Atom_NET_WM_WINDOW_TYPE_DOCK
@ Atom_GTK_LOAD_ICONTHEMES
@ Atom_NET_WM_WINDOW_TYPE_POPUP_MENU
@ Atom_NET_WM_STATE_HIDDEN
@ Atom_NET_WM_WINDOW_TYPE_UTILITY
@ Atom_NET_WM_WINDOW_TYPE_DND
@ Atom_NET_WM_STATE_BELOW
@ Atom_NET_WM_WINDOW_TYPE_DIALOG
@ Atom_NET_WM_STATE_MAXIMIZED_VERT
@ Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE
@ Atom_NET_WM_SYNC_REQUEST
@ Atom_NET_WM_STATE_MODAL
@ Atom_NET_WM_SYNC_REQUEST_COUNTER
@ Atom_NET_WM_WINDOW_OPACITY
@ Atom_NET_WM_STATE_STAYS_ON_TOP
@ Atom_NET_WM_WINDOW_TYPE_TOOLBAR
@ Atom_NET_WM_STATE_ABOVE
@ Atom_COMPIZ_DECOR_REQUEST
@ Atom_NET_WM_WINDOW_TYPE_TOOLTIP
@ Atom_NET_WM_WINDOW_TYPE_SPLASH
@ Atom_NET_WM_STATE_FULLSCREEN
@ Atom_NET_WM_STATE_DEMANDS_ATTENTION
@ Atom_NET_WM_WINDOW_TYPE_NORMAL
@ Atom_NET_WM_CONTEXT_HELP
@ Atom_NET_WM_USER_TIME_WINDOW
@ Atom_COMPIZ_TOOLKIT_ACTION
@ Atom_NET_WM_WINDOW_TYPE_DESKTOP
@ Atom_NET_WM_WINDOW_TYPE_NOTIFICATION
QXcbAtom::Atom qatom(xcb_atom_t atom) const
QByteArray atomName(xcb_atom_t atom)
xcb_connection_t * xcb_connection() const
xcb_atom_t atom(QXcbAtom::Atom qatom) const
void setMousePressWindow(QXcbWindow *)
Qt::MouseButton translateMouseButton(xcb_button_t s)
QXcbKeyboard * keyboard() const
QXcbWindow * mouseGrabber() const
QXcbWindow * mousePressWindow() const
Qt::MouseButtons buttonState() const
void setMouseGrabber(QXcbWindow *)
void setTime(xcb_timestamp_t t)
void setButtonState(Qt::MouseButton button, bool down)
QString windowManagerName() const
xcb_visualid_t defaultVisualId() const
bool isTouchScreen(int id)
void setNetWmUserTime(xcb_timestamp_t t)
void xi2UpdateScrollingDevices()
xcb_timestamp_t time() const
bool startSystemMoveResizeForTouch(xcb_window_t window, int edges)
QXcbWMSupport * wmSupport() const
void setFocusWindow(QWindow *)
void abortSystemMoveResize(xcb_window_t window)
QXcbEventQueue * eventQueue() const
xcb_window_t clientLeader()
void setDuringSystemMoveResize(bool during)
void xi2SelectDeviceEvents(xcb_window_t window)
Qt::MouseButton xiToQtMouseButton(uint32_t b)
Qt::MouseButton button() const
QXcbNativeInterface * nativeInterface() const
QXcbWindow * platformWindowFromId(xcb_window_t id)
bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab)
void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener)
QXcbSystemTrayTracker * systemTrayTracker() const
void removeWindowEventListener(xcb_window_t id)
@ PeekConsumeMatchAndContinue
xcb_generic_event_t * peek(Peeker &&peeker)
QByteArray wmClass() const
static QXcbIntegration * instance()
Qt::KeyboardModifiers translateModifiers(int s) const
void updateXKBStateFromXI(void *modInfo, void *groupInfo)
const QByteArray & nativeEventType() const
QXcbConnection * connection() const
xcb_connection_t * xcb_connection() const
xcb_atom_t atom(QXcbAtom::Atom atom) const
void setConnection(QXcbConnection *connection)
const xcb_visualtype_t * visualForFormat(const QSurfaceFormat &format) const
QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const
xcb_screen_t * screen() const
xcb_window_t root() const
quint8 depthOfVisual(xcb_visualid_t visualid) const
const xcb_visualtype_t * visualForId(xcb_visualid_t visualid) const
QList< QPlatformScreen * > virtualSiblings() const override
Returns a list of all the platform screens that are part of the same virtual desktop.
QPlatformCursor * cursor() const override
Reimplement this function in subclass to return the cursor of the screen.
void windowShown(QXcbWindow *window)
xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const
void requestSystemTrayWindowDock(xcb_window_t window) const
const QList< xcb_window_t > & virtualRoots() const
bool isSupportedByWM(xcb_atom_t atom) const
xcb_window_t xcb_window() const
@ NetWmStateMaximizedHorz
@ NetWmStateMaximizedVert
@ NetWmStateDemandsAttention
QXcbWindow * toWindow() override
Qt::WindowStates m_windowState
void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override
void handleClientMessageEvent(const xcb_client_message_event_t *event) override
void setMask(const QRegion ®ion) override
Reimplement to be able to let Qt set the mask of a window.
void updateSyncRequestCounter()
QSurfaceFormat format() const override
Returns the actual surface format of the window.
QXcbScreen * initialScreen() const
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
WindowTypes wmWindowTypes() const
bool requestSystemTrayWindowDock()
virtual const xcb_visualtype_t * createVisual()
void setTransparentForMouseEvents(bool transparent)
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
bool startSystemResize(Qt::Edges edges) override
Reimplement this method to start a system resize operation if the system supports it and return true ...
void setWmWindowType(WindowTypes types, Qt::WindowFlags flags)
@ SyncAndConfigureReceived
bool setKeyboardGrabEnabled(bool grab) override
void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override
bool handleNativeEvent(xcb_generic_event_t *event) override
void handleExposeEvent(const xcb_expose_event_t *event) override
void handleXIEnterLeave(xcb_ge_event_t *) override
xcb_sync_int64_t m_syncValue
void setAlertState(bool enabled) override
Reimplement this method to set whether the window demands attention (for example, by flashing the tas...
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
QXcbScreen * xcbScreen() const
bool m_deferredActivation
void handleXEmbedMessage(const xcb_client_message_event_t *event)
uint visualId() const override
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void updateNetWmUserTime(xcb_timestamp_t timestamp)
QXcbWindow(QWindow *window)
void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two=0)
QPoint m_lastPointerPosition
void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override
QPoint m_lastPointerGlobalPosition
void setMotifWmHints(Qt::WindowFlags flags)
void setWindowIconText(const QString &title) override
void setImageFormatForVisual(const xcb_visualtype_t *visual)
void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail=0, quint32 data1=0, quint32 data2=0)
static bool isTrayIconWindow(QWindow *window)
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override
bool relayFocusToModalWindow() const
void setWindowRole(const QString &role) override
void postSyncWindowRequest()
QMargins frameMargins() const override
xcb_visualid_t m_visualId
void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override
qreal m_sizeHintsScaleFactor
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
void updateDoesNotAcceptFocus(bool doesNotAcceptFocus)
xcb_sync_counter_t m_syncCounter
bool isExposed() const override
Returns if this window is exposed in the windowing system.
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
NetWmStates netWmStates()
void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized) override
bool isEmbedded() const override
Returns true if the window is a child of a non-Qt window.
QPoint mapFromGlobal(const QPoint &pos) const override
Translates the global screen coordinate pos to window coordinates using native methods.
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
static QString windowTitle(const QXcbConnection *conn, xcb_window_t window)
QXcbSyncWindowRequest * m_pendingSyncRequest
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
QImage::Format m_imageFormat
void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override
void handleButtonPressEvent(const xcb_button_press_event_t *event) override
Qt::WindowStates m_lastWindowStateEvent
void handleFocusOutEvent(const xcb_focus_out_event_t *event) override
RecreationReasons m_recreationReasons
QPoint mapToGlobal(const QPoint &pos) const override
Translates the window coordinate pos to global screen coordinates using native methods.
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
virtual void resolveFormat(const QSurfaceFormat &format)
bool startSystemMoveResize(const QPoint &pos, int edges)
void handleFocusInEvent(const xcb_focus_in_event_t *event) override
@ WindowStaysOnBottomHintChanged
@ WindowStaysOnTopHintChanged
void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source)
bool setMouseGrabEnabled(bool grab) override
void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override
bool startSystemMove() override
Reimplement this method to start a system move operation if the system supports it and return true to...
void doStartSystemMoveResize(const QPoint &globalPos, int edges)
void setParentRelativeBackPixmap()
xcb_window_t m_netWmUserTimeWindow
QXcbScreen * parentScreen()
void setNetWmStateOnUnmappedWindow()
EGLImageKHR int int EGLuint64KHR * modifiers
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
T toNativePixels(const T &value, const C *context)
T toNativeLocalPosition(const T &value, const C *context)
T fromNativePixels(const T &value, const C *context)
QRegion toNativeLocalRegion(const QRegion &pointRegion, const QWindow *window)
Combined button and popup list for selecting options.
QFuture< QtPrivate::MapResultType< Sequence, MapFunctor > > mapped(QThreadPool *pool, Sequence &&sequence, MapFunctor &&map)
@ BypassWindowManagerHint
@ WindowDoesNotAcceptFocus
@ WindowContextHelpButtonHint
@ WindowStaysOnBottomHint
@ WindowMaximizeButtonHint
@ WindowMinimizeButtonHint
@ WindowMinMaxButtonsHint
@ WindowTransparentForInput
@ X11BypassWindowManagerHint
@ ActiveWindowFocusReason
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage return DBusPendingCall * pending
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
qint64 qRound64(qfloat16 d) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLenum GLsizei GLsizei GLint * values
[15]
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum GLenum * types
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLsizei GLsizei GLchar * source
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
unsigned long long quint64
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
#define Q_XCB_REPLY(call,...)
#define Q_XCB_REPLY_UNCHECKED(call,...)
QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap)
static bool fromSendEvent(const void *event)
static QXcbSystemTrayTracker * systemTrayTracker(const QScreen *s)
static uint qtEdgesToXcbMoveResizeDirection(Qt::Edges edges)
static bool doCheckUnGrabAncestor(QXcbConnection *conn)
static const char * wm_window_type_property_id
static bool isTransient(const QWindow *w)
#define qt_xcb_mask_is_set(ptr, event)
static bool ignoreEnterEvent(quint8 mode, quint8 detail, QXcbConnection *conn=nullptr)
static const char * wm_window_role_property_id
QList< xcb_rectangle_t > qRegionToXcbRectangleList(const QRegion ®ion)
static bool ignoreLeaveEvent(quint8 mode, quint8 detail, QXcbConnection *conn=nullptr)
static xcb_rectangle_t qRectToXCBRectangle(const QRect &r)
const quint32 XEMBED_VERSION
@ transparentForInputEventMask
static int fixed1616ToInt(xcb_input_fp1616_t val)
@ XEMBED_UNREGISTER_ACCELERATOR
@ XEMBED_WINDOW_DEACTIVATE
@ XEMBED_REGISTER_ACCELERATOR
@ XEMBED_ACTIVATE_ACCELERATOR
static bool activeWindowChangeQueued(const QWindow *window)
static QWindow * childWindowAt(QWindow *win, const QPoint &p)
QList< xcb_rectangle_t > qRegionToXcbRectangleList(const QRegion ®ion)
QFuture< QSet< QChar > > set
[10]
std::array< QModelRoleData, 3 > roleData
[13]
obj metaObject() -> className()
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
bool contains(const AT &t) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent