Blame SOURCES/qt-everywhere-opensource-src-4.8.6-systemtrayicon.patch

e09033
diff -up qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.cpp.systemtrayicon qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.cpp
e09033
--- qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.cpp.systemtrayicon	2014-03-30 15:36:45.000000000 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.cpp	2014-03-31 18:16:39.707974934 -0500
e09033
@@ -158,15 +158,23 @@ void Window::createIconGroupBox()
e09033
     iconComboBox->addItem(QIcon(":/images/bad.svg"), tr("Bad"));
e09033
     iconComboBox->addItem(QIcon(":/images/heart.svg"), tr("Heart"));
e09033
     iconComboBox->addItem(QIcon(":/images/trash.svg"), tr("Trash"));
e09033
+    iconComboBox->addItem(QIcon::fromTheme("system-file-manager"), tr("File Manager"));
e09033
 
e09033
     showIconCheckBox = new QCheckBox(tr("Show icon"));
e09033
     showIconCheckBox->setChecked(true);
e09033
 
e09033
+#if defined(Q_WS_X11)
e09033
+    jitToolTipCheckBox = new QCheckBox(tr("Just In Time Tooltip"));
e09033
+#endif
e09033
+
e09033
     QHBoxLayout *iconLayout = new QHBoxLayout;
e09033
     iconLayout->addWidget(iconLabel);
e09033
     iconLayout->addWidget(iconComboBox);
e09033
     iconLayout->addStretch();
e09033
     iconLayout->addWidget(showIconCheckBox);
e09033
+#if defined(Q_WS_X11)
e09033
+    iconLayout->addWidget(jitToolTipCheckBox);
e09033
+#endif
e09033
     iconGroupBox->setLayout(iconLayout);
e09033
 }
e09033
 
e09033
@@ -254,5 +262,37 @@ void Window::createTrayIcon()
e09033
     trayIconMenu->addAction(quitAction);
e09033
 
e09033
     trayIcon = new QSystemTrayIcon(this);
e09033
+    QByteArray category = qgetenv("SNI_CATEGORY");
e09033
+    if (!category.isEmpty()) {
e09033
+        trayIcon->setProperty("_qt_sni_category", QString::fromLocal8Bit(category));
e09033
+    }
e09033
     trayIcon->setContextMenu(trayIconMenu);
e09033
+
e09033
+#if defined(Q_WS_X11)
e09033
+    trayIcon->installEventFilter(this);
e09033
+#endif
e09033
+}
e09033
+
e09033
+#if defined(Q_WS_X11)
e09033
+bool Window::eventFilter(QObject *, QEvent *event)
e09033
+{
e09033
+    switch(event->type()) {
e09033
+    case QEvent::ToolTip:
e09033
+        if (jitToolTipCheckBox->isChecked()) {
e09033
+            QString timeString = QTime::currentTime().toString();
e09033
+            trayIcon->setToolTip(tr("Current Time: %1").arg(timeString));
e09033
+        }
e09033
+        break;
e09033
+    case QEvent::Wheel: {
e09033
+        QWheelEvent *wheelEvent = static_cast<QWheelEvent*>(event);
e09033
+        int delta = wheelEvent->delta() > 0 ? 1 : -1;
e09033
+        int index = (iconComboBox->currentIndex() + delta) % iconComboBox->count();
e09033
+        iconComboBox->setCurrentIndex(index);
e09033
+        break;
e09033
+    }
e09033
+    default:
e09033
+        break;
e09033
+    }
e09033
+    return false;
e09033
 }
e09033
+#endif
e09033
diff -up qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.h.systemtrayicon qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.h
e09033
--- qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.h.systemtrayicon	2014-03-30 15:36:45.000000000 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/examples/desktop/systray/window.h	2014-03-31 18:16:39.707974934 -0500
e09033
@@ -69,6 +69,9 @@ public:
e09033
 
e09033
 protected:
e09033
     void closeEvent(QCloseEvent *event);
e09033
+#if defined(Q_WS_X11)
e09033
+    bool eventFilter(QObject *object, QEvent *event);
e09033
+#endif
e09033
 
e09033
 private slots:
e09033
     void setIcon(int index);
e09033
@@ -86,6 +89,9 @@ private:
e09033
     QLabel *iconLabel;
e09033
     QComboBox *iconComboBox;
e09033
     QCheckBox *showIconCheckBox;
e09033
+#if defined(Q_WS_X11)
e09033
+    QCheckBox *jitToolTipCheckBox;
e09033
+#endif
e09033
 
e09033
     QGroupBox *messageGroupBox;
e09033
     QLabel *typeLabel;
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys.cpp.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys.cpp
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys.cpp.systemtrayicon	2014-03-31 18:16:39.707974934 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys.cpp	2014-03-31 18:16:39.707974934 -0500
e09033
@@ -0,0 +1,65 @@
e09033
+/****************************************************************************
e09033
+**
e09033
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
e09033
+** All rights reserved.
e09033
+** Contact: Nokia Corporation (qt-info@nokia.com)
e09033
+**
e09033
+** This file is part of the QtGui module of the Qt Toolkit.
e09033
+**
e09033
+** $QT_BEGIN_LICENSE:LGPL$
e09033
+** GNU Lesser General Public License Usage
e09033
+** This file may be used under the terms of the GNU Lesser General Public
e09033
+** License version 2.1 as published by the Free Software Foundation and
e09033
+** appearing in the file LICENSE.LGPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU Lesser
e09033
+** General Public License version 2.1 requirements will be met:
e09033
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
e09033
+**
e09033
+** In addition, as a special exception, Nokia gives you certain additional
e09033
+** rights. These rights are described in the Nokia Qt LGPL Exception
e09033
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
e09033
+**
e09033
+** GNU General Public License Usage
e09033
+** Alternatively, this file may be used under the terms of the GNU General
e09033
+** Public License version 3.0 as published by the Free Software Foundation
e09033
+** and appearing in the file LICENSE.GPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU General
e09033
+** Public License version 3.0 requirements will be met:
e09033
+** http://www.gnu.org/copyleft/gpl.html.
e09033
+**
e09033
+** Other Usage
e09033
+** Alternatively, this file may be used in accordance with the terms and
e09033
+** conditions contained in a signed written agreement between you and Nokia.
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+** $QT_END_LICENSE$
e09033
+**
e09033
+****************************************************************************/
e09033
+#ifndef QT_NO_SYSTEMTRAYICON
e09033
+
e09033
+#include "qabstractsystemtrayiconsys_p.h"
e09033
+
e09033
+
e09033
+QSystemTrayIconSysFactoryInterface::QSystemTrayIconSysFactoryInterface()
e09033
+{
e09033
+}
e09033
+
e09033
+/////////////////////////////////////////////////
e09033
+QAbstractSystemTrayIconSys::QAbstractSystemTrayIconSys(QSystemTrayIcon *icon)
e09033
+: trayIcon(icon)
e09033
+{
e09033
+}
e09033
+
e09033
+QAbstractSystemTrayIconSys::~QAbstractSystemTrayIconSys()
e09033
+{
e09033
+}
e09033
+
e09033
+void QAbstractSystemTrayIconSys::sendActivated(QSystemTrayIcon::ActivationReason reason)
e09033
+{
e09033
+    qtsystray_sendActivated(trayIcon, reason);
e09033
+}
e09033
+
e09033
+#endif
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys_p.h.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys_p.h
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys_p.h.systemtrayicon	2014-03-31 18:16:39.708974924 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/qabstractsystemtrayiconsys_p.h	2014-03-31 18:16:39.708974924 -0500
e09033
@@ -0,0 +1,106 @@
e09033
+/****************************************************************************
e09033
+**
e09033
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
e09033
+** All rights reserved.
e09033
+** Contact: Nokia Corporation (qt-info@nokia.com)
e09033
+**
e09033
+** This file is part of the QtGui module of the Qt Toolkit.
e09033
+**
e09033
+** $QT_BEGIN_LICENSE:LGPL$
e09033
+** GNU Lesser General Public License Usage
e09033
+** This file may be used under the terms of the GNU Lesser General Public
e09033
+** License version 2.1 as published by the Free Software Foundation and
e09033
+** appearing in the file LICENSE.LGPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU Lesser
e09033
+** General Public License version 2.1 requirements will be met:
e09033
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
e09033
+**
e09033
+** In addition, as a special exception, Nokia gives you certain additional
e09033
+** rights. These rights are described in the Nokia Qt LGPL Exception
e09033
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
e09033
+**
e09033
+** GNU General Public License Usage
e09033
+** Alternatively, this file may be used under the terms of the GNU General
e09033
+** Public License version 3.0 as published by the Free Software Foundation
e09033
+** and appearing in the file LICENSE.GPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU General
e09033
+** Public License version 3.0 requirements will be met:
e09033
+** http://www.gnu.org/copyleft/gpl.html.
e09033
+**
e09033
+** Other Usage
e09033
+** Alternatively, this file may be used in accordance with the terms and
e09033
+** conditions contained in a signed written agreement between you and Nokia.
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+** $QT_END_LICENSE$
e09033
+**
e09033
+****************************************************************************/
e09033
+
e09033
+#ifndef QABSTRACTSYSTEMTRAYICONSYS_P_H
e09033
+#define QABSTRACTSYSTEMTRAYICONSYS_P_H
e09033
+
e09033
+//
e09033
+//  W A R N I N G
e09033
+//  -------------
e09033
+//
e09033
+// This file is not part of the Qt API.  It exists for the convenience
e09033
+// of a number of Qt sources files.  This header file may change from
e09033
+// version to version without notice, or even be removed.
e09033
+//
e09033
+// We mean it.
e09033
+//
e09033
+
e09033
+#ifndef QT_NO_SYSTEMTRAYICON
e09033
+
e09033
+#include <qfactoryinterface.h>
e09033
+#include <qsystemtrayicon.h>
e09033
+
e09033
+class QAbstractSystemTrayIconSys;
e09033
+
e09033
+class Q_GUI_EXPORT QSystemTrayIconSysFactoryInterface : public QObject, public QFactoryInterface
e09033
+{
e09033
+    Q_OBJECT
e09033
+public:
e09033
+    QSystemTrayIconSysFactoryInterface();
e09033
+    virtual QAbstractSystemTrayIconSys * create(QSystemTrayIcon *) = 0;
e09033
+    virtual bool isAvailable() const = 0;
e09033
+
e09033
+    // \reimp
e09033
+    virtual QStringList keys() const { return QStringList() << QLatin1String("default"); }
e09033
+
e09033
+Q_SIGNALS:
e09033
+    void availableChanged(bool);
e09033
+};
e09033
+
e09033
+#define QSystemTrayIconSysFactoryInterface_iid "com.nokia.qt.QSystemTrayIconSysFactoryInterface"
e09033
+Q_DECLARE_INTERFACE(QSystemTrayIconSysFactoryInterface, QSystemTrayIconSysFactoryInterface_iid)
e09033
+
e09033
+class QRect;
e09033
+
e09033
+class Q_GUI_EXPORT QAbstractSystemTrayIconSys
e09033
+{
e09033
+public:
e09033
+    QAbstractSystemTrayIconSys(QSystemTrayIcon *icon);
e09033
+    virtual ~QAbstractSystemTrayIconSys();
e09033
+
e09033
+    virtual QRect geometry() const = 0;
e09033
+    virtual void updateVisibility() = 0;
e09033
+    virtual void updateIcon() = 0;
e09033
+    virtual void updateToolTip() = 0;
e09033
+    virtual void updateMenu() = 0;
e09033
+    virtual void showMessage(const QString &title, const QString &message,
e09033
+                     QSystemTrayIcon::MessageIcon icon, int msecs) = 0;
e09033
+
e09033
+    void sendActivated(QSystemTrayIcon::ActivationReason);
e09033
+
e09033
+protected:
e09033
+    QSystemTrayIcon *trayIcon;
e09033
+};
e09033
+
e09033
+#endif // QT_NO_SYSTEMTRAYICON
e09033
+
e09033
+#endif // QABSTRACTSYSTEMTRAYICONSYS_P_H
e09033
+
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon.cpp.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon.cpp
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon.cpp.systemtrayicon	2014-03-30 15:36:49.000000000 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon.cpp	2014-03-31 18:16:39.708974924 -0500
e09033
@@ -287,12 +287,6 @@ bool QSystemTrayIcon::isVisible() const
e09033
 */
