Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qxcbwindow.cpp File Reference

(988039729f55a5e62e32b82c6f29ff7457e91d9d)

#include "qxcbwindow.h"
#include <QtDebug>
#include <QMetaEnum>
#include <QScreen>
#include <QtCore/QFileInfo>
#include <QtGui/QIcon>
#include <QtGui/QRegion>
#include <QtGui/private/qhighdpiscaling_p.h>
#include "qxcbintegration.h"
#include "qxcbconnection.h"
#include "qxcbscreen.h"
#include "qxcbkeyboard.h"
#include "qxcbimage.h"
#include "qxcbwmsupport.h"
#include "qxcbnativeinterface.h"
#include "qxcbsystemtraytracker.h"
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformcursor.h>
#include <algorithm>
#include <xcb/xcb_icccm.h>
#include <xcb/xfixes.h>
#include <xcb/shape.h>
#include <xcb/xinput.h>
#include <private/qguiapplication_p.h>
#include <private/qwindow_p.h>
#include <qpa/qplatformbackingstore.h>
#include <qpa/qwindowsysteminterface.h>
#include <stdio.h>
+ Include dependency graph for qxcbwindow.cpp:

Go to the source code of this file.

Classes

struct  QtMotifWmHints
 

Macros

#define XCOORD_MAX   32767
 
#define qt_xcb_mask_is_set(ptr, event)   (((unsigned char*)(ptr))[(event)>>3] & (1 << ((event) & 7)))
 

Enumerations

enum  { defaultWindowWidth = 160 , defaultWindowHeight = 160 }
 
enum  QX11EmbedFocusInDetail { XEMBED_FOCUS_CURRENT = 0 , XEMBED_FOCUS_FIRST = 1 , XEMBED_FOCUS_LAST = 2 }
 
enum  QX11EmbedInfoFlags { XEMBED_MAPPED = (1 << 0) }
 
enum  QX11EmbedMessageType {
  XEMBED_EMBEDDED_NOTIFY = 0 , XEMBED_WINDOW_ACTIVATE = 1 , XEMBED_WINDOW_DEACTIVATE = 2 , XEMBED_REQUEST_FOCUS = 3 ,
  XEMBED_FOCUS_IN = 4 , XEMBED_FOCUS_OUT = 5 , XEMBED_FOCUS_NEXT = 6 , XEMBED_FOCUS_PREV = 7 ,
  XEMBED_MODALITY_ON = 10 , XEMBED_MODALITY_OFF = 11 , XEMBED_REGISTER_ACCELERATOR = 12 , XEMBED_UNREGISTER_ACCELERATOR = 13 ,
  XEMBED_ACTIVATE_ACCELERATOR = 14
}
 
enum  : quint32 { baseEventMask , defaultEventMask , transparentForInputEventMask }
 
enum  {
  MWM_HINTS_FUNCTIONS = (1L << 0) , MWM_FUNC_ALL = (1L << 0) , MWM_FUNC_RESIZE = (1L << 1) , MWM_FUNC_MOVE = (1L << 2) ,
  MWM_FUNC_MINIMIZE = (1L << 3) , MWM_FUNC_MAXIMIZE = (1L << 4) , MWM_FUNC_CLOSE = (1L << 5) , MWM_HINTS_DECORATIONS = (1L << 1) ,
  MWM_DECOR_ALL = (1L << 0) , MWM_DECOR_BORDER = (1L << 1) , MWM_DECOR_RESIZEH = (1L << 2) , MWM_DECOR_TITLE = (1L << 3) ,
  MWM_DECOR_MENU = (1L << 4) , MWM_DECOR_MINIMIZE = (1L << 5) , MWM_DECOR_MAXIMIZE = (1L << 6)
}
 

Functions

 Q_LOGGING_CATEGORY (lcQpaWindow, "qt.qpa.window")
 
 Q_LOGGING_CATEGORY (lcQpaXcbWindow, "qt.qpa.xcb.window")
 
 Q_DECLARE_TYPEINFO (xcb_rectangle_t, Q_PRIMITIVE_TYPE)
 
static bool isTransient (const QWindow *w)
 
static QWindowchildWindowAt (QWindow *win, const QPoint &p)
 
static bool doCheckUnGrabAncestor (QXcbConnection *conn)
 
