15#if QT_CONFIG(draganddrop)
20#ifndef QT_NO_SESSIONMANAGER
27#include <QtGui/private/qgenericunixfontdatabase_p.h>
28#include <QtGui/private/qgenericunixservices_p.h>
32#include <QtGui/private/qguiapplication_p.h>
34#if QT_CONFIG(xcb_xlib)
39#if QT_CONFIG(xcb_native_painting)
45#include <qpa/qplatforminputcontextfactory_p.h>
46#include <private/qgenericunixthemes_p.h>
47#include <qpa/qplatforminputcontext.h>
49#include <QtGui/QOpenGLContext>
50#include <QtGui/QScreen>
51#include <QtGui/QOffscreenSurface>
52#if QT_CONFIG(accessibility)
53#include <qpa/qplatformaccessibility.h>
54#if QT_CONFIG(accessibility_atspi_bridge)
55#include <QtGui/private/qspiaccessiblebridge_p.h>
59#include <QtCore/QFileInfo>
74#if defined(QT_DEBUG) && defined(Q_OS_LINUX)
76 const QFileInfo parentProcExe(parentProc +
"/exe"_L1);
79 QFile f(parentProc +
"/cmdline"_L1);
84 while (
f.getChar(&
c) &&
c) {
109 , m_defaultVisualId(UINT_MAX)
116 qRegisterMetaType<QXcbWindow*>();
117#if QT_CONFIG(xcb_xlib)
124 bool noGrabArg =
false;
125 bool doGrabArg =
false;
128 for (
int i = 1;
i < argc;
i++) {
130 if (
arg.startsWith(
"--"))
132 if (
arg ==
"-display" &&
i < argc - 1)
134 else if (
arg ==
"-name" &&
i < argc - 1)
135 m_instanceName = argv[++
i];
136 else if (
arg ==
"-nograb")
138 else if (
arg ==
"-dograb")
140 else if (
arg ==
"-visual" &&
i < argc - 1) {
144 m_defaultVisualId = UINT_MAX;
153 if (noGrabArg && doGrabArg && underDebugger) {
154 qWarning(
"Both -nograb and -dograb command line arguments specified. Please pick one. -nograb takes precedence");
159 if (!noGrabArg && !doGrabArg && underDebugger) {
160 qCDebug(lcQpaXcb,
"Qt: gdb: -nograb added to command-line options.\n"
161 "\t Use the -dograb option to enforce grabbing.");
164 m_canGrab = (!underDebugger && !noGrabArg) || (underDebugger && doGrabArg);
173 m_connection =
nullptr;
179#if QT_CONFIG(xcb_native_painting)
181 qCDebug(lcQpaXcb,
"QXCB USING NATIVE PAINTING");
190 m_connection =
nullptr;
191 m_instance =
nullptr;
196#if QT_CONFIG(xcb_native_painting)
209 if (
window->supportsOpenGL()) {
241 if (!glIntegration) {
242 qWarning(
"QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled");
248# if QT_CONFIG(xcb_glx_plugin)
252 if (
auto *glxIntegration =
dynamic_cast<QGLXIntegration*
>(m_connection->
glIntegration()))
253 return glxIntegration->createOpenGLContext(
context, visualInfo, shareContext);
263 if (
auto *eglIntegration =
dynamic_cast<QEGLIntegration*
>(m_connection->
glIntegration()))
264 return eglIntegration->createOpenGLContext(
context,
display, shareContext);
277 if (isTrayIconWindow) {
279#if QT_CONFIG(xcb_native_painting)
294 if (!glIntegration) {
295 qWarning(
"QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled");
307 if (
const auto *integration =
connection()->glIntegration())
344 const auto defaultInputContext =
"compose"_L1;
349 icStr = defaultInputContext;
351 if (!m_inputContext && icStr != defaultInputContext && icStr !=
"none"_L1)
376 return m_fontDatabase.
data();
381 return m_nativeInterface.
data();
384#ifndef QT_NO_CLIPBOARD
391#if QT_CONFIG(draganddrop)
392#include <private/qsimpledrag_p.h>
403 return m_connection->drag();
409 return m_inputContext.
data();
412#if QT_CONFIG(accessibility)
413QPlatformAccessibility *QXcbIntegration::accessibility()
const
415#if !defined(QT_NO_ACCESSIBILITY_ATSPI_BRIDGE)
416 if (!m_accessibility) {
418 "Initializing accessibility without event-dispatcher!");
423 return m_accessibility.data();
429 return m_services.
data();
452#define RETURN_VALID_XSETTINGS(key) { \
453 auto value = connection()->primaryScreen()->xSettings()->setting(key); \
454 if (value.isValid()) return value; \
493 if (
screen->logicalDpi().first > dpi)
494 dpi =
screen->logicalDpi().first;
495 if (
screen->logicalDpi().second > dpi)
496 dpi =
screen->logicalDpi().second;
518 const int lastSlashPos =
result.lastIndexOf(u
'/');
519 if (lastSlashPos != -1)
520 result.remove(0, lastSlashPos + 1);
549 m_wmClass = std::move(
name).toLocal8Bit() +
'\0' + std::move(
className).toLocal8Bit() +
'\0';
563 m_connection->
sync();
582#if QT_CONFIG(xcb_native_painting)
uint toUInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an {unsigned int} using base base, which is ten by default.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QAbstractEventDispatcher * eventDispatcher()
Returns a pointer to the event dispatcher object for the main thread.
static QStringList arguments()
QString applicationName
the name of this application
\inmodule QtCore \reentrant
bool isSymLink() const
Returns true if this object points to a symbolic link, shortcut, or alias; otherwise returns false.
QString symLinkTarget() const
void setApplicationBadge(qint64 number)
static QPlatformTheme * createUnixTheme(const QString &name)
Creates a UNIX theme according to the detected desktop environment.
static QStringList themeNames()
QScreen * primaryScreen
the primary (or default) screen of the application.
The QKeyEvent class describes a key event.
bool isEmpty() const noexcept
QScreen * screen() const
Returns the screen to which the offscreen surface is connected.
static QString requested()
static QPlatformInputContext * create()
The QPlatformInputContext class abstracts the input method dependent data and composing state.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
The QScreen class is used to query screen properties. \inmodule QtGui.
QPlatformScreen * handle() const
Get the platform screen handle.
QSimpleDrag implements QBasicDrag for Drag and Drop operations within the Qt Application itself.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isNull() const
Returns true if this string is null; otherwise returns false.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
static void handleThemeChange(QWindow *window=nullptr)
QXcbKeyboard * keyboard() const
QXcbGlIntegration * glIntegration() const
QXcbScreen * primaryScreen() const
Qt::KeyboardModifiers queryKeyboardModifiers() const
QXcbClipboard * clipboard() const
static QAbstractEventDispatcher * createEventDispatcher(QXcbConnection *connection)
virtual bool supportsSwitchableWidgetComposition() const
virtual QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const =0
virtual QXcbWindow * createWindow(QWindow *window) const =0
virtual QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const =0
QPlatformServices * services() const override
bool hasCapability(Capability cap) const override
QByteArray wmClass() const
QPlatformWindow * createForeignWindow(QWindow *window, WId nativeHandle) const override
Qt::KeyboardModifiers queryKeyboardModifiers() const override
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
QPlatformNativeInterface * nativeInterface() const override
bool nativePaintingEnabled() const
QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const override
Factory function for QPlatformOpenGLContext.
QPlatformTheme * createPlatformTheme(const QString &name) const override
void beep() const override
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
void setApplicationBadge(qint64 number) override
QPlatformPixmap * createPlatformPixmap(QPlatformPixmap::PixelType type) const override
Factory function for QPlatformPixmap.
QStringList themeNames() const override
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
QVariant styleHint(StyleHint hint) const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
static QXcbIntegration * instance()
QPlatformClipboard * clipboard() const override
Accessor for the platform integration's clipboard.
QXcbIntegration(const QStringList ¶meters, int &argc, char **argv)
QXcbConnection * connection() const
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
QList< int > possibleKeys(const QKeyEvent *e) const override
Should be used to obtain a list of possible shortcuts for the given key event.
QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const override
Factory function for QOffscreenSurface.
void moveToScreen(QWindow *window, int screen)
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
QList< int > possibleKeys(const QKeyEvent *event) const
QXcbXSettings * xSettings() const
QString portalWindowIdentifier(QWindow *window) override
static bool isTrayIconWindow(QWindow *window)
void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle)
QList< QVariant > arguments
struct wl_display * display
Combined button and popup list for selecting options.
@ AA_CompressHighFrequencyEvents
static QString displayName(CGDirectDisplayID displayID)
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
QPlatformFontDatabase QGenericUnixFontDatabase
#define qCDebug(category,...)
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define Q_ASSERT_X(cond, x, msg)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
static int toInt(const QChar &qc, int R)
const char className[16]
[1]
static const auto xsNetCursorBlink
static const auto xsNetDndDragThreshold
static QString argv0BaseName()
static const auto xsNetDoubleClickTime
static const auto xsNetCursorBlinkTime
static bool runningUnderDebugger()
static const auto xsNetDoubleClickDistance
#define RETURN_VALID_XSETTINGS(key)
static const char resourceNameVar[]
void qt_xcb_native_x11_info_init(QXcbConnection *conn)