e09033
 bool QSystemTrayIcon::event(QEvent *e)
e09033
 {
e09033
-#if defined(Q_WS_X11)
e09033
-    if (e->type() == QEvent::ToolTip) {
e09033
-        Q_D(QSystemTrayIcon);
e09033
-        return d->sys->deliverToolTipEvent(e);
e09033
-    }
e09033
-#endif
e09033
     return QObject::event(e);
e09033
 }
e09033
 
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_p.h.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_p.h
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_p.h.systemtrayicon	2014-03-30 15:36:49.000000000 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_p.h	2014-03-31 18:16:39.708974924 -0500
e09033
@@ -62,10 +62,17 @@
e09033
 #include "QtGui/qpixmap.h"
e09033
 #include "QtCore/qstring.h"
e09033
 #include "QtCore/qpointer.h"
e09033
+#if defined(Q_WS_X11)
e09033
+#include "QtCore/qset.h"
e09033
+#endif
e09033
 
e09033
 QT_BEGIN_NAMESPACE
e09033
 
e09033
+#if defined(Q_WS_X11)
e09033
+class QAbstractSystemTrayIconSys;
e09033
+#else
e09033
 class QSystemTrayIconSys;
e09033
+#endif
e09033
 class QToolButton;
e09033
 class QLabel;
e09033
 
e09033
@@ -75,6 +82,9 @@ class QSystemTrayIconPrivate : public QO
e09033
 
e09033
 public:
e09033
     QSystemTrayIconPrivate() : sys(0), visible(false) { }
e09033
+    #if defined(Q_WS_X11)
e09033
+    ~QSystemTrayIconPrivate();
e09033
+    #endif
e09033
 
e09033
     void install_sys();
e09033
     void remove_sys();
e09033
@@ -90,7 +100,11 @@ public:
e09033
     QPointer<QMenu> menu;
e09033
     QIcon icon;
e09033
     QString toolTip;
e09033
+    #if defined(Q_WS_X11)
e09033
+    QAbstractSystemTrayIconSys *sys;
e09033
+    #else
e09033
     QSystemTrayIconSys *sys;
e09033
+    #endif
e09033
     bool visible;
e09033
 };
e09033
 
e09033
@@ -123,60 +137,37 @@ private:
e09033
 };
e09033
 
e09033
 #if defined(Q_WS_X11)
e09033
-QT_BEGIN_INCLUDE_NAMESPACE
e09033
-#include <QtCore/qcoreapplication.h>
e09033
-#include <X11/Xlib.h>
e09033
-#include <X11/Xatom.h>
e09033
-#include <X11/Xutil.h>
e09033
-QT_END_INCLUDE_NAMESPACE
e09033
+class QSystemTrayIconSysFactoryInterface;
e09033
 
e09033
-class QSystemTrayIconSys : public QWidget
e09033
+/**
e09033
+ * This class acts as a composite QSystemTrayIconSysFactory: It can create
e09033
+ * instances of QAbstractSystemTrayIconSys* using either a plugin or the
e09033
+ * builtin factory and will cause QSystemTrayIconPrivate to recreate their
e09033
+ * 'sys' instances if the plugin availability changes.
e09033
+ */
e09033
+class QSystemTrayIconSysFactory : public QObject
e09033
 {
e09033
-    friend class QSystemTrayIconPrivate;
e09033
-
e09033
+    Q_OBJECT
e09033
 public:
e09033
-    QSystemTrayIconSys(QSystemTrayIcon *q);
e09033
-    ~QSystemTrayIconSys();
e09033
-    enum {
e09033
-        SYSTEM_TRAY_REQUEST_DOCK = 0,
e09033
-        SYSTEM_TRAY_BEGIN_MESSAGE = 1,
e09033
-        SYSTEM_TRAY_CANCEL_MESSAGE =2
e09033
-    };
e09033
-
e09033
-    void addToTray();
e09033
-    void updateIcon();
e09033
-    XVisualInfo* getSysTrayVisualInfo();
e09033
-
e09033
-    // QObject::event is public but QWidget's ::event() re-implementation
e09033
-    // is protected ;(
e09033
-    inline bool deliverToolTipEvent(QEvent *e)
e09033
-    { return QWidget::event(e); }
e09033
-
e09033
-    static Window sysTrayWindow;
e09033
-    static QList<QSystemTrayIconSys *> trayIcons;
e09033
-    static QCoreApplication::EventFilter oldEventFilter;
e09033
-    static bool sysTrayTracker(void *message, long *result);
e09033
-    static Window locateSystemTray();
e09033
-    static Atom sysTraySelection;
e09033
-    static XVisualInfo sysTrayVisual;
e09033
+    QSystemTrayIconSysFactory();
e09033
+    void registerSystemTrayIconPrivate(QSystemTrayIconPrivate *iconPrivate);
e09033
+    void unregisterSystemTrayIconPrivate(QSystemTrayIconPrivate *iconPrivate);
e09033
 
e09033
-protected:
e09033
-    void paintEvent(QPaintEvent *pe);
e09033
-    void resizeEvent(QResizeEvent *re);
e09033
-    bool x11Event(XEvent *event);
e09033
-    void mousePressEvent(QMouseEvent *event);
e09033
-    void mouseDoubleClickEvent(QMouseEvent *event);
e09033
-#ifndef QT_NO_WHEELEVENT
e09033
-    void wheelEvent(QWheelEvent *event);
e09033
-#endif
e09033
-    bool event(QEvent *e);
e09033
+    QAbstractSystemTrayIconSys *create(QSystemTrayIcon *) const;
e09033
+
e09033
+    bool isAvailable() const;
e09033
+
e09033
+private Q_SLOTS:
e09033
+    void refreshTrayIconPrivates();
e09033
 
e09033
 private:
e09033
-    QPixmap background;
e09033
-    QSystemTrayIcon *q;
e09033
-    Colormap colormap;
e09033
+    QSystemTrayIconSysFactoryInterface *factory() const;
e09033
+    void loadPluginFactory();
e09033
+
e09033
+    QSystemTrayIconSysFactoryInterface *pluginFactory;
e09033
+    QSet<QSystemTrayIconPrivate *> trayIconPrivates;
e09033
 };