static bool ignoreLeaveEvent (quint8 mode, quint8 detail, QXcbConnection *conn)
 
static bool ignoreEnterEvent (quint8 mode, quint8 detail, QXcbConnection *conn=nullptr)
 
static int fixed1616ToInt (xcb_input_fp1616_t val)
 
static uint qtEdgesToXcbMoveResizeDirection (Qt::Edges edges)
 
static bool focusWindowChangeQueued (const QWindow *window)
 
static xcb_rectangle_t qRectToXCBRectangle (const QRect &r)
 
QList< xcb_rectangle_t > qRegionToXcbRectangleList (const QRegion &region)
 

Variables

const quint32 XEMBED_VERSION = 0
 
static const char * wm_window_type_property_id = "_q_xcb_wm_window_type"
 
static const char * wm_window_role_property_id = "_q_xcb_wm_window_role"
 

Macro Definition Documentation

◆ qt_xcb_mask_is_set

#define qt_xcb_mask_is_set ( ptr,
event )   (((unsigned char*)(ptr))[(event)>>3] & (1 << ((event) & 7)))

Definition at line 2116 of file qxcbwindow.cpp.

Referenced by QXcbWindow::handleXIMouseEvent().

◆ XCOORD_MAX

#define XCOORD_MAX   32767

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
defaultWindowWidth 
defaultWindowHeight 

Definition at line 53 of file qxcbwindow.cpp.

◆ anonymous enum

anonymous enum : quint32
Enumerator
baseEventMask 
defaultEventMask 
transparentForInputEventMask 

Definition at line 210 of file qxcbwindow.cpp.

◆ anonymous enum

anonymous enum
Enumerator
MWM_HINTS_FUNCTIONS 
MWM_FUNC_ALL 
MWM_FUNC_RESIZE 
MWM_FUNC_MOVE 
MWM_FUNC_MINIMIZE 
MWM_FUNC_MAXIMIZE 
MWM_FUNC_CLOSE 
MWM_HINTS_DECORATIONS 
MWM_DECOR_ALL 
MWM_DECOR_BORDER 
MWM_DECOR_RESIZEH 
MWM_DECOR_TITLE 
MWM_DECOR_MENU 
MWM_DECOR_MINIMIZE 
MWM_DECOR_MAXIMIZE 

Definition at line 881 of file qxcbwindow.cpp.

◆ QX11EmbedFocusInDetail

Enumerator
XEMBED_FOCUS_CURRENT 
XEMBED_FOCUS_FIRST 
XEMBED_FOCUS_LAST 

Definition at line 69 of file qxcbwindow.cpp.

◆ QX11EmbedInfoFlags

Enumerator
XEMBED_MAPPED 

Definition at line 75 of file qxcbwindow.cpp.

◆ QX11EmbedMessageType

Enumerator
XEMBED_EMBEDDED_NOTIFY 
XEMBED_WINDOW_ACTIVATE 
XEMBED_WINDOW_DEACTIVATE 
XEMBED_REQUEST_FOCUS 
XEMBED_FOCUS_IN 
XEMBED_FOCUS_OUT 
XEMBED_FOCUS_NEXT 
XEMBED_FOCUS_PREV 
XEMBED_MODALITY_ON 
XEMBED_MODALITY_OFF 
XEMBED_REGISTER_ACCELERATOR 
XEMBED_UNREGISTER_ACCELERATOR 
XEMBED_ACTIVATE_ACCELERATOR 

Definition at line 79 of file qxcbwindow.cpp.

Function Documentation

◆ childWindowAt()

static QWindow * childWindowAt ( QWindow * win,
const QPoint & p )
static

Definition at line 182 of file qxcbwindow.cpp.

References QObject::children(), childWindowAt(), QRect::contains(), QWidget::geometry, QObject::parent(), win, and Qt::WindowTransparentForInput.

Referenced by childWindowAt(), and QXcbWindow::hide().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doCheckUnGrabAncestor()

static bool doCheckUnGrabAncestor ( QXcbConnection * conn)
inlinestatic

Definition at line 1983 of file qxcbwindow.cpp.

References QXcbConnection::buttonState(), QXcbBasicConnection::hasXInput2(), and Qt::NoButton.

