set plasma surface every time

This commit is contained in:
Marco Martin 2017-09-14 13:01:07 +02:00
parent 41b4704428
commit 834812e5d9
3 changed files with 16 additions and 3 deletions

View file

@ -70,7 +70,6 @@ PlasmaCore.ColorScope {
if (taskSwitcher.visibility == Window.Hidden && taskSwitcher.offset > -taskSwitcher.height + units.gridUnit && taskSwitcher.tasksCount) { if (taskSwitcher.visibility == Window.Hidden && taskSwitcher.offset > -taskSwitcher.height + units.gridUnit && taskSwitcher.tasksCount) {
taskSwitcher.visible = true; taskSwitcher.visible = true;
} }
plasmoid.nativeInterface.showDesktop = true;
} }
onReleased: { onReleased: {
if (!isDragging) { if (!isDragging) {

View file

@ -119,15 +119,28 @@ QWindow *TaskPanel::panel()
void TaskPanel::setPanel(QWindow *panel) void TaskPanel::setPanel(QWindow *panel)
{ {
using namespace KWayland::Client;
if (panel == m_panel) { if (panel == m_panel) {
return; return;
} }
if (m_panel) {
disconnect(m_panel, &QWindow::visibilityChanged, this, &TaskPanel::updatePanelVisibility);
}
m_panel = panel; m_panel = panel;
connect(m_panel, &QWindow::visibilityChanged, this, &TaskPanel::updatePanelVisibility, Qt::QueuedConnection);
emit panelChanged(); emit panelChanged();
updatePanelVisibility();
}
void TaskPanel::updatePanelVisibility()
{
using namespace KWayland::Client;
if (!m_panel->isVisible()) {
return;
}
Surface *s = Surface::fromWindow(m_panel);
Surface *s = Surface::fromWindow(panel);
if (!s) { if (!s) {
return; return;
} }

View file

@ -72,6 +72,7 @@ Q_SIGNALS:
private: private:
void initWayland(); void initWayland();
void updateActiveWindow(); void updateActiveWindow();
void updatePanelVisibility();
bool m_showingDesktop; bool m_showingDesktop;
QWindow *m_panel = nullptr; QWindow *m_panel = nullptr;
KWayland::Client::PlasmaShellSurface *m_shellSurface = nullptr; KWayland::Client::PlasmaShellSurface *m_shellSurface = nullptr;