1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-09 17:18:11 +03:00

KWin issue #2,hiding windows when activies stopped

--in such case under x11, the winIds of the visible
Latte windows are changed and as such the windows
tracking mechanism becomes broken. The code introduced
tries to track the case the update the WM::ignoredWindows
properly
This commit is contained in:
Michail Vourlakos 2019-07-16 13:23:20 +03:00
parent 159861b556
commit c94843c9e6
8 changed files with 39 additions and 13 deletions

View File

@ -58,16 +58,25 @@ Positioner::Positioner(Latte::View *parent)
if (m_corona) {
if (KWindowSystem::isPlatformX11()) {
m_corona->wm()->registerIgnoredWindow(m_view->winId());
m_trackedWindowId = m_view->winId();
m_corona->wm()->registerIgnoredWindow(m_trackedWindowId);
connect(m_view, &Latte::View::forcedShown, this, [&]() {
m_corona->wm()->unregisterIgnoredWindow(m_trackedWindowId);
m_trackedWindowId = m_view->winId();
m_corona->wm()->registerIgnoredWindow(m_trackedWindowId);
});
} else {
connect(m_corona->wm(), &WindowSystem::AbstractWindowInterface::latteWindowAdded, this, [&]() {
if (m_waylandWindowId.isNull()) {
m_waylandWindowId = m_corona->wm()->winIdFor("latte-dock", m_view->geometry());
m_corona->wm()->registerIgnoredWindow(m_waylandWindowId);
if (m_trackedWindowId.isNull()) {
m_trackedWindowId = m_corona->wm()->winIdFor("latte-dock", m_view->geometry());
m_corona->wm()->registerIgnoredWindow(m_trackedWindowId);
}
});
}
/////
m_screenSyncTimer.setInterval(qMax(m_corona->universalSettings()->screenTrackerInterval() - 500, 1000));
connect(m_corona->universalSettings(), &UniversalSettings::screenTrackerIntervalChanged, this, [&]() {
m_screenSyncTimer.setInterval(qMax(m_corona->universalSettings()->screenTrackerInterval() - 500, 1000));
@ -88,7 +97,7 @@ Positioner::Positioner(Latte::View *parent)
Positioner::~Positioner()
{
m_inDelete = true;
m_corona->wm()->unregisterIgnoredWindow(KWindowSystem::isPlatformX11() ? m_view->winId() : m_waylandWindowId);
m_corona->wm()->unregisterIgnoredWindow(m_trackedWindowId);
m_screenSyncTimer.stop();
m_validateGeometryTimer.stop();

View File

@ -125,7 +125,7 @@ private:
Plasma::Types::Location m_goToLocation{Plasma::Types::Floating};
QScreen *m_goToScreen{nullptr};
Latte::WindowSystem::WindowId m_waylandWindowId;
Latte::WindowSystem::WindowId m_trackedWindowId;
};
}

View File

@ -81,7 +81,6 @@ ScreenEdgeGhostWindow::ScreenEdgeGhostWindow(Latte::View *view) :
updateGeometry();
});
if (!KWindowSystem::isPlatformWayland()) {
//! IMPORTANT!!! ::: This fixes a bug when closing an Activity all views from all Activities are
//! disappearing! With this code parts they reappear!!!
@ -106,6 +105,7 @@ ScreenEdgeGhostWindow::ScreenEdgeGhostWindow(Latte::View *view) :
connectionsHack << connect(&m_visibleHackTimer1, &QTimer::timeout, this, [&]() {
if (!m_inDelete && m_latteView && m_latteView->layout() && !isVisible()) {
show();
emit forcedShown();
//qDebug() << "Ghost Edge:: Enforce reshow from timer 1...";
} else {
//qDebug() << "Ghost Edge:: No needed reshow from timer 1...";
@ -115,22 +115,30 @@ ScreenEdgeGhostWindow::ScreenEdgeGhostWindow(Latte::View *view) :
connectionsHack << connect(&m_visibleHackTimer2, &QTimer::timeout, this, [&]() {
if (!m_inDelete && m_latteView && m_latteView->layout() && !isVisible()) {
show();
emit forcedShown();
//qDebug() << "Ghost Edge:: Enforce reshow from timer 2...";
} else {
//qDebug() << "Ghost Edge:: No needed reshow from timer 2...";
}
});
connectionsHack << connect(this, &ScreenEdgeGhostWindow::forcedShown, this, [&]() {
m_corona->wm()->unregisterIgnoredWindow(m_trackedWindowId);
m_trackedWindowId = winId();
m_corona->wm()->registerIgnoredWindow(m_trackedWindowId);
});
}
setupWaylandIntegration();
if (KWindowSystem::isPlatformX11()) {
m_corona->wm()->registerIgnoredWindow(winId());
m_trackedWindowId = winId();
m_corona->wm()->registerIgnoredWindow(m_trackedWindowId);
} else {
connect(m_corona->wm(), &WindowSystem::AbstractWindowInterface::latteWindowAdded, this, [&]() {
if (m_waylandWindowId.isNull()) {
m_waylandWindowId = m_corona->wm()->winIdFor("latte-dock", geometry());
m_corona->wm()->registerIgnoredWindow(m_waylandWindowId);
if (m_trackedWindowId.isNull()) {
m_trackedWindowId = m_corona->wm()->winIdFor("latte-dock", geometry());
m_corona->wm()->registerIgnoredWindow(m_trackedWindowId);
}
});
}
@ -145,7 +153,7 @@ ScreenEdgeGhostWindow::~ScreenEdgeGhostWindow()
{
m_inDelete = true;
m_corona->wm()->unregisterIgnoredWindow(KWindowSystem::isPlatformX11() ? winId() : m_waylandWindowId);
m_corona->wm()->unregisterIgnoredWindow(KWindowSystem::isPlatformX11() ? winId() : m_trackedWindowId);
m_latteView = nullptr;

View File

@ -82,6 +82,7 @@ public:
signals:
void containsMouseChanged(bool contains);
void dragEntered();
void forcedShown(); //[workaround] forced shown to avoid a KWin issue that hides windows when activities are stopped
protected:
bool event(QEvent *ev) override;
@ -116,7 +117,7 @@ private:
QPointer<Latte::Corona> m_corona;
Latte::WindowSystem::WindowId m_waylandWindowId;
Latte::WindowSystem::WindowId m_trackedWindowId;
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
};

View File

@ -914,6 +914,7 @@ void View::setLayout(Layout::GenericLayout *layout)
applyActivitiesToWindows();
//qDebug() << "View:: Enforce reshow from timer 1...";
emit activitiesChanged();
emit forcedShown();
} else {
//qDebug() << "View:: No needed reshow from timer 1...";
}
@ -925,6 +926,7 @@ void View::setLayout(Layout::GenericLayout *layout)
applyActivitiesToWindows();
//qDebug() << "View:: Enforce reshow from timer 2...";
emit activitiesChanged();
emit forcedShown();
} else {
//qDebug() << "View:: No needed reshow from timer 2...";
}

View File

@ -248,6 +248,7 @@ signals:
void editThicknessChanged();
void effectsChanged();
void fontPixelSizeChanged();
void forcedShown(); //[workaround] forced shown to avoid a KWin issue that hides windows when closing activities
void widthChanged();
void heightChanged();
void inEditModeChanged();

View File

@ -25,6 +25,9 @@
#include "tracker/trackerwindows.h"
#include "../lattecorona.h"
// Qt
#include <QDebug>
// KDE
#include <KActivities/Controller>

View File

@ -759,6 +759,7 @@ void Windows::updateHints(Latte::View *view)
if (isTouchingViewEdge(view, winfo) || isTouchingView(view, winfo)) {
if (winfo.isActive()) {
//qDebug() << " ACTIVE-TOUCH :: " << winfo.wid() << " _ " << winfo.appName() << " _ " << winfo.geometry() << " _ " << winfo.display();
foundActiveTouchInCurScreen = true;
activeTouchWinId = winfo.wid();
@ -768,6 +769,7 @@ void Windows::updateHints(Latte::View *view)
maxWinId = winfo.wid();
}
} else {
//qDebug() << " TOUCH :: " << winfo.wid() << " _ " << winfo.appName() << " _ " << winfo.geometry() << " _ " << winfo.display();
foundTouchInCurScreen = true;
touchWinId = winfo.wid();
}