From 556221d97b6c4ca387ca5535ef8f0a2b0f5b7644 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Fri, 30 Oct 2015 18:15:18 +0300 Subject: QSystemTrayIcon/X11: Move platform-specific calls to the xcb plugin - Detect the tray icon window in the platform plugin by the object name. This way we don't need QXcbWindowFunctions::requestSystemTrayWindowDockIdentifier(). - Get rid of unused calls QXcbIntegrationFunctions::xEmbedSystemTrayVisualHasAlphaChannel() and QXcbWindowFunctions::setParentRelativeBackPixmap(). - Mark the tray icon window as embedded to be able to get the correct result from QWindow::mapToGlobal(). It allows to drop QXcbWindowFunctions::systemTrayWindowGlobalGeometry(). This change allows to remove the intermediate level between the QSystemTrayIconSys widget and the xcb plugin. The code looks clearer. Change-Id: I7d067131287a6dec162b36f0bddc8cb518aaa38c Reviewed-by: Gatis Paeglis --- .../xcbfunctions/qxcbintegrationfunctions.h | 60 ----------------- .../xcbfunctions/qxcbwindowfunctions.h | 21 ------ .../xcbfunctions/qxcbwindowfunctions.qdoc | 75 ---------------------- src/platformheaders/xcbfunctions/xcbfunctions.pri | 1 - 4 files changed, 157 deletions(-) delete mode 100644 src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h (limited to 'src/platformheaders') diff --git a/src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h b/src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h deleted file mode 100644 index fc24dd0f6e..0000000000 --- a/src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QXCBINTEGRATIONFUNCTIONS_H -#define QXCBINTEGRATIONFUNCTIONS_H - -#include - -QT_BEGIN_NAMESPACE - -class QXcbIntegrationFunctions -{ -public: - typedef bool (*XEmbedSystemTrayVisualHasAlphaChannel)(); - static const QByteArray xEmbedSystemTrayVisualHasAlphaChannelIdentifier() { return QByteArrayLiteral("XcbXEmbedSystemTrayVisualHasAlphaChannel"); } - static bool xEmbedSystemTrayVisualHasAlphaChannel() - { - return QPlatformHeaderHelper::callPlatformFunction(xEmbedSystemTrayVisualHasAlphaChannelIdentifier()); - } -}; - -QT_END_NAMESPACE - -#endif /*QXCBINTEGRATIONFUNCTIONS_H*/ diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h index b6c3b1db73..b0e6cb6a1d 100644 --- a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h +++ b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h @@ -90,27 +90,6 @@ public: return QPlatformHeaderHelper::callPlatformFunction(setWmWindowIconTextIdentifier(), window, text); } - typedef void (*SetParentRelativeBackPixmap)(const QWindow *window); - static const QByteArray setParentRelativeBackPixmapIdentifier() { return QByteArrayLiteral("XcbSetParentRelativeBackPixmap"); } - static void setParentRelativeBackPixmap(const QWindow *window) - { - return QPlatformHeaderHelper::callPlatformFunction(setParentRelativeBackPixmapIdentifier(), window); - } - - typedef bool (*RequestSystemTrayWindowDock)(const QWindow *window); - static const QByteArray requestSystemTrayWindowDockIdentifier() { return QByteArrayLiteral("XcbRequestSystemTrayWindowDockIdentifier"); } - static bool requestSystemTrayWindowDock(const QWindow *window) - { - return QPlatformHeaderHelper::callPlatformFunction(requestSystemTrayWindowDockIdentifier(), window); - } - - typedef QRect (*SystemTrayWindowGlobalGeometry)(const QWindow *window); - static const QByteArray systemTrayWindowGlobalGeometryIdentifier() { return QByteArrayLiteral("XcbSystemTrayWindowGlobalGeometryIdentifier"); } - static QRect systemTrayWindowGlobalGeometry(const QWindow *window) - { - return QPlatformHeaderHelper::callPlatformFunction(systemTrayWindowGlobalGeometryIdentifier(), window); - } - typedef uint (*VisualId)(QWindow *window); static const QByteArray visualIdIdentifier() { return QByteArrayLiteral("XcbVisualId"); } diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc index fab473b91b..5e2aa2cbf2 100644 --- a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc +++ b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc @@ -137,81 +137,6 @@ relayed to the function retrieved by QGuiApplication. */ -/*! - \typedef QXcbWindowFunctions::SetParentRelativeBackPixmap - - This is the typedef for the function returned by - QGuiApplication::platformFunction when passed the - value returned by setParentRelativeBackPixmapIdentifier(). -*/ - -/*! - \fn const QByteArray QXcbWindowFunctions::setParentRelativeBackPixmapIdentifier() - - This function returns the byte array that can be used to query - QGuiApplication::platformFunction to retrieve the SetParentRelativeBackPixmap function. -*/ - -/*! - \fn void QXcbWindowFunctions::setParentRelativeBackPixmap(const QWindow *window) - - This is a convenience function that can be used directly instead - of resolving the function pointer. \a window will be - relayed to the function retrieved by QGuiApplication. -*/ - -/*! - \typedef QXcbWindowFunctions::RequestSystemTrayWindowDock - - This is the typedef for the function returned by - QGuiApplication::platformFunction when passed the - value returned by requestSystemTrayWindowDockIdentifier(). -*/ - -/*! - \fn const QByteArray QXcbWindowFunctions::requestSystemTrayWindowDockIdentifier() - - This function returns the byte array that can be used to query - QGuiApplication::platformFunction to retrieve the RequestSystemTrayWindowDock function. -*/ - -/*! - \fn bool QXcbWindowFunctions::requestSystemTrayWindowDock(const QWindow *window) - - This is a convenience function that can be used directly instead - of resolving the function pointer. \a window will be - relayed to the function retrieved by QGuiApplication. - - Returns the boolean result of calling the function or false if the - function was not found. -*/ - -/*! - \typedef QXcbWindowFunctions::SystemTrayWindowGlobalGeometry - - This is the typedef for the function returned by - QGuiApplication::platformFunction when passed the - value returned by systemTrayWindowGlobalGeometryIdentifier(). -*/ - -/*! - \fn const QByteArray QXcbWindowFunctions::systemTrayWindowGlobalGeometryIdentifier() - - This function returns the byte array that can be used to query - QGuiApplication::platformFunction to retrieve the SystemTrayWindowGlobalGeometry function. -*/ - -/*! - \fn QRect QXcbWindowFunctions::systemTrayWindowGlobalGeometry(const QWindow *window) - - This is a convenience function that can be used directly instead - of resolving the function pointer. \a window will be - relayed to the function retrieved by QGuiApplication. - - Returns the QRect result of calling the function or an empty - QRect if the function was not found. -*/ - /*! \typedef QXcbWindowFunctions::VisualId diff --git a/src/platformheaders/xcbfunctions/xcbfunctions.pri b/src/platformheaders/xcbfunctions/xcbfunctions.pri index 3f2bcb2b34..3fbee53854 100644 --- a/src/platformheaders/xcbfunctions/xcbfunctions.pri +++ b/src/platformheaders/xcbfunctions/xcbfunctions.pri @@ -1,4 +1,3 @@ HEADERS += \ $$PWD/qxcbwindowfunctions.h \ - $$PWD/qxcbintegrationfunctions.h \ $$PWD/qxcbscreenfunctions.h -- cgit v1.2.3