e09033
-#endif // Q_WS_X11
e09033
+#endif
e09033
 
e09033
 QT_END_NAMESPACE
e09033
 
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_x11.cpp.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_x11.cpp
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_x11.cpp.systemtrayicon	2014-03-30 15:36:49.000000000 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/qsystemtrayicon_x11.cpp	2014-03-31 18:16:39.709974914 -0500
e09033
@@ -38,311 +38,122 @@
e09033
 ** $QT_END_LICENSE$
e09033
 **
e09033
 ****************************************************************************/
e09033
+#ifndef QT_NO_SYSTEMTRAYICON
e09033
+
e09033
+#include <private/qfactoryloader_p.h>
e09033
 
e09033
-#include "private/qt_x11_p.h"
e09033
-#include "qlabel.h"
e09033
-#include "qx11info_x11.h"
e09033
-#include "qpainter.h"
e09033
-#include "qpixmap.h"
e09033
-#include "qbitmap.h"
e09033
-#include "qevent.h"
e09033
-#include "qapplication.h"
e09033
-#include "qlist.h"
e09033
-#include "qmenu.h"
e09033
-#include "qtimer.h"
e09033
 #include "qsystemtrayicon_p.h"
e09033
-#include "qpaintengine.h"
e09033
+#include "qabstractsystemtrayiconsys_p.h"
e09033
+#include "qcoreapplication.h"
e09033
+#include "qxembedsystemtrayicon_x11_p.h"
e09033
 
e09033
-#ifndef QT_NO_SYSTEMTRAYICON
e09033
 QT_BEGIN_NAMESPACE
e09033
 
e09033
-Window QSystemTrayIconSys::sysTrayWindow = XNone;
e09033
-QList<QSystemTrayIconSys *> QSystemTrayIconSys::trayIcons;
e09033
-QCoreApplication::EventFilter QSystemTrayIconSys::oldEventFilter = 0;
e09033
-Atom QSystemTrayIconSys::sysTraySelection = XNone;
e09033
-XVisualInfo QSystemTrayIconSys::sysTrayVisual = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
e09033
-
e09033
-// Locate the system tray
e09033
-Window QSystemTrayIconSys::locateSystemTray()
e09033
-{
e09033
-    Display *display = QX11Info::display();
e09033
-    if (sysTraySelection == XNone) {
e09033
-        int screen = QX11Info::appScreen();
e09033
-        QString net_sys_tray = QString::fromLatin1("_NET_SYSTEM_TRAY_S%1").arg(screen);
e09033
-        sysTraySelection = XInternAtom(display, net_sys_tray.toLatin1(), False);
e09033
-    }
e09033
-
e09033
-    return XGetSelectionOwner(QX11Info::display(), sysTraySelection);
e09033
-}
e09033
+Q_GLOBAL_STATIC(QSystemTrayIconSysFactory, qt_guiSystemTrayIconSysFactory)
e09033
 
e09033
-XVisualInfo* QSystemTrayIconSys::getSysTrayVisualInfo()
e09033
+QSystemTrayIconSysFactory::QSystemTrayIconSysFactory()
e09033
+: pluginFactory(0)
e09033
 {
e09033
-    Display *display = QX11Info::display();
e09033
-
e09033
-    if (!sysTrayVisual.visual) {
e09033
-        Window win = locateSystemTray();
e09033
-        if (win != XNone) {
e09033
-            Atom actual_type;
e09033
-            int actual_format;
e09033
-            ulong nitems, bytes_remaining;
e09033
-            uchar *data = 0;
e09033
-            int result = XGetWindowProperty(display, win, ATOM(_NET_SYSTEM_TRAY_VISUAL), 0, 1,
e09033
-                                            False, XA_VISUALID, &actual_type,
e09033
-                                            &actual_format, &nitems, &bytes_remaining, &data);
e09033
-            VisualID vid = 0;
e09033
-            if (result == Success && data && actual_type == XA_VISUALID && actual_format == 32 &&
e09033
-                nitems == 1 && bytes_remaining == 0)
e09033
-                vid = *(VisualID*)data;
e09033
-            if (data)
e09033
-                XFree(data);
e09033
-            if (vid == 0)
e09033
-                return 0;
e09033
-
e09033
-            uint mask = VisualIDMask;
e09033
-            XVisualInfo *vi, rvi;
e09033
-            int count;
e09033
-            rvi.visualid = vid;
e09033
-            vi = XGetVisualInfo(display, mask, &rvi, &count);
e09033
-            if (vi) {
e09033
-                sysTrayVisual = vi[0];
e09033
-                XFree((char*)vi);
e09033
-            }
e09033
-            if (sysTrayVisual.depth != 32)
e09033
-                memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
-        }
e09033
-    }
e09033
-
e09033
-    return sysTrayVisual.visual ? &sysTrayVisual : 0;
e09033
 }
e09033
 
