xcb: Extract QXcbWindow::isTrayIconWindow()
Introduce this static function to detect tray icon windows. The old non-static method was unused, so drop it. Change-Id: Ia97b8a857bd1807ecd56340efbc9b145844d593e Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
parent
60cecc86f8
commit
a34054c75e
@ -232,7 +232,7 @@ QPlatformPixmap *QXcbIntegration::createPlatformPixmap(QPlatformPixmap::PixelTyp
|
|||||||
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
|
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
|
||||||
{
|
{
|
||||||
QXcbGlIntegration *glIntegration = nullptr;
|
QXcbGlIntegration *glIntegration = nullptr;
|
||||||
const bool isTrayIconWindow = window->objectName() == QLatin1String("QSystemTrayIconSysWindow");
|
const bool isTrayIconWindow = QXcbWindow::isTrayIconWindow(window);;
|
||||||
if (window->type() != Qt::Desktop && !isTrayIconWindow) {
|
if (window->type() != Qt::Desktop && !isTrayIconWindow) {
|
||||||
if (window->supportsOpenGL()) {
|
if (window->supportsOpenGL()) {
|
||||||
glIntegration = defaultConnection()->glIntegration();
|
glIntegration = defaultConnection()->glIntegration();
|
||||||
@ -277,7 +277,7 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont
|
|||||||
|
|
||||||
QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const
|
QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const
|
||||||
{
|
{
|
||||||
const bool isTrayIconWindow = window->objectName() == QLatin1String("QSystemTrayIconSysWindow");
|
const bool isTrayIconWindow = QXcbWindow::isTrayIconWindow(window);
|
||||||
if (isTrayIconWindow)
|
if (isTrayIconWindow)
|
||||||
return new QXcbSystemTrayBackingStore(window);
|
return new QXcbSystemTrayBackingStore(window);
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ void QXcbWindow::create()
|
|||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
m_windowState = Qt::WindowNoState;
|
m_windowState = Qt::WindowNoState;
|
||||||
m_trayIconWindow = window()->objectName() == QLatin1String("QSystemTrayIconSysWindow");
|
m_trayIconWindow = isTrayIconWindow(window());
|
||||||
|
|
||||||
Qt::WindowType type = window()->type();
|
Qt::WindowType type = window()->type();
|
||||||
|
|
||||||
|
@ -173,7 +173,10 @@ public:
|
|||||||
bool startSystemMoveResize(const QPoint &pos, int corner);
|
bool startSystemMoveResize(const QPoint &pos, int corner);
|
||||||
void doStartSystemMoveResize(const QPoint &globalPos, int corner);
|
void doStartSystemMoveResize(const QPoint &globalPos, int corner);
|
||||||
|
|
||||||
bool isTrayIconWindow() const { return m_trayIconWindow; }
|
static bool isTrayIconWindow(QWindow *window)
|
||||||
|
{
|
||||||
|
return window->objectName() == QLatin1String("QSystemTrayIconSysWindow");
|
||||||
|
}
|
||||||
|
|
||||||
virtual void create();
|
virtual void create();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user