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

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