diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2015-10-30 18:15:18 +0300 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-07-10 20:04:09 +0000 |
commit | 556221d97b6c4ca387ca5535ef8f0a2b0f5b7644 (patch) | |
tree | 8eb0a37a1f3f8abb85af30a508aa3ae487436135 /src/platformheaders | |
parent | 5cf6f51b4c73cb1309279aa42d828097b24aa119 (diff) |
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 <gatis.paeglis@qt.io>
Diffstat (limited to 'src/platformheaders')
4 files changed, 0 insertions, 157 deletions
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 <QtPlatformHeaders/QPlatformHeaderHelper> - -QT_BEGIN_NAMESPACE - -class QXcbIntegrationFunctions -{ -public: - typedef bool (*XEmbedSystemTrayVisualHasAlphaChannel)(); - static const QByteArray xEmbedSystemTrayVisualHasAlphaChannelIdentifier() { return QByteArrayLiteral("XcbXEmbedSystemTrayVisualHasAlphaChannel"); } - static bool xEmbedSystemTrayVisualHasAlphaChannel() - { - return QPlatformHeaderHelper::callPlatformFunction<bool, XEmbedSystemTrayVisualHasAlphaChannel>(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<void, SetWmWindowIconText, QWindow *, const QString &>(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<void, SetParentRelativeBackPixmap, const QWindow *>(setParentRelativeBackPixmapIdentifier(), window); - } - - typedef bool (*RequestSystemTrayWindowDock)(const QWindow *window); - static const QByteArray requestSystemTrayWindowDockIdentifier() { return QByteArrayLiteral("XcbRequestSystemTrayWindowDockIdentifier"); } - static bool requestSystemTrayWindowDock(const QWindow *window) - { - return QPlatformHeaderHelper::callPlatformFunction<bool, RequestSystemTrayWindowDock, const QWindow *>(requestSystemTrayWindowDockIdentifier(), window); - } - - typedef QRect (*SystemTrayWindowGlobalGeometry)(const QWindow *window); - static const QByteArray systemTrayWindowGlobalGeometryIdentifier() { return QByteArrayLiteral("XcbSystemTrayWindowGlobalGeometryIdentifier"); } - static QRect systemTrayWindowGlobalGeometry(const QWindow *window) - { - return QPlatformHeaderHelper::callPlatformFunction<QRect, SystemTrayWindowGlobalGeometry, const QWindow *>(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 @@ -138,81 +138,6 @@ */ /*! - \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 This is the typedef for the function returned by 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 |