Referenced by ignoreEnterEvent(), and ignoreLeaveEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixed1616ToInt()

static int fixed1616ToInt ( xcb_input_fp1616_t val)
inlinestatic

Definition at line 2111 of file qxcbwindow.cpp.

Referenced by QXcbWindow::handleXIEnterLeave(), and QXcbWindow::handleXIMouseEvent().

+ Here is the caller graph for this function:

◆ focusWindowChangeQueued()

static bool focusWindowChangeQueued ( const QWindow * window)
static

Definition at line 2511 of file qxcbwindow.cpp.

References QWindowSystemInterfacePrivate::FocusWindowEvent::focused, QWindowSystemInterfacePrivate::FocusWindow, QWindowSystemInterfacePrivate::peekWindowSystemEvent(), and window().

Referenced by QXcbWindow::handleXEmbedMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ignoreEnterEvent()

static bool ignoreEnterEvent ( quint8 mode,
quint8 detail,
QXcbConnection * conn = nullptr )
static

Definition at line 2007 of file qxcbwindow.cpp.

References doCheckUnGrabAncestor().

Referenced by QXcbWindow::handleEnterNotifyEvent(), and QXcbWindow::handleLeaveNotifyEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ignoreLeaveEvent()

static bool ignoreLeaveEvent ( quint8 mode,
quint8 detail,
QXcbConnection * conn )
static

Definition at line 1998 of file qxcbwindow.cpp.

References doCheckUnGrabAncestor().

Referenced by QXcbWindow::handleLeaveNotifyEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isTransient()

static bool isTransient ( const QWindow * w)
inlinestatic

Definition at line 113 of file qxcbwindow.cpp.

References Qt::Dialog, Qt::Drawer, Qt::Popup, Qt::Sheet, Qt::SplashScreen, Qt::Tool, and Qt::ToolTip.

Referenced by QQC2_NAMESPACE::QMacStyle::drawComplexControl(), QMacStyle::drawComplexControl(), and QXcbWindow::updateWmTransientFor().

+ Here is the caller graph for this function:

◆ Q_DECLARE_TYPEINFO()

Q_DECLARE_TYPEINFO ( xcb_rectangle_t ,
Q_PRIMITIVE_TYPE  )

◆ Q_LOGGING_CATEGORY() [1/2]

Q_LOGGING_CATEGORY ( lcQpaWindow ,
"qt.qpa.window"  )

◆ Q_LOGGING_CATEGORY() [2/2]

Q_LOGGING_CATEGORY ( lcQpaXcbWindow ,
"qt.qpa.xcb.window"  )

◆ qRectToXCBRectangle()

static xcb_rectangle_t qRectToXCBRectangle ( const QRect & r)
inlinestatic

Definition at line 2561 of file qxcbwindow.cpp.

References qMax(), and qMin().

Referenced by qRegionToXcbRectangleList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qRegionToXcbRectangleList()

QList< xcb_rectangle_t > qRegionToXcbRectangleList ( const QRegion & region)

Definition at line 2588 of file qxcbwindow.cpp.

References qRectToXCBRectangle(), and QRegion::rectCount().

Referenced by QXcbWindow::setMask().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qtEdgesToXcbMoveResizeDirection()

static uint qtEdgesToXcbMoveResizeDirection ( Qt::Edges edges)
static

Definition at line 2443 of file qxcbwindow.cpp.

References Qt::BottomEdge, Qt::LeftEdge, qWarning, Qt::RightEdge, and Qt::TopEdge.

Referenced by QXcbWindow::doStartSystemMoveResize().

+ Here is the caller graph for this function:

Variable Documentation

◆ wm_window_role_property_id

const char* wm_window_role_property_id = "_q_xcb_wm_window_role"
static

Definition at line 202 of file qxcbwindow.cpp.

Referenced by QXcbWindow::create().

◆ wm_window_type_property_id

const char* wm_window_type_property_id = "_q_xcb_wm_window_type"
static

Definition at line 201 of file qxcbwindow.cpp.

Referenced by QXcbWindow::setWindowFlags().

◆ XEMBED_VERSION

const quint32 XEMBED_VERSION = 0

Definition at line 95 of file qxcbwindow.cpp.

Referenced by QXcbWindow::create().