Gentoo Archives: gentoo-commits

From: Jauhien Piatlicki <jauhien@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: lxqt-base/lxqt-panel/files/, lxqt-base/lxqt-panel/
Date: Sat, 02 Jan 2016 23:26:50
Message-Id: 1451777260.8db4e48bfd99254feaa47095a96d3c994b5b454a.jauhien@gentoo
1 commit: 8db4e48bfd99254feaa47095a96d3c994b5b454a
2 Author: Jauhien Piatlicki <jauhien <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 2 23:24:32 2016 +0000
4 Commit: Jauhien Piatlicki <jauhien <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 2 23:27:40 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8db4e48b
7
8 lxqt-base/lxqt-panel: backport fix for LXQT issue 871
9
10 See https://github.com/lxde/lxqt/issues/871
11 and https://github.com/lxde/lxqt-panel/pull/275
12
13 Package-Manager: portage-2.2.26
14
15 .../files/lxqt-panel-0.10.0-autohide.patch | 625 +++++++++++++++++++++
16 lxqt-base/lxqt-panel/lxqt-panel-0.10.0-r1.ebuild | 82 +++
17 2 files changed, 707 insertions(+)
18
19 diff --git a/lxqt-base/lxqt-panel/files/lxqt-panel-0.10.0-autohide.patch b/lxqt-base/lxqt-panel/files/lxqt-panel-0.10.0-autohide.patch
20 new file mode 100644
21 index 0000000..5f2bbda
22 --- /dev/null
23 +++ b/lxqt-base/lxqt-panel/files/lxqt-panel-0.10.0-autohide.patch
24 @@ -0,0 +1,625 @@
25 +Patch for autohide issue https://github.com/lxde/lxqt/issues/871
26 +taken from https://github.com/lxde/lxqt-panel/pull/275
27 +
28 +diff --git panel/CMakeLists.txt panel/CMakeLists.txt
29 +index 4e23b53..a7f8176 100644
30 +--- panel/CMakeLists.txt
31 ++++ panel/CMakeLists.txt
32 +@@ -2,6 +2,7 @@ set(PROJECT lxqt-panel)
33 +
34 + set(PRIV_HEADERS
35 + panelpluginsmodel.h
36 ++ windownotifier.h
37 + lxqtpanel.h
38 + lxqtpanelapplication.h
39 + lxqtpanellayout.h
40 +@@ -26,6 +27,7 @@ set(PUB_HEADERS
41 + set(SOURCES
42 + main.cpp
43 + panelpluginsmodel.cpp
44 ++ windownotifier.cpp
45 + lxqtpanel.cpp
46 + lxqtpanelapplication.cpp
47 + lxqtpanellayout.cpp
48 +diff --git panel/ilxqtpanel.h panel/ilxqtpanel.h
49 +index e7b2844..71e4990 100644
50 +--- panel/ilxqtpanel.h
51 ++++ panel/ilxqtpanel.h
52 +@@ -32,6 +32,7 @@
53 + #include "lxqtpanelglobals.h"
54 +
55 + class ILXQtPanelPlugin;
56 ++class QWidget;
57 +
58 + /**
59 + **/
60 +@@ -74,6 +75,17 @@ public:
61 + **/
62 + virtual QRect calculatePopupWindowPos(const QPoint &absolutePos, const QSize &windowSize) const = 0;
63 + virtual QRect calculatePopupWindowPos(const ILXQtPanelPlugin *plugin, const QSize &windowSize) const = 0;
64 ++
65 ++ /*!
66 ++ * \brief By calling this function plugin (or any other object) notifies the panel
67 ++ * about showing a (standalone) window/menu -> panel needs this to avoid "hiding" in case any
68 ++ * standalone window is shown. The widget must be shown later than this notification call because
69 ++ * panel need to observe it's show/hide/close events.
70 ++ *
71 ++ * \param w the shown window
72 ++ *
73 ++ */
74 ++ virtual void willShowWindow(QWidget * w) = 0;
75 + };
76 +
77 + #endif // ILXQTPANEL_H
78 +diff --git panel/ilxqtpanelplugin.h panel/ilxqtpanelplugin.h
79 +index 1503923..3a09def 100644
80 +--- panel/ilxqtpanelplugin.h
81 ++++ panel/ilxqtpanelplugin.h
82 +@@ -186,6 +186,16 @@ public:
83 + return mPanel->calculatePopupWindowPos(this, windowSize);
84 + }
85 +
86 ++ /*!
87 ++ * \brief By calling this function plugin notifies the panel about showing a (standalone) window/menu.
88 ++ *
89 ++ * \param w the shown window
90 ++ *
91 ++ */
92 ++ inline void willShowWindow(QWidget * w)
93 ++ {
94 ++ mPanel->willShowWindow(w);
95 ++ }
96 +
97 + virtual bool isSeparate() const { return false; }
98 + virtual bool isExpandable() const { return false; }
99 +diff --git panel/lxqtpanel.cpp panel/lxqtpanel.cpp
100 +index 5159c15..d6b70ca 100644
101 +--- panel/lxqtpanel.cpp
102 ++++ panel/lxqtpanel.cpp
103 +@@ -35,6 +35,7 @@
104 + #include "popupmenu.h"
105 + #include "plugin.h"
106 + #include "panelpluginsmodel.h"
107 ++#include "windownotifier.h"
108 + #include <LXQt/PluginInfo>
109 +
110 + #include <QScreen>
111 +@@ -116,6 +117,7 @@ LXQtPanel::LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidg
112 + mSettings(settings),
113 + mConfigGroup(configGroup),
114 + mPlugins{nullptr},
115 ++ mStandaloneWindows{new WindowNotifier},
116 + mPanelSize(0),
117 + mIconSize(0),
118 + mLineCount(0),
119 +@@ -175,6 +177,9 @@ LXQtPanel::LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidg
120 + connect(LXQt::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update()));
121 + connect(lxqtApp, SIGNAL(themeChanged()), this, SLOT(realign()));
122 +
123 ++ connect(mStandaloneWindows.data(), &WindowNotifier::firstShown, this, &LXQtPanel::showPanel);
124 ++ connect(mStandaloneWindows.data(), &WindowNotifier::lastHidden, this, &LXQtPanel::hidePanel);
125 ++
126 + readSettings();
127 + // the old position might be on a visible screen
128 + ensureVisible();
129 +@@ -589,6 +594,7 @@ void LXQtPanel::showConfigDialog()
130 + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/);
131 +
132 + mConfigDialog->showConfigPanelPage();
133 ++ mStandaloneWindows->observeWindow(mConfigDialog.data());
134 + mConfigDialog->show();
135 + mConfigDialog->raise();
136 + mConfigDialog->activateWindow();
137 +@@ -608,6 +614,7 @@ void LXQtPanel::showAddPluginDialog()
138 + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/);
139 +
140 + mConfigDialog->showConfigPluginsPage();
141 ++ mStandaloneWindows->observeWindow(mConfigDialog.data());
142 + mConfigDialog->show();
143 + mConfigDialog->raise();
144 + mConfigDialog->activateWindow();
145 +@@ -967,6 +974,7 @@ void LXQtPanel::showPopupMenu(Plugin *plugin)
146 + * of QDesktopWidget::availableGeometry)
147 + */
148 + menu->setGeometry(calculatePopupWindowPos(QCursor::pos(), menu->sizeHint()));
149 ++ willShowWindow(menu);
150 + menu->show();
151 + }
152 +
153 +@@ -1043,6 +1051,14 @@ QRect LXQtPanel::calculatePopupWindowPos(const ILXQtPanelPlugin *plugin, const Q
154 + /************************************************
155 +
156 + ************************************************/
157 ++void LXQtPanel::willShowWindow(QWidget * w)
158 ++{
159 ++ mStandaloneWindows->observeWindow(w);
160 ++}
161 ++
162 ++/************************************************
163 ++
164 ++ ************************************************/
165 + QString LXQtPanel::qssPosition() const
166 + {
167 + return positionToStr(position());
168 +@@ -1107,20 +1123,17 @@ void LXQtPanel::showPanel()
169 +
170 + void LXQtPanel::hidePanel()
171 + {
172 +- if (mHidable && !mHidden)
173 ++ if (mHidable && !mHidden
174 ++ && !geometry().contains(QCursor::pos())
175 ++ && !mStandaloneWindows->isAnyWindowShown()
176 ++ )
177 + mHideTimer.start();
178 + }
179 +
180 + void LXQtPanel::hidePanelWork()
181 + {
182 +- if (mHidable && !mHidden && !geometry().contains(QCursor::pos()))
183 +- {
184 +- mHidden = true;
185 +- setPanelGeometry();
186 +- } else
187 +- {
188 +- mHideTimer.start();
189 +- }
190 ++ mHidden = true;
191 ++ setPanelGeometry();
192 + }
193 +
194 + void LXQtPanel::setHidable(bool hidable, bool save)
195 +@@ -1128,7 +1141,7 @@ void LXQtPanel::setHidable(bool hidable, bool save)
196 + if (mHidable == hidable)
197 + return;
198 +
199 +- mHidable = mHidden = hidable;
200 ++ mHidable = hidable;
201 +
202 + if (save)
203 + saveSettings(true);
204 +diff --git panel/lxqtpanel.h panel/lxqtpanel.h
205 +index 8ff4b8c..990063f 100644
206 +--- panel/lxqtpanel.h
207 ++++ panel/lxqtpanel.h
208 +@@ -48,6 +48,7 @@ class PluginInfo;
209 + class LXQtPanelLayout;
210 + class ConfigPanelDialog;
211 + class PanelPluginsModel;
212 ++class WindowNotifier;
213 +
214 + /*! \brief The LXQtPanel class provides a single lxqt-panel.
215 + */
216 +@@ -80,11 +81,12 @@ public:
217 + void showPopupMenu(Plugin *plugin = 0);
218 +
219 + // ILXQtPanel .........................
220 +- ILXQtPanel::Position position() const { return mPosition; }
221 +- QRect globalGometry() const;
222 ++ ILXQtPanel::Position position() const override { return mPosition; }
223 ++ QRect globalGometry() const override;
224 + Plugin *findPlugin(const ILXQtPanelPlugin *iPlugin) const;
225 +- QRect calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const;
226 +- QRect calculatePopupWindowPos(const ILXQtPanelPlugin *plugin, const QSize &windowSize) const;
227 ++ QRect calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const override;
228 ++ QRect calculatePopupWindowPos(const ILXQtPanelPlugin *plugin, const QSize &windowSize) const override;
229 ++ void willShowWindow(QWidget * w) override;
230 +
231 + // For QSS properties ..................
232 + QString qssPosition() const;
233 +@@ -95,8 +97,8 @@ public:
234 +
235 + // Settings
236 + int panelSize() const { return mPanelSize; }
237 +- int iconSize() const { return mIconSize; }
238 +- int lineCount() const { return mLineCount; }
239 ++ int iconSize() const override { return mIconSize; }
240 ++ int lineCount() const override { return mLineCount; }
241 + int length() const { return mLength; }
242 + bool lengthInPercents() const { return mLengthInPercents; }
243 + LXQtPanel::Alignment alignment() const { return mAlignment; }
244 +@@ -138,8 +140,8 @@ signals:
245 + void pluginRemoved();
246 +
247 + protected:
248 +- bool event(QEvent *event);
249 +- void showEvent(QShowEvent *event);
250 ++ bool event(QEvent *event) override;
251 ++ void showEvent(QShowEvent *event) override;
252 +
253 + public slots:
254 + void showConfigDialog();
255 +@@ -156,6 +158,7 @@ private:
256 + QFrame *LXQtPanelWidget;
257 + QString mConfigGroup;
258 + QScopedPointer<PanelPluginsModel> mPlugins;
259 ++ QScopedPointer<WindowNotifier> mStandaloneWindows; //!< object for storing info if some standalone window is shown (for preventing hide)
260 +
261 + int findAvailableScreen(LXQtPanel::Position position);
262 + void updateWmStrut();
263 +diff --git panel/plugin.cpp panel/plugin.cpp
264 +index a4acc78..be23a8e 100644
265 +--- panel/plugin.cpp
266 ++++ panel/plugin.cpp
267 +@@ -477,6 +477,7 @@ void Plugin::showConfigureDialog()
268 + if (!dialog)
269 + return;
270 +
271 ++ mPanel->willShowWindow(dialog);
272 + dialog->show();
273 + dialog->raise();
274 + dialog->activateWindow();
275 +diff --git panel/windownotifier.cpp panel/windownotifier.cpp
276 +new file mode 100644
277 +index 0000000..0b41057
278 +--- /dev/null
279 ++++ panel/windownotifier.cpp
280 +@@ -0,0 +1,65 @@
281 ++/* BEGIN_COMMON_COPYRIGHT_HEADER
282 ++ * (c)LGPL2+
283 ++ *
284 ++ * LXQt - a lightweight, Qt based, desktop toolset
285 ++ * http://lxqt.org
286 ++ *
287 ++ * Copyright: 2015 LXQt team
288 ++ * Authors:
289 ++ * Palo Kisa <palo.kisa@×××××.com>
290 ++ *
291 ++ * This program or library is free software; you can redistribute it
292 ++ * and/or modify it under the terms of the GNU Lesser General Public
293 ++ * License as published by the Free Software Foundation; either
294 ++ * version 2.1 of the License, or (at your option) any later version.
295 ++ *
296 ++ * This library is distributed in the hope that it will be useful,
297 ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
298 ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
299 ++ * Lesser General Public License for more details.
300 ++
301 ++ * You should have received a copy of the GNU Lesser General
302 ++ * Public License along with this library; if not, write to the
303 ++ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
304 ++ * Boston, MA 02110-1301 USA
305 ++ *
306 ++ * END_COMMON_COPYRIGHT_HEADER */
307 ++
308 ++#include "windownotifier.h"
309 ++#include <QWidget>
310 ++#include <QEvent>
311 ++
312 ++void WindowNotifier::observeWindow(QWidget * w)
313 ++{
314 ++ //installing the same filter object multiple times doesn't harm
315 ++ w->installEventFilter(this);
316 ++}
317 ++
318 ++
319 ++bool WindowNotifier::eventFilter(QObject * watched, QEvent * event)
320 ++{
321 ++ QWidget * widget = qobject_cast<QWidget *>(watched); //we're observing only QWidgetw
322 ++ auto it = std::lower_bound(mShownWindows.begin(), mShownWindows.end(), widget);
323 ++ switch (event->type())
324 ++ {
325 ++ case QEvent::Close:
326 ++ watched->removeEventFilter(this);
327 ++ //no break
328 ++ case QEvent::Hide:
329 ++ Q_ASSERT(mShownWindows.end() != it);
330 ++ mShownWindows.erase(it);
331 ++ if (mShownWindows.isEmpty())
332 ++ emit lastHidden();
333 ++ break;
334 ++ case QEvent::Show:
335 ++ {
336 ++ const bool first_shown = mShownWindows.isEmpty();
337 ++ mShownWindows.insert(it, widget); //we keep the mShownWindows sorted
338 ++ if (first_shown)
339 ++ emit firstShown();
340 ++ }
341 ++ default:
342 ++ break;
343 ++ }
344 ++ return false;
345 ++}
346 +diff --git panel/windownotifier.h panel/windownotifier.h
347 +new file mode 100644
348 +index 0000000..53f2f3f
349 +--- /dev/null
350 ++++ panel/windownotifier.h
351 +@@ -0,0 +1,53 @@
352 ++/* BEGIN_COMMON_COPYRIGHT_HEADER
353 ++ * (c)LGPL2+
354 ++ *
355 ++ * LXQt - a lightweight, Qt based, desktop toolset
356 ++ * http://lxqt.org
357 ++ *
358 ++ * Copyright: 2015 LXQt team
359 ++ * Authors:
360 ++ * Palo Kisa <palo.kisa@×××××.com>
361 ++ *
362 ++ * This program or library is free software; you can redistribute it
363 ++ * and/or modify it under the terms of the GNU Lesser General Public
364 ++ * License as published by the Free Software Foundation; either
365 ++ * version 2.1 of the License, or (at your option) any later version.
366 ++ *
367 ++ * This library is distributed in the hope that it will be useful,
368 ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
369 ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
370 ++ * Lesser General Public License for more details.
371 ++
372 ++ * You should have received a copy of the GNU Lesser General
373 ++ * Public License along with this library; if not, write to the
374 ++ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
375 ++ * Boston, MA 02110-1301 USA
376 ++ *
377 ++ * END_COMMON_COPYRIGHT_HEADER */
378 ++
379 ++#if !defined(WINDOWNOTIFIER_H)
380 ++#define WINDOWNOTIFIER_H
381 ++
382 ++#include <QObject>
383 ++
384 ++class QWidget;
385 ++
386 ++class WindowNotifier : public QObject
387 ++{
388 ++ Q_OBJECT
389 ++public:
390 ++ using QObject::QObject;
391 ++
392 ++ void observeWindow(QWidget * w);
393 ++ inline bool isAnyWindowShown() const { return !mShownWindows.isEmpty(); }
394 ++
395 ++ virtual bool eventFilter(QObject * watched, QEvent * event) override;
396 ++signals:
397 ++ void lastHidden();
398 ++ void firstShown();
399 ++
400 ++private:
401 ++ QList<QWidget *> mShownWindows; //!< known shown windows (sorted)
402 ++};
403 ++
404 ++#endif
405 +diff --git plugin-clock/lxqtclock.cpp plugin-clock/lxqtclock.cpp
406 +index 79c2c17..d4603de 100644
407 +--- plugin-clock/lxqtclock.cpp
408 ++++ plugin-clock/lxqtclock.cpp
409 +@@ -286,6 +286,7 @@ void LXQtClock::activated(ActivationReason reason)
410 + {
411 + QRect pos = calculatePopupWindowPos(mCalendarPopup->size());
412 + mCalendarPopup->move(pos.topLeft());
413 ++ willShowWindow(mCalendarPopup);
414 + mCalendarPopup->show();
415 + }
416 + else
417 +diff --git plugin-directorymenu/directorymenu.cpp plugin-directorymenu/directorymenu.cpp
418 +index 8c5ec28..e332e05 100644
419 +--- plugin-directorymenu/directorymenu.cpp
420 ++++ plugin-directorymenu/directorymenu.cpp
421 +@@ -58,11 +58,11 @@ DirectoryMenu::DirectoryMenu(const ILXQtPanelPluginStartupInfo &startupInfo) :
422 +
423 + DirectoryMenu::~DirectoryMenu()
424 + {
425 +- if(mMenu)
426 +- {
427 +- delete mMenu;
428 +- mMenu = 0;
429 +- }
430 ++ if(mMenu)
431 ++ {
432 ++ delete mMenu;
433 ++ mMenu = 0;
434 ++ }
435 + }
436 +
437 + void DirectoryMenu::showMenu()
438 +@@ -102,67 +102,67 @@ void DirectoryMenu::showMenu()
439 + break;
440 + }
441 +
442 ++ willShowWindow(mMenu);
443 + // Just using Qt`s activateWindow() won't work on some WMs like Kwin.
444 + // Solution is to execute menu 1ms later using timer
445 +- mButton.activateWindow();
446 +- mMenu->exec(QPoint(x, y));
447 ++ mMenu->popup(calculatePopupWindowPos(mMenu->sizeHint()).topLeft());
448 + }
449 +
450 + void DirectoryMenu::buildMenu(const QString& path)
451 + {
452 +- if(mMenu)
453 +- {
454 +- delete mMenu;
455 +- mMenu = 0;
456 +- }
457 ++ if(mMenu)
458 ++ {
459 ++ delete mMenu;
460 ++ mMenu = 0;
461 ++ }
462 +
463 +- mPathStrings.clear();
464 ++ mPathStrings.clear();
465 +
466 +- mMenu = new QMenu();
467 ++ mMenu = new QMenu();
468 +
469 +- addActions(mMenu, path);
470 ++ addActions(mMenu, path);
471 + }
472 +
473 + void DirectoryMenu::openDirectory(const QString& path)
474 + {
475 +- QDesktopServices::openUrl(QUrl("file://" + QDir::toNativeSeparators(path)));
476 ++ QDesktopServices::openUrl(QUrl("file://" + QDir::toNativeSeparators(path)));
477 + }
478 +
479 + void DirectoryMenu::addMenu(QString path)
480 + {
481 +- QSignalMapper* sender = (QSignalMapper* )QObject::sender();
482 +- QMenu* parentMenu = (QMenu*) sender->mapping(path);
483 ++ QSignalMapper* sender = (QSignalMapper* )QObject::sender();
484 ++ QMenu* parentMenu = (QMenu*) sender->mapping(path);
485 +
486 +- if(parentMenu->isEmpty())
487 +- {
488 +- addActions(parentMenu, path);
489 +- }
490 ++ if(parentMenu->isEmpty())
491 ++ {
492 ++ addActions(parentMenu, path);
493 ++ }
494 + }
495 +
496 + void DirectoryMenu::addActions(QMenu* menu, const QString& path)
497 + {
498 +- mPathStrings.push_back(path);
499 ++ mPathStrings.push_back(path);
500 +
501 +- QAction* openDirectoryAction = menu->addAction(XdgIcon::fromTheme("folder"), tr("Open"));
502 +- connect(openDirectoryAction, SIGNAL(triggered()), mOpenDirectorySignalMapper, SLOT(map()));
503 +- mOpenDirectorySignalMapper->setMapping(openDirectoryAction, mPathStrings.back());
504 ++ QAction* openDirectoryAction = menu->addAction(XdgIcon::fromTheme("folder"), tr("Open"));
505 ++ connect(openDirectoryAction, SIGNAL(triggered()), mOpenDirectorySignalMapper, SLOT(map()));
506 ++ mOpenDirectorySignalMapper->setMapping(openDirectoryAction, mPathStrings.back());
507 +
508 +- menu->addSeparator();
509 ++ menu->addSeparator();
510 +
511 +- QDir dir(path);
512 +- QFileInfoList list = dir.entryInfoList();
513 ++ QDir dir(path);
514 ++ QFileInfoList list = dir.entryInfoList();
515 +
516 +- foreach (const QFileInfo& entry, list)
517 ++ foreach (const QFileInfo& entry, list)
518 + {
519 +- if(entry.isDir() && !entry.isHidden())
520 +- {
521 +- mPathStrings.push_back(entry.fileName());
522 ++ if(entry.isDir() && !entry.isHidden())
523 ++ {
524 ++ mPathStrings.push_back(entry.fileName());
525 +
526 +- QMenu* subMenu = menu->addMenu(XdgIcon::fromTheme("folder"), mPathStrings.back());
527 ++ QMenu* subMenu = menu->addMenu(XdgIcon::fromTheme("folder"), mPathStrings.back());
528 +
529 +- connect(subMenu, SIGNAL(aboutToShow()), mMenuSignalMapper, SLOT(map()));
530 +- mMenuSignalMapper->setMapping(subMenu, entry.absoluteFilePath());
531 +- }
532 ++ connect(subMenu, SIGNAL(aboutToShow()), mMenuSignalMapper, SLOT(map()));
533 ++ mMenuSignalMapper->setMapping(subMenu, entry.absoluteFilePath());
534 ++ }
535 + }
536 + }
537 +
538 +diff --git plugin-dom/domplugin.cpp plugin-dom/domplugin.cpp
539 +index ffd05c6..0988a2b 100644
540 +--- plugin-dom/domplugin.cpp
541 ++++ plugin-dom/domplugin.cpp
542 +@@ -51,6 +51,7 @@ void DomPlugin::showDialog()
543 + dialog->setAttribute(Qt::WA_DeleteOnClose);
544 + }
545 +
546 ++ willShowWindow(dialog);
547 + dialog->show();
548 + dialog->activateWindow();
549 + }
550 +diff --git plugin-mainmenu/lxqtmainmenu.cpp plugin-mainmenu/lxqtmainmenu.cpp
551 +index 9673a4f..b9ff6e4 100644
552 +--- plugin-mainmenu/lxqtmainmenu.cpp
553 ++++ plugin-mainmenu/lxqtmainmenu.cpp
554 +@@ -130,6 +130,7 @@ void LXQtMainMenu::showMenu()
555 + if (!mMenu)
556 + return;
557 +
558 ++ willShowWindow(mMenu);
559 + // Just using Qt`s activateWindow() won't work on some WMs like Kwin.
560 + // Solution is to execute menu 1ms later using timer
561 + mMenu->popup(calculatePopupWindowPos(mMenu->sizeHint()).topLeft());
562 +@@ -227,8 +228,6 @@ void LXQtMainMenu::buildMenu()
563 + menu->installEventFilter(this);
564 + connect(menu, &QMenu::aboutToHide, &mHideTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
565 + connect(menu, &QMenu::aboutToShow, &mHideTimer, &QTimer::stop);
566 +- // panel notification (needed in case of auto-hide)
567 +- connect(menu, &QMenu::aboutToHide, dynamic_cast<LXQtPanel *>(panel()), &LXQtPanel::hidePanel);
568 +
569 + QMenu *oldMenu = mMenu;
570 + mMenu = menu;
571 +diff --git plugin-mount/popup.cpp plugin-mount/popup.cpp
572 +index 1c3e7c1..7993681 100644
573 +--- plugin-mount/popup.cpp
574 ++++ plugin-mount/popup.cpp
575 +@@ -90,7 +90,12 @@ Popup::Popup(ILXQtPanelPlugin * plugin, QWidget* parent):
576 +
577 + void Popup::showHide()
578 + {
579 +- setVisible(isHidden());
580 ++ if (isHidden())
581 ++ {
582 ++ mPlugin->willShowWindow(this);
583 ++ show();
584 ++ } else
585 ++ close();
586 + }
587 +
588 + void Popup::onDeviceAdded(QString const & udi)
589 +diff --git plugin-statusnotifier/statusnotifierbutton.cpp plugin-statusnotifier/statusnotifierbutton.cpp
590 +index fb124c6..71cf78f 100644
591 +--- plugin-statusnotifier/statusnotifierbutton.cpp
592 ++++ plugin-statusnotifier/statusnotifierbutton.cpp
593 +@@ -249,8 +249,10 @@ void StatusNotifierButton::mouseReleaseEvent(QMouseEvent *event)
594 + else if (Qt::RightButton == event->button())
595 + {
596 + if (mMenu)
597 +- mMenu->popup(QCursor::pos());
598 +- else
599 ++ {
600 ++ mPlugin->willShowWindow(mMenu);
601 ++ mMenu->popup(mPlugin->calculatePopupWindowPos(mMenu->sizeHint()).topLeft());
602 ++ } else
603 + interface->ContextMenu(QCursor::pos().x(), QCursor::pos().y());
604 + }
605 +
606 +diff --git plugin-taskbar/lxqttaskgroup.cpp plugin-taskbar/lxqttaskgroup.cpp
607 +index 6828216..79e27f5 100644
608 +--- plugin-taskbar/lxqttaskgroup.cpp
609 ++++ plugin-taskbar/lxqttaskgroup.cpp
610 +@@ -84,6 +84,7 @@ void LXQtTaskGroup::contextMenuEvent(QContextMenuEvent *event)
611 + mPreventPopup = false;
612 + });
613 + menu->setGeometry(mPlugin->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menu->sizeHint()));
614 ++ mPlugin->willShowWindow(menu);
615 + menu->show();
616 + }
617 +
618 +@@ -418,6 +419,7 @@ void LXQtTaskGroup::setPopupVisible(bool visible, bool fast)
619 + recalculateFramePosition();
620 + }
621 +
622 ++ mPlugin->willShowWindow(mPopup);
623 + mPopup->show();
624 + emit popupShown(this);
625 + }
626 +diff --git plugin-volume/volumebutton.cpp plugin-volume/volumebutton.cpp
627 +index a738a1a..98b3f10 100644
628 +--- plugin-volume/volumebutton.cpp
629 ++++ plugin-volume/volumebutton.cpp
630 +@@ -133,6 +133,7 @@ void VolumeButton::showVolumeSlider()
631 + m_volumePopup->updateGeometry();
632 + m_volumePopup->adjustSize();
633 + QRect pos = mPlugin->calculatePopupWindowPos(m_volumePopup->size());
634 ++ mPlugin->willShowWindow(m_volumePopup);
635 + m_volumePopup->openAt(pos.topLeft(), Qt::TopLeftCorner);
636 + m_volumePopup->activateWindow();
637 + }
638 +diff --git plugin-worldclock/lxqtworldclock.cpp plugin-worldclock/lxqtworldclock.cpp
639 +index 7386049..8fa795d 100644
640 +--- plugin-worldclock/lxqtworldclock.cpp
641 ++++ plugin-worldclock/lxqtworldclock.cpp
642 +@@ -356,6 +356,7 @@ void LXQtWorldClock::activated(ActivationReason reason)
643 + mPopup->adjustSize();
644 + mPopup->setGeometry(calculatePopupWindowPos(mPopup->size()));
645 +
646 ++ willShowWindow(mPopup);
647 + mPopup->show();
648 + }
649 + else
650
651 diff --git a/lxqt-base/lxqt-panel/lxqt-panel-0.10.0-r1.ebuild b/lxqt-base/lxqt-panel/lxqt-panel-0.10.0-r1.ebuild
652 new file mode 100644
653 index 0000000..3c8e096
654 --- /dev/null
655 +++ b/lxqt-base/lxqt-panel/lxqt-panel-0.10.0-r1.ebuild
656 @@ -0,0 +1,82 @@
657 +# Copyright 1999-2016 Gentoo Foundation
658 +# Distributed under the terms of the GNU General Public License v2
659 +# $Id$
660 +
661 +EAPI=5
662 +inherit cmake-utils
663 +
664 +DESCRIPTION="LXQt desktop panel and plugins"
665 +HOMEPAGE="http://lxqt.org/"
666 +
667 +if [[ ${PV} = *9999* ]]; then
668 + inherit git-r3
669 + EGIT_REPO_URI="git://git.lxde.org/git/lxde/${PN}.git"
670 +else
671 + SRC_URI="https://downloads.lxqt.org/lxqt/${PV}/${P}.tar.xz"
672 + KEYWORDS="~amd64 ~x86"
673 +fi
674 +
675 +LICENSE="GPL-2 LGPL-2.1+"
676 +SLOT="0"
677 +IUSE="+alsa +clock colorpicker cpuload +desktopswitch dom +kbindicator +mainmenu
678 + +mount networkmonitor pulseaudio +quicklaunch screensaver sensors
679 + +showdesktop statusnotifier sysstat +taskbar +tray +volume worldclock"
680 +REQUIRED_USE="volume? ( || ( alsa pulseaudio ) )"
681 +
682 +DEPEND="
683 + dev-libs/glib:2
684 + >=dev-libs/libqtxdg-1.0.0
685 + dev-qt/linguist-tools:5
686 + dev-qt/qtcore:5
687 + dev-qt/qtdbus:5
688 + dev-qt/qtgui:5
689 + dev-qt/qtwidgets:5
690 + dev-qt/qtx11extras:5
691 + dev-qt/qtxml:5
692 + kde-frameworks/kguiaddons:5
693 + kde-frameworks/kwindowsystem:5[X]
694 + >=lxde-base/menu-cache-0.3.3
695 + ~lxqt-base/liblxqt-${PV}
696 + ~lxqt-base/lxqt-globalkeys-${PV}
697 + x11-libs/libX11
698 + cpuload? ( sys-libs/libstatgrab )
699 + kbindicator? ( x11-libs/libxkbcommon )
700 + mount? ( kde-frameworks/solid:5 )
701 + networkmonitor? ( sys-libs/libstatgrab )
702 + sensors? ( sys-apps/lm_sensors )
703 + statusnotifier? ( dev-libs/libdbusmenu-qt[qt5] )
704 + sysstat? ( =lxqt-base/libsysstat-0.3* )
705 + tray? ( x11-libs/libXcomposite
706 + x11-libs/libXdamage
707 + x11-libs/libXrender )
708 + volume? ( alsa? ( media-libs/alsa-lib )
709 + pulseaudio? ( media-sound/pulseaudio ) )"
710 +RDEPEND="${DEPEND}
711 + dev-qt/qtsvg:5
712 + >=lxde-base/lxmenu-data-0.1.2"
713 +
714 +PATCHES=( "${FILESDIR}/${P}-autohide.patch" )
715 +
716 +src_configure() {
717 + local mycmakeargs i y
718 + for i in clock colorpicker cpuload desktopswitch dom kbindicator mainmenu mount \
719 + networkmonitor quicklaunch screensaver sensors showdesktop statusnotifier \
720 + sysstat taskbar tray volume worldclock; do
721 + #Switch to ^^ when we switch to EAPI=6.
722 + #y=${i^^}
723 + y=$(tr '[:lower:]' '[:upper:]' <<< "${i}")
724 + mycmakeargs+=( $(cmake-utils_use ${i} ${y}_PLUGIN) )
725 + done
726 +
727 + if use volume; then
728 + mycmakeargs+=( $(cmake-utils_use alsa VOLUME_USE_ALSA)
729 + $(cmake-utils_use pulseaudio VOLUME_USE_PULSEAUDIO) )
730 + fi
731 +
732 + cmake-utils_src_configure
733 +}
734 +
735 +src_install(){
736 + cmake-utils_src_install
737 + doman panel/man/*.1
738 +}