e09033
-bool QSystemTrayIconSys::sysTrayTracker(void *message, long *result)
e09033
+void QSystemTrayIconSysFactory::loadPluginFactory()
e09033
 {
e09033
-    bool retval = false;
e09033
-    if (QSystemTrayIconSys::oldEventFilter)
e09033
-        retval = QSystemTrayIconSys::oldEventFilter(message, result);
e09033
-
e09033
-    if (trayIcons.isEmpty())
e09033
-        return retval;
e09033
-
e09033
-    Display *display = QX11Info::display();
e09033
-    XEvent *ev = (XEvent *)message;
e09033
-    if  (ev->type == DestroyNotify && ev->xany.window == sysTrayWindow) {
e09033
-	sysTrayWindow = locateSystemTray();
e09033
-        memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
-        for (int i = 0; i < trayIcons.count(); i++) {
e09033
-            if (sysTrayWindow == XNone) {
e09033
-	        QBalloonTip::hideBalloon();
e09033
-                trayIcons[i]->hide(); // still no luck
e09033
-                trayIcons[i]->destroy();
e09033
-                trayIcons[i]->create();
e09033
-	    } else
e09033
-                trayIcons[i]->addToTray(); // add it to the new tray
e09033
-        }
e09033
-        retval = true;
e09033
-    } else if (ev->type == ClientMessage && sysTrayWindow == XNone) {
e09033
-        static Atom manager_atom = XInternAtom(display, "MANAGER", False);
e09033
-        XClientMessageEvent *cm = (XClientMessageEvent *)message;
e09033
-        if ((cm->message_type == manager_atom) && ((Atom)cm->data.l[1] == sysTraySelection)) {
e09033
-	    sysTrayWindow = cm->data.l[2];
e09033
-            memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
-	    XSelectInput(display, sysTrayWindow, StructureNotifyMask);
e09033
-            for (int i = 0; i < trayIcons.count(); i++) {
e09033
-                trayIcons[i]->addToTray();
e09033
-            }
e09033
-            retval = true;
e09033
-        }
e09033
-    } else if (ev->type == PropertyNotify && ev->xproperty.atom == ATOM(_NET_SYSTEM_TRAY_VISUAL) &&
e09033
-               ev->xproperty.window == sysTrayWindow) {
e09033
-        memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
-        for (int i = 0; i < trayIcons.count(); i++) {
e09033
-            trayIcons[i]->addToTray();
e09033
-        }
e09033
-    }
e09033
-
e09033
-    return retval;
e09033
-}
e09033
-
e09033
-QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *q)
e09033
-    : QWidget(0, Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint),
e09033
-      q(q), colormap(0)
e09033
-{
e09033
-    setAttribute(Qt::WA_AlwaysShowToolTips);
e09033
-    setAttribute(Qt::WA_QuitOnClose, false);
e09033
-    setAttribute(Qt::WA_NoSystemBackground, true);
e09033
-    setAttribute(Qt::WA_PaintOnScreen);
e09033
-
e09033
-    static bool eventFilterAdded = false;
e09033
-    Display *display = QX11Info::display();
e09033
-    if (!eventFilterAdded) {
e09033
-        oldEventFilter = qApp->setEventFilter(sysTrayTracker);
e09033
-	eventFilterAdded = true;
e09033
-	Window root = QX11Info::appRootWindow();
e09033
-        XWindowAttributes attr;
e09033
-        XGetWindowAttributes(display, root, &attr);
e09033
-        if ((attr.your_event_mask & StructureNotifyMask) != StructureNotifyMask) {
e09033
-            (void) QApplication::desktop(); // lame trick to ensure our event mask is not overridden
e09033
-            XSelectInput(display, root, attr.your_event_mask | StructureNotifyMask); // for MANAGER selection
e09033
-        }
e09033
+    if (pluginFactory) {
e09033
+        return;
e09033
     }
e09033
-    if (trayIcons.isEmpty()) {
e09033
-        sysTrayWindow = locateSystemTray();
e09033
-	if (sysTrayWindow != XNone)
e09033
-	    XSelectInput(display, sysTrayWindow, StructureNotifyMask); // track tray events
e09033
+#ifndef QT_NO_LIBRARY
e09033
+    QFactoryLoader loader(QSystemTrayIconSysFactoryInterface_iid, QLatin1String("/systemtrayicon"));
e09033
+    pluginFactory = qobject_cast<QSystemTrayIconSysFactoryInterface *>(loader.instance(QLatin1String("default")));
e09033
+    if (pluginFactory) {
e09033
+        // Set parent to ensure factory destructor is called when application
e09033
+        // is closed
e09033
+        pluginFactory->setParent(QCoreApplication::instance());
e09033
+        connect(pluginFactory, SIGNAL(availableChanged(bool)), SLOT(refreshTrayIconPrivates()));
e09033
     }
e09033
-    trayIcons.append(this);
e09033
-    setMouseTracking(true);
e09033
-#ifndef QT_NO_TOOLTIP
e09033
-    setToolTip(q->toolTip());
e09033
-#endif
e09033
-    if (sysTrayWindow != XNone)
e09033
-        addToTray();
e09033
+#endif // QT_NO_LIBRARY
e09033
 }
e09033
 
e09033
-QSystemTrayIconSys::~QSystemTrayIconSys()
e09033
+QSystemTrayIconSysFactoryInterface *QSystemTrayIconSysFactory::factory() const
e09033
 {
e09033
-    trayIcons.removeAt(trayIcons.indexOf(this));
e09033
-    Display *display = QX11Info::display();
e09033
-    if (trayIcons.isEmpty()) {
e09033
-        if (sysTrayWindow == XNone)
e09033
-            return;
e09033
-        if (display)
e09033
-            XSelectInput(display, sysTrayWindow, 0); // stop tracking the tray
e09033
-        sysTrayWindow = XNone;
e09033
+    if (!pluginFactory) {
e09033
+        const_cast<QSystemTrayIconSysFactory*>(this)->loadPluginFactory();
e09033
     }
e09033
-    if (colormap)
e09033
-        XFreeColormap(display, colormap);
e09033
+    if (pluginFactory && pluginFactory->isAvailable()) {
e09033
+        return pluginFactory;
e09033
+    }
e09033
+    static QXEmbedSystemTrayIconSysFactory def;
e09033
+    return def.isAvailable() ? &def : 0;
e09033
 }
e09033
 
e09033
-void QSystemTrayIconSys::addToTray()
e09033
+void QSystemTrayIconSysFactory::refreshTrayIconPrivates()
e09033
 {
e09033
-    Q_ASSERT(sysTrayWindow != XNone);
e09033
-    Display *display = QX11Info::display();
e09033
-
e09033
-    XVisualInfo *vi = getSysTrayVisualInfo();
e09033
-    if (vi && vi->visual) {
e09033
-        Window root = RootWindow(display, vi->screen);
e09033
-        Window p = root;
e09033
-        if (QWidget *pw = parentWidget())
e09033
-            p = pw->effectiveWinId();
e09033
-        colormap = XCreateColormap(display, root, vi->visual, AllocNone);
e09033
-        XSetWindowAttributes wsa;
e09033
-        wsa.background_pixmap = 0;
e09033
-        wsa.colormap = colormap;
e09033
-        wsa.background_pixel = 0;
e09033
-        wsa.border_pixel = 0;
e09033
-        Window wid = XCreateWindow(display, p, -1, -1, 1, 1,
e09033
-                                   0, vi->depth, InputOutput, vi->visual,
e09033
-                                   CWBackPixmap|CWBackPixel|CWBorderPixel|CWColormap, &wsa;;
e09033
-        create(wid);
e09033
-    } else {
e09033
-        XSetWindowBackgroundPixmap(display, winId(), ParentRelative);
e09033
-    }
e09033
-
e09033
-    // GNOME, NET WM Specification
e09033
-    static Atom netwm_tray_atom = XInternAtom(display, "_NET_SYSTEM_TRAY_OPCODE", False);
e09033
-    long l[5] = { CurrentTime, SYSTEM_TRAY_REQUEST_DOCK, static_cast<long>(winId()), 0, 0 };
e09033
-    XEvent ev;
e09033
-    memset(&ev, 0, sizeof(ev));
e09033
-    ev.xclient.type = ClientMessage;
e09033
-    ev.xclient.window = sysTrayWindow;
e09033
-    ev.xclient.message_type = netwm_tray_atom;
e09033
-    ev.xclient.format = 32;
e09033
-    memcpy((char *)&ev.xclient.data, (const char *) l, sizeof(l));
e09033
-    XSendEvent(display, sysTrayWindow, False, 0, &ev;;
e09033
-    setMinimumSize(22, 22); // required at least on GNOME
e09033
-}
e09033
-
e09033
-void QSystemTrayIconSys::updateIcon()
e09033
-{
e09033
-    update();
e09033
-}
e09033
-
e09033
-void QSystemTrayIconSys::resizeEvent(QResizeEvent *re)
e09033
-{
e09033
-     QWidget::resizeEvent(re);
e09033
-     updateIcon();
e09033
-}
e09033
-
e09033
-void QSystemTrayIconSys::paintEvent(QPaintEvent*)
e09033
-{
e09033
-    QPainter p(this);
e09033
-    if (!getSysTrayVisualInfo()) {
e09033
-        const QRegion oldSystemClip = p.paintEngine()->systemClip();
e09033
-        const QRect clearedRect = oldSystemClip.boundingRect();
e09033
-        XClearArea(QX11Info::display(), winId(), clearedRect.x(), clearedRect.y(),
e09033
-                   clearedRect.width(), clearedRect.height(), False);
e09033
-        QPaintEngine *pe = p.paintEngine();
e09033
-        pe->setSystemClip(clearedRect);
e09033
-        q->icon().paint(&p, rect());
e09033
-        pe->setSystemClip(oldSystemClip);
e09033
-    } else {
e09033
-        p.setCompositionMode(QPainter::CompositionMode_Source);
e09033
-        p.fillRect(rect(), Qt::transparent);
e09033
-        p.setCompositionMode(QPainter::CompositionMode_SourceOver);
e09033
-        q->icon().paint(&p, rect());
e09033
+    Q_FOREACH(QSystemTrayIconPrivate *trayIconPrivate, trayIconPrivates) {
e09033
+        if (trayIconPrivate->sys) {
e09033
+            delete trayIconPrivate->sys;
e09033
+            trayIconPrivate->sys = 0;
e09033
+        }
e09033
+        // When visible is true, sys is usually not 0 but it can be 0 if the
e09033
+        // call to install_sys() failed.
e09033
+        if (trayIconPrivate->visible) {
e09033
+            trayIconPrivate->install_sys();
e09033
+        }
e09033
     }
e09033
 }
e09033
 
e09033
-void QSystemTrayIconSys::mousePressEvent(QMouseEvent *ev)
e09033
+void QSystemTrayIconSysFactory::registerSystemTrayIconPrivate(QSystemTrayIconPrivate* trayIconPrivate)
e09033
 {
e09033
-    QPoint globalPos = ev->globalPos();
e09033
-    if (ev->button() == Qt::RightButton && q->contextMenu())
e09033
-        q->contextMenu()->popup(globalPos);
e09033
-
e09033
-    if (QBalloonTip::isBalloonVisible()) {
e09033
-        emit q->messageClicked();
e09033
-        QBalloonTip::hideBalloon();
e09033
-    }
e09033
-
e09033
-    if (ev->button() == Qt::LeftButton)
e09033
-        emit q->activated(QSystemTrayIcon::Trigger);
e09033
-    else if (ev->button() == Qt::RightButton)
e09033
-        emit q->activated(QSystemTrayIcon::Context);
e09033
-    else if (ev->button() == Qt::MidButton)
e09033
-        emit q->activated(QSystemTrayIcon::MiddleClick);
e09033
+    trayIconPrivates.insert(trayIconPrivate);
e09033
 }
e09033
 
e09033
-void QSystemTrayIconSys::mouseDoubleClickEvent(QMouseEvent *ev)
e09033
+void QSystemTrayIconSysFactory::unregisterSystemTrayIconPrivate(QSystemTrayIconPrivate* trayIconPrivate)
e09033
 {
e09033
-    if (ev->button() == Qt::LeftButton)
e09033
-        emit q->activated(QSystemTrayIcon::DoubleClick);
e09033
+    trayIconPrivates.remove(trayIconPrivate);
e09033
 }
e09033
 
e09033
-#ifndef QT_NO_WHEELEVENT
e09033
-void QSystemTrayIconSys::wheelEvent(QWheelEvent *e)
e09033
+QAbstractSystemTrayIconSys *QSystemTrayIconSysFactory::create(QSystemTrayIcon *trayIcon) const
e09033
 {
e09033
-    QApplication::sendEvent(q, e);
e09033
+    QSystemTrayIconSysFactoryInterface *f = factory();
e09033
+    if (!f) {
e09033
+        qWarning("No systemtrayicon available");
e09033
+        return 0;
e09033
+    }
e09033
+    return f->create(trayIcon);
e09033
 }
e09033
-#endif
e09033
 
e09033
-bool QSystemTrayIconSys::event(QEvent *e)
e09033
+bool QSystemTrayIconSysFactory::isAvailable() const
e09033
 {
e09033
-    if (e->type() == QEvent::ToolTip) {
e09033
-        return QApplication::sendEvent(q, e);
e09033
-    }
e09033
-    return QWidget::event(e);
e09033
+    return factory();
e09033
 }
e09033
 
e09033
-bool QSystemTrayIconSys::x11Event(XEvent *event)
e09033
+////////////////////////////////////////////////
e09033
+QSystemTrayIconPrivate::~QSystemTrayIconPrivate()
e09033
 {
e09033
-    if (event->type == ReparentNotify)
e09033
-        show();
e09033
-    return QWidget::x11Event(event);
e09033
+    qt_guiSystemTrayIconSysFactory()->unregisterSystemTrayIconPrivate(this);
e09033
+    delete sys;
e09033
 }
e09033
 
e09033
-////////////////////////////////////////////////////////////////////////////
e09033
 void QSystemTrayIconPrivate::install_sys()
e09033
 {
e09033
     Q_Q(QSystemTrayIcon);
e09033
-    if (!sys)
e09033
-        sys = new QSystemTrayIconSys(q);
e09033
+    if (!sys) {
e09033
+        // Register ourself even if create() fails: our "sys" will get created
e09033
+        // later by refreshTrayIconPrivates() if a systemtray becomes
e09033
+        // available. This situation can happen for applications which are
e09033
+        // started at login time, while the desktop itself is starting up.
e09033
+        qt_guiSystemTrayIconSysFactory()->registerSystemTrayIconPrivate(this);
e09033
+        sys = qt_guiSystemTrayIconSysFactory()->create(q);
e09033
+        if (!sys) {
e09033
+            return;
e09033
+        }
e09033
+    }
e09033
+    sys->updateVisibility();
e09033
 }
e09033
 
e09033
 QRect QSystemTrayIconPrivate::geometry_sys() const
e09033
 {
e09033
-    if (!sys)
e09033
-	return QRect();
e09033
-    return QRect(sys->mapToGlobal(QPoint(0, 0)), sys->size());
e09033
+    if (!sys || !visible)
e09033
+        return QRect();
e09033
+    return sys->geometry();
e09033
 }
e09033
 
e09033
 void QSystemTrayIconPrivate::remove_sys()
e09033
@@ -350,35 +161,35 @@ void QSystemTrayIconPrivate::remove_sys(
e09033
     if (!sys)
e09033
         return;
e09033
     QBalloonTip::hideBalloon();
e09033
-    sys->hide(); // this should do the trick, but...
e09033
-    delete sys; // wm may resize system tray only for DestroyEvents
e09033
-    sys = 0;
e09033
+    sys->updateVisibility();
e09033
 }
e09033
 
e09033
 void QSystemTrayIconPrivate::updateIcon_sys()
e09033
 {
e09033
-    if (!sys)
e09033
+    if (!sys || !visible)
e09033
         return;
e09033
     sys->updateIcon();
e09033
 }
e09033
 
e09033
 void QSystemTrayIconPrivate::updateMenu_sys()
e09033
 {
e09033
-
e09033
+    if (!sys || !visible)
e09033
+        return;
e09033
+    sys->updateMenu();
e09033
 }
e09033
 
e09033
 void QSystemTrayIconPrivate::updateToolTip_sys()
e09033
 {
e09033
-    if (!sys)
e09033
+    if (!sys || !visible)
e09033
         return;
e09033
 #ifndef QT_NO_TOOLTIP
e09033
-    sys->setToolTip(toolTip);
e09033
+    sys->updateToolTip();
e09033
 #endif
e09033
 }
e09033
 
e09033
 bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
e09033
 {
e09033
-    return QSystemTrayIconSys::locateSystemTray() != XNone;
e09033
+    return qt_guiSystemTrayIconSysFactory()->isAvailable();
e09033
 }
e09033
 
e09033
 bool QSystemTrayIconPrivate::supportsMessages_sys()
e09033
@@ -389,12 +200,9 @@ bool QSystemTrayIconPrivate::supportsMes
e09033
 void QSystemTrayIconPrivate::showMessage_sys(const QString &message, const QString &title,
e09033
                                    QSystemTrayIcon::MessageIcon icon, int msecs)
e09033
 {
e09033
-    if (!sys)
e09033
+    if (!sys || !visible)
e09033
         return;
e09033
-    QPoint g = sys->mapToGlobal(QPoint(0, 0));
e09033
-    QBalloonTip::showBalloon(icon, message, title, sys->q,
e09033
-                             QPoint(g.x() + sys->width()/2, g.y() + sys->height()/2),
e09033
-                             msecs);
e09033
+    sys->showMessage(message, title, icon, msecs);
e09033
 }
e09033
 
e09033
 QT_END_NAMESPACE
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11.cpp.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11.cpp
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11.cpp.systemtrayicon	2014-03-31 18:16:39.709974914 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11.cpp	2014-03-31 18:16:39.709974914 -0500
e09033
@@ -0,0 +1,469 @@
e09033
+/****************************************************************************
e09033
+**
e09033
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
e09033
+** All rights reserved.
e09033
+** Contact: Nokia Corporation (qt-info@nokia.com)
e09033
+**
e09033
+** This file is part of the QtGui module of the Qt Toolkit.
e09033
+**
e09033
+** $QT_BEGIN_LICENSE:LGPL$
e09033
+** GNU Lesser General Public License Usage
e09033
+** This file may be used under the terms of the GNU Lesser General Public
e09033
+** License version 2.1 as published by the Free Software Foundation and
e09033
+** appearing in the file LICENSE.LGPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU Lesser
e09033
+** General Public License version 2.1 requirements will be met:
e09033
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
e09033
+**
e09033
+** In addition, as a special exception, Nokia gives you certain additional
e09033
+** rights. These rights are described in the Nokia Qt LGPL Exception
e09033
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
e09033
+**
e09033
+** GNU General Public License Usage
e09033
+** Alternatively, this file may be used under the terms of the GNU General
e09033
+** Public License version 3.0 as published by the Free Software Foundation
e09033
+** and appearing in the file LICENSE.GPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU General
e09033
+** Public License version 3.0 requirements will be met:
e09033
+** http://www.gnu.org/copyleft/gpl.html.
e09033
+**
e09033
+** Other Usage
e09033
+** Alternatively, this file may be used in accordance with the terms and
e09033
+** conditions contained in a signed written agreement between you and Nokia.
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+** $QT_END_LICENSE$
e09033
+**
e09033
+****************************************************************************/
e09033
+#include "qxembedsystemtrayicon_x11_p.h"
e09033
+
e09033
+#ifndef QT_NO_SYSTEMTRAYICON
e09033
+
e09033
+#include "private/qt_x11_p.h"
e09033
+#include "qapplication.h"
e09033
+#include "qevent.h"
e09033
+#include "qlist.h"
e09033
+#include "qmenu.h"
e09033
+#include "qpainter.h"
e09033
+#include "qpaintengine.h"
e09033
+#include "qsystemtrayicon_p.h"
e09033
+#include "qx11info_x11.h"
e09033
+
e09033
+QT_BEGIN_INCLUDE_NAMESPACE
e09033
+#include <QtCore/qcoreapplication.h>
e09033
+#include <X11/Xlib.h>
e09033
+#include <X11/Xatom.h>
e09033
+#include <X11/Xutil.h>
e09033
+QT_END_INCLUDE_NAMESPACE
e09033
+
e09033
+QT_BEGIN_NAMESPACE
e09033
+
e09033
+class QSystemTrayIconWidget : public QWidget
e09033
+{
e09033
+public:
e09033
+    QSystemTrayIconWidget(QSystemTrayIcon *q, QXEmbedSystemTrayIconSys *s);
e09033
+    ~QSystemTrayIconWidget();
e09033
+
e09033
+    static Window locateSystemTray();
e09033
+
e09033
+protected:
e09033
+    void paintEvent(QPaintEvent *pe);
e09033
+    void resizeEvent(QResizeEvent *re);
e09033
+    bool x11Event(XEvent *event);
e09033
+    void mousePressEvent(QMouseEvent *event);
e09033
+    void mouseDoubleClickEvent(QMouseEvent *event);
e09033
+#ifndef QT_NO_WHEELEVENT
e09033
+    void wheelEvent(QWheelEvent *event);
e09033
+#endif
e09033
+    bool event(QEvent *e);
e09033
+
e09033
+private:
e09033
+    enum {
e09033
+        SYSTEM_TRAY_REQUEST_DOCK = 0,
e09033
+        SYSTEM_TRAY_BEGIN_MESSAGE = 1,
e09033
+        SYSTEM_TRAY_CANCEL_MESSAGE =2
e09033
+    };
e09033
+
e09033
+    void addToTray();
e09033
+    static XVisualInfo* getSysTrayVisualInfo();
e09033
+
e09033
+    static Window sysTrayWindow;
e09033
+    static QList<QSystemTrayIconWidget *> trayIcons;
e09033
+    static QCoreApplication::EventFilter oldEventFilter;
e09033
+    static bool sysTrayTracker(void *message, long *result);
e09033
+    static Atom sysTraySelection;
e09033
+    static XVisualInfo sysTrayVisual;
e09033
+
e09033
+    QSystemTrayIcon *q;
e09033
+    QXEmbedSystemTrayIconSys *sys;
e09033
+    Colormap colormap;
e09033
+};
e09033
+
e09033
+Window QSystemTrayIconWidget::sysTrayWindow = XNone;
e09033
+QList<QSystemTrayIconWidget *> QSystemTrayIconWidget::trayIcons;
e09033
+QCoreApplication::EventFilter QSystemTrayIconWidget::oldEventFilter = 0;
e09033
+Atom QSystemTrayIconWidget::sysTraySelection = XNone;
e09033
+XVisualInfo QSystemTrayIconWidget::sysTrayVisual = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
e09033
+
e09033
+QSystemTrayIconWidget::QSystemTrayIconWidget(QSystemTrayIcon* q, QXEmbedSystemTrayIconSys* sys)
e09033
+: QWidget(0, Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint)
e09033
+, q(q)
e09033
+, sys(sys)
e09033
+, colormap(0)
e09033
+{
e09033
+    setAttribute(Qt::WA_AlwaysShowToolTips);
e09033
+    setAttribute(Qt::WA_QuitOnClose, false);
e09033
+    setAttribute(Qt::WA_NoSystemBackground, true);
e09033
+    setAttribute(Qt::WA_PaintOnScreen);
e09033
+    setMouseTracking(true);
e09033
+#ifndef QT_NO_TOOLTIP
e09033
+    setToolTip(q->toolTip());
e09033
+#endif
e09033
+
e09033
+    static bool eventFilterAdded = false;
e09033
+    Display *display = QX11Info::display();
e09033
+    if (!eventFilterAdded) {
e09033
+        oldEventFilter = qApp->setEventFilter(sysTrayTracker);
e09033
+        eventFilterAdded = true;
e09033
+        Window root = QX11Info::appRootWindow();
e09033
+        XWindowAttributes attr;
e09033
+        XGetWindowAttributes(display, root, &attr);
e09033
+        if ((attr.your_event_mask & StructureNotifyMask) != StructureNotifyMask) {
e09033
+            (void) QApplication::desktop(); // lame trick to ensure our event mask is not overridden
e09033
+            XSelectInput(display, root, attr.your_event_mask | StructureNotifyMask); // for MANAGER selection
e09033
+        }
e09033
+    }
e09033
+    if (trayIcons.isEmpty()) {
e09033
+        sysTrayWindow = locateSystemTray();
e09033
+        if (sysTrayWindow != XNone)
e09033
+            XSelectInput(display, sysTrayWindow, StructureNotifyMask); // track tray events
e09033
+    }
e09033
+    trayIcons.append(this);
e09033
+    if (sysTrayWindow != XNone)
e09033
+        addToTray();
e09033
+}
e09033
+
e09033
+QSystemTrayIconWidget::~QSystemTrayIconWidget()
e09033
+{
e09033
+    trayIcons.removeAt(trayIcons.indexOf(this));
e09033
+    Display *display = QX11Info::display();
e09033
+    if (trayIcons.isEmpty()) {
e09033
+        if (sysTrayWindow == XNone)
e09033
+            return;
e09033
+        if (display)
e09033
+            XSelectInput(display, sysTrayWindow, 0); // stop tracking the tray
e09033
+        sysTrayWindow = XNone;
e09033
+    }
e09033
+    if (colormap)
e09033
+        XFreeColormap(display, colormap);
e09033
+}
e09033
+
e09033
+void QSystemTrayIconWidget::resizeEvent(QResizeEvent *re)
e09033
+{
e09033
+    QWidget::resizeEvent(re);
e09033
+    update();
e09033
+}
e09033
+
e09033
+void QSystemTrayIconWidget::paintEvent(QPaintEvent*)
e09033
+{
e09033
+    QPainter p(this);
e09033
+    if (!getSysTrayVisualInfo()) {
e09033
+        const QRegion oldSystemClip = p.paintEngine()->systemClip();
e09033
+        const QRect clearedRect = oldSystemClip.boundingRect();
e09033
+        XClearArea(QX11Info::display(), winId(), clearedRect.x(), clearedRect.y(),
e09033
+                   clearedRect.width(), clearedRect.height(), False);
e09033
+        QPaintEngine *pe = p.paintEngine();
e09033
+        pe->setSystemClip(clearedRect);
e09033
+        q->icon().paint(&p, rect());
e09033
+        pe->setSystemClip(oldSystemClip);
e09033
+    } else {
e09033
+        p.setCompositionMode(QPainter::CompositionMode_Source);
e09033
+        p.fillRect(rect(), Qt::transparent);
e09033
+        p.setCompositionMode(QPainter::CompositionMode_SourceOver);
e09033
+        q->icon().paint(&p, rect());
e09033
+    }
e09033
+}
e09033
+
e09033
+void QSystemTrayIconWidget::mousePressEvent(QMouseEvent *ev)
e09033
+{
e09033
+    QPoint globalPos = ev->globalPos();
e09033
+    if (ev->button() == Qt::RightButton && q->contextMenu())
e09033
+        q->contextMenu()->popup(globalPos);
e09033
+
e09033
+    if (QBalloonTip::isBalloonVisible()) {
e09033
+        QMetaObject::invokeMethod(q, "messageClicked");
e09033
+        QBalloonTip::hideBalloon();
e09033
+    }
e09033
+
e09033
+    if (ev->button() == Qt::LeftButton)
e09033
+        qtsystray_sendActivated(q, QSystemTrayIcon::Trigger);
e09033
+    else if (ev->button() == Qt::RightButton)
e09033
+        qtsystray_sendActivated(q, QSystemTrayIcon::Context);
e09033
+    else if (ev->button() == Qt::MidButton)
e09033
+        qtsystray_sendActivated(q, QSystemTrayIcon::MiddleClick);
e09033
+}
e09033
+
e09033
+void QSystemTrayIconWidget::mouseDoubleClickEvent(QMouseEvent *ev)
e09033
+{
e09033
+    if (ev->button() == Qt::LeftButton)
e09033
+        qtsystray_sendActivated(q, QSystemTrayIcon::DoubleClick);
e09033
+}
e09033
+
e09033
+#ifndef QT_NO_WHEELEVENT
e09033
+void QSystemTrayIconWidget::wheelEvent(QWheelEvent *e)
e09033
+{
e09033
+    sys->sendWheelEventToTrayIcon(e->delta(), e->orientation());
e09033
+}
e09033
+#endif
e09033
+
e09033
+bool QSystemTrayIconWidget::event(QEvent *e)
e09033
+{
e09033
+    if (e->type() == QEvent::ToolTip) {
e09033
+        sys->sendToolTipEventToTrayIcon();
e09033
+    }
e09033
+    return QWidget::event(e);
e09033
+}
e09033
+
e09033
+bool QSystemTrayIconWidget::x11Event(XEvent *event)
e09033
+{
e09033
+    if (event->type == ReparentNotify)
e09033
+        show();
e09033
+    return QWidget::x11Event(event);
e09033
+}
e09033
+
e09033
+// Locate the system tray
e09033
+Window QSystemTrayIconWidget::locateSystemTray()
e09033
+{
e09033
+    Display *display = QX11Info::display();
e09033
+    if (sysTraySelection == XNone) {
e09033
+        int screen = QX11Info::appScreen();
e09033
+        QString net_sys_tray = QString::fromLatin1("_NET_SYSTEM_TRAY_S%1").arg(screen);
e09033
+        sysTraySelection = XInternAtom(display, net_sys_tray.toLatin1(), False);
e09033
+    }
e09033
+
e09033
+    return XGetSelectionOwner(QX11Info::display(), sysTraySelection);
e09033
+}
e09033
+
e09033
+XVisualInfo* QSystemTrayIconWidget::getSysTrayVisualInfo()
e09033
+{
e09033
+    Display *display = QX11Info::display();
e09033
+
e09033
+    if (!sysTrayVisual.visual) {
e09033
+        Window win = locateSystemTray();
e09033
+        if (win != XNone) {
e09033
+            Atom actual_type;
e09033
+            int actual_format;
e09033
+            ulong nitems, bytes_remaining;
e09033
+            uchar *data = 0;
e09033
+            int result = XGetWindowProperty(display, win, ATOM(_NET_SYSTEM_TRAY_VISUAL), 0, 1,
e09033
+                                            False, XA_VISUALID, &actual_type,
e09033
+                                            &actual_format, &nitems, &bytes_remaining, &data);
e09033
+            VisualID vid = 0;
e09033
+            if (result == Success && data && actual_type == XA_VISUALID && actual_format == 32 &&
e09033
+                nitems == 1 && bytes_remaining == 0)
e09033
+                vid = *(VisualID*)data;
e09033
+            if (data)
e09033
+                XFree(data);
e09033
+            if (vid == 0)
e09033
+                return 0;
e09033
+
e09033
+            uint mask = VisualIDMask;
e09033
+            XVisualInfo *vi, rvi;
e09033
+            int count;
e09033
+            rvi.visualid = vid;
e09033
+            vi = XGetVisualInfo(display, mask, &rvi, &count);
e09033
+            if (vi) {
e09033
+                sysTrayVisual = vi[0];
e09033
+                XFree((char*)vi);
e09033
+            }
e09033
+            if (sysTrayVisual.depth != 32)
e09033
+                memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
+        }
e09033
+    }
e09033
+
e09033
+    return sysTrayVisual.visual ? &sysTrayVisual : 0;
e09033
+}
e09033
+
e09033
+bool QSystemTrayIconWidget::sysTrayTracker(void *message, long *result)
e09033
+{
e09033
+    bool retval = false;
e09033
+    if (QSystemTrayIconWidget::oldEventFilter)
e09033
+        retval = QSystemTrayIconWidget::oldEventFilter(message, result);
e09033
+
e09033
+    if (trayIcons.isEmpty())
e09033
+        return retval;
e09033
+
e09033
+    Display *display = QX11Info::display();
e09033
+    XEvent *ev = (XEvent *)message;
e09033
+    if  (ev->type == DestroyNotify && ev->xany.window == sysTrayWindow) {
e09033
+        sysTrayWindow = locateSystemTray();
e09033
+        memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
+        for (int i = 0; i < trayIcons.count(); i++) {
e09033
+            if (sysTrayWindow == XNone) {
e09033
+                QBalloonTip::hideBalloon();
e09033
+                trayIcons[i]->hide(); // still no luck
e09033
+                trayIcons[i]->destroy();
e09033
+                trayIcons[i]->create();
e09033
+            } else
e09033
+                trayIcons[i]->addToTray(); // add it to the new tray
e09033
+        }
e09033
+        retval = true;
e09033
+    } else if (ev->type == ClientMessage && sysTrayWindow == XNone) {
e09033
+        static Atom manager_atom = XInternAtom(display, "MANAGER", False);
e09033
+        XClientMessageEvent *cm = (XClientMessageEvent *)message;
e09033
+        if ((cm->message_type == manager_atom) && ((Atom)cm->data.l[1] == sysTraySelection)) {
e09033
+            sysTrayWindow = cm->data.l[2];
e09033
+            memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
+            XSelectInput(display, sysTrayWindow, StructureNotifyMask);
e09033
+            for (int i = 0; i < trayIcons.count(); i++) {
e09033
+                trayIcons[i]->addToTray();
e09033
+            }
e09033
+            retval = true;
e09033
+        }
e09033
+    } else if (ev->type == PropertyNotify && ev->xproperty.atom == ATOM(_NET_SYSTEM_TRAY_VISUAL) &&
e09033
+               ev->xproperty.window == sysTrayWindow) {
e09033
+        memset(&sysTrayVisual, 0, sizeof(sysTrayVisual));
e09033
+        for (int i = 0; i < trayIcons.count(); i++) {
e09033
+            trayIcons[i]->addToTray();
e09033
+        }
e09033
+    }
e09033
+
e09033
+    return retval;
e09033
+}
e09033
+
e09033
+void QSystemTrayIconWidget::addToTray()
e09033
+{
e09033
+    Q_ASSERT(sysTrayWindow != XNone);
e09033
+    Display *display = QX11Info::display();
e09033
+
e09033
+    XVisualInfo *vi = getSysTrayVisualInfo();
e09033
+    if (vi && vi->visual) {
e09033
+        Window root = RootWindow(display, vi->screen);
e09033
+        Window p = root;
e09033
+        if (QWidget *pw = parentWidget())
e09033
+            p = pw->effectiveWinId();
e09033
+        colormap = XCreateColormap(display, root, vi->visual, AllocNone);
e09033
+        XSetWindowAttributes wsa;
e09033
+        wsa.background_pixmap = 0;
e09033
+        wsa.colormap = colormap;
e09033
+        wsa.background_pixel = 0;
e09033
+        wsa.border_pixel = 0;
e09033
+        Window wid = XCreateWindow(display, p, -1, -1, 1, 1,
e09033
+                                   0, vi->depth, InputOutput, vi->visual,
e09033
+                                   CWBackPixmap|CWBackPixel|CWBorderPixel|CWColormap, &wsa;;
e09033
+        create(wid);
e09033
+    } else {
e09033
+        XSetWindowBackgroundPixmap(display, winId(), ParentRelative);
e09033
+    }
e09033
+
e09033
+    // GNOME, NET WM Specification
e09033
+    static Atom netwm_tray_atom = XInternAtom(display, "_NET_SYSTEM_TRAY_OPCODE", False);
e09033
+    long l[5] = { CurrentTime, SYSTEM_TRAY_REQUEST_DOCK, static_cast<long>(winId()), 0, 0 };
e09033
+    XEvent ev;
e09033
+    memset(&ev, 0, sizeof(ev));
e09033
+    ev.xclient.type = ClientMessage;
e09033
+    ev.xclient.window = sysTrayWindow;
e09033
+    ev.xclient.message_type = netwm_tray_atom;
e09033
+    ev.xclient.format = 32;
e09033
+    memcpy((char *)&ev.xclient.data, (const char *) l, sizeof(l));
e09033
+    XSendEvent(display, sysTrayWindow, False, 0, &ev;;
e09033
+    setMinimumSize(22, 22); // required at least on GNOME
e09033
+}
e09033
+
e09033
+////////////////////////////////////////////////////////////////////////////
e09033
+QXEmbedSystemTrayIconSys::QXEmbedSystemTrayIconSys(QSystemTrayIcon *q)
e09033
+: QAbstractSystemTrayIconSys(q)
e09033
+, widget(0)
e09033
+{
e09033
+}
e09033
+
e09033
+QXEmbedSystemTrayIconSys::~QXEmbedSystemTrayIconSys()
e09033
+{
e09033
+    delete widget;
e09033
+}
e09033
+
e09033
+QRect QXEmbedSystemTrayIconSys::geometry() const
e09033
+{
e09033
+    if (!widget)
e09033
+        return QRect();
e09033
+    return QRect(widget->mapToGlobal(QPoint(0, 0)), widget->size());
e09033
+}
e09033
+
e09033
+void QXEmbedSystemTrayIconSys::updateIcon()
e09033
+{
e09033
+    if (!widget)
e09033
+        return;
e09033
+    widget->update();
e09033
+}
e09033
+
e09033
+void QXEmbedSystemTrayIconSys::updateToolTip()
e09033
+{
e09033
+    if (!widget)
e09033
+        return;
e09033
+    widget->setToolTip(trayIcon->toolTip());
e09033
+}
e09033
+
e09033
+void QXEmbedSystemTrayIconSys::showMessage(const QString &message, const QString &title,
e09033
+                                   QSystemTrayIcon::MessageIcon icon, int msecs)
e09033
+{
e09033
+    if (!widget)
e09033
+        return;
e09033
+    QPoint point = geometry().center();
e09033
+    QBalloonTip::showBalloon(icon, message, title, trayIcon, point, msecs);
e09033
+}
e09033
+
e09033
+void QXEmbedSystemTrayIconSys::updateVisibility()
e09033
+{
e09033
+    bool visible = trayIcon->isVisible();
e09033
+    if (visible && !widget)
e09033
+        widget = new QSystemTrayIconWidget(trayIcon, this);
e09033
+    else if (!visible && widget) {
e09033
+        delete widget;
e09033
+        widget = 0;
e09033
+    }
e09033
+}
e09033
+
e09033
+void QXEmbedSystemTrayIconSys::sendToolTipEventToTrayIcon()
e09033
+{
e09033
+#ifndef QT_NO_TOOLTIP
e09033
+    // Pass the event through QSystemTrayIcon so that it gets a chance to
e09033
+    // update the tooltip, then asks widget to show the tooltip
e09033
+    Q_ASSERT(widget);
e09033
+    QPoint globalPos = QCursor::pos();
e09033
+    QPoint pos = widget->mapFromGlobal(globalPos);
e09033
+    QHelpEvent event(QEvent::ToolTip, pos, globalPos);
e09033
+    QApplication::sendEvent(trayIcon, &event);
e09033
+#endif
e09033
+}
e09033
+
e09033
+void QXEmbedSystemTrayIconSys::sendWheelEventToTrayIcon(int delta, Qt::Orientation orientation)
e09033
+{
e09033
+#ifndef QT_NO_WHEELEVENT
e09033
+    Q_ASSERT(widget);
e09033
+    QPoint globalPos = QCursor::pos();
e09033
+    QPoint pos = widget->mapFromGlobal(globalPos);
e09033
+    QWheelEvent event(pos, globalPos, delta, Qt::NoButton, Qt::NoModifier, orientation);
e09033
+    QApplication::sendEvent(trayIcon, &event);
e09033
+#endif
e09033
+}
e09033
+
e09033
+void QXEmbedSystemTrayIconSys::updateMenu()
e09033
+{
e09033
+}
e09033
+
e09033
+/////////////////////////////////////////////////////////////
e09033
+QAbstractSystemTrayIconSys * QXEmbedSystemTrayIconSysFactory::create(QSystemTrayIcon *icon)
e09033
+{
e09033
+    return new QXEmbedSystemTrayIconSys(icon);
e09033
+}
e09033
+
e09033
+bool QXEmbedSystemTrayIconSysFactory::isAvailable() const
e09033
+{
e09033
+    return QSystemTrayIconWidget::locateSystemTray() != XNone;
e09033
+}
e09033
+
e09033
+QT_END_NAMESPACE
e09033
+#endif //QT_NO_SYSTEMTRAYICON
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11_p.h.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11_p.h
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11_p.h.systemtrayicon	2014-03-31 18:16:39.709974914 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/qxembedsystemtrayicon_x11_p.h	2014-03-31 18:16:39.709974914 -0500
e09033
@@ -0,0 +1,104 @@
e09033
+/****************************************************************************
e09033
+**
e09033
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
e09033
+** All rights reserved.
e09033
+** Contact: Nokia Corporation (qt-info@nokia.com)
e09033
+**
e09033
+** This file is part of the QtGui module of the Qt Toolkit.
e09033
+**
e09033
+** $QT_BEGIN_LICENSE:LGPL$
e09033
+** GNU Lesser General Public License Usage
e09033
+** This file may be used under the terms of the GNU Lesser General Public
e09033
+** License version 2.1 as published by the Free Software Foundation and
e09033
+** appearing in the file LICENSE.LGPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU Lesser
e09033
+** General Public License version 2.1 requirements will be met:
e09033
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
e09033
+**
e09033
+** In addition, as a special exception, Nokia gives you certain additional
e09033
+** rights. These rights are described in the Nokia Qt LGPL Exception
e09033
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
e09033
+**
e09033
+** GNU General Public License Usage
e09033
+** Alternatively, this file may be used under the terms of the GNU General
e09033
+** Public License version 3.0 as published by the Free Software Foundation
e09033
+** and appearing in the file LICENSE.GPL included in the packaging of this
e09033
+** file. Please review the following information to ensure the GNU General
e09033
+** Public License version 3.0 requirements will be met:
e09033
+** http://www.gnu.org/copyleft/gpl.html.
e09033
+**
e09033
+** Other Usage
e09033
+** Alternatively, this file may be used in accordance with the terms and
e09033
+** conditions contained in a signed written agreement between you and Nokia.
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+**
e09033
+** $QT_END_LICENSE$
e09033
+**
e09033
+****************************************************************************/
e09033
+
e09033
+#ifndef QXEMBEDSYSTEMTRAYICON_X11_P_H
e09033
+#define QXEMBEDSYSTEMTRAYICON_X11_P_H
e09033
+
e09033
+//
e09033
+//  W A R N I N G
e09033
+//  -------------
e09033
+//
e09033
+// This file is not part of the Qt API.  It exists for the convenience
e09033
+// of a number of Qt sources files.  This header file may change from
e09033
+// version to version without notice, or even be removed.
e09033
+//
e09033
+// We mean it.
e09033
+//
e09033
+
e09033
+#ifndef QT_NO_SYSTEMTRAYICON
e09033
+
e09033
+#include "qabstractsystemtrayiconsys_p.h"
e09033
+
e09033
+QT_BEGIN_NAMESPACE
e09033
+
e09033
+class QSystemTrayIconWidget;
e09033
+
e09033
+class QXEmbedSystemTrayIconSys : public QAbstractSystemTrayIconSys
e09033
+{
e09033
+public:
e09033
+    QXEmbedSystemTrayIconSys(QSystemTrayIcon *);
e09033
+    ~QXEmbedSystemTrayIconSys();
e09033
+
e09033
+    QRect geometry() const;
e09033
+
e09033
+    void updateVisibility();
e09033
+
e09033
+    void updateIcon();
e09033
+
e09033
+    void updateToolTip();
e09033
+
e09033
+    void updateMenu();
e09033
+
e09033
+    void showMessage(const QString &message, const QString &title,
e09033
+                     QSystemTrayIcon::MessageIcon icon, int msecs);
e09033
+
e09033
+private:
e09033
+    friend class QSystemTrayIconWidget;
e09033
+    QSystemTrayIconWidget *widget;
e09033
+
e09033
+    void sendToolTipEventToTrayIcon();
e09033
+
e09033
+    void sendWheelEventToTrayIcon(int delta, Qt::Orientation orientation);
e09033
+};
e09033
+
e09033
+struct QXEmbedSystemTrayIconSysFactory : public QSystemTrayIconSysFactoryInterface
e09033
+{
e09033
+    QAbstractSystemTrayIconSys * create(QSystemTrayIcon *trayIcon);
e09033
+    bool isAvailable() const;
e09033
+};
e09033
+
e09033
+
e09033
+QT_END_NAMESPACE
e09033
+
e09033
+#endif // QT_NO_SYSTEMTRAYICON
e09033
+
e09033
+#endif // QXEMBEDSYSTEMTRAYICON_X11_P_H
e09033
+
e09033
diff -up qt-everywhere-opensource-src-4.8.6/src/gui/util/util.pri.systemtrayicon qt-everywhere-opensource-src-4.8.6/src/gui/util/util.pri
e09033
--- qt-everywhere-opensource-src-4.8.6/src/gui/util/util.pri.systemtrayicon	2014-03-30 15:36:49.000000000 -0500
e09033
+++ qt-everywhere-opensource-src-4.8.6/src/gui/util/util.pri	2014-03-31 18:16:39.710974903 -0500
e09033
@@ -29,8 +29,13 @@ wince* {
e09033
 }
e09033
 
e09033
 unix:x11 {
e09033
+		HEADERS += \
e09033
+				util/qabstractsystemtrayiconsys_p.h \
e09033
+				util/qxembedsystemtrayicon_x11_p.h
e09033
 		SOURCES += \
e09033
-				util/qsystemtrayicon_x11.cpp
e09033
+				util/qabstractsystemtrayiconsys.cpp \
e09033
+				util/qsystemtrayicon_x11.cpp \
e09033
+				util/qxembedsystemtrayicon_x11.cpp
e09033
 }
e09033
 
e09033
 embedded|qpa {