Fix always hidden and unable to popup

This commit is contained in:
reionwong 2021-06-21 15:09:32 +08:00
parent d4a67e6817
commit 83c1e42e85
2 changed files with 12 additions and 6 deletions

View file

@ -85,6 +85,8 @@ bool FakeWindow::event(QEvent *e)
if (!m_delayedMouseTimer.isActive()) { if (!m_delayedMouseTimer.isActive()) {
m_delayedMouseTimer.start(); m_delayedMouseTimer.start();
} }
} else if (e->type() == QEvent::Show) {
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
} }
return QQuickView::event(e); return QQuickView::event(e);

View file

@ -146,8 +146,6 @@ QRect MainWindow::windowRect() const
void MainWindow::resizeWindow() void MainWindow::resizeWindow()
{ {
setGeometry(windowRect()); setGeometry(windowRect());
if (m_settings->visibility() == DockSettings::AlwaysShow)
updateViewStruts(); updateViewStruts();
emit resizingFished(); emit resizingFished();
@ -169,7 +167,11 @@ void MainWindow::initSlideWindow()
void MainWindow::updateViewStruts() void MainWindow::updateViewStruts()
{ {
if (m_settings->visibility() == DockSettings::AlwaysShow) {
XWindowInterface::instance()->setViewStruts(this, m_settings->direction(), geometry()); XWindowInterface::instance()->setViewStruts(this, m_settings->direction(), geometry());
} else {
clearViewStruts();
}
} }
void MainWindow::clearViewStruts() void MainWindow::clearViewStruts()
@ -246,11 +248,13 @@ void MainWindow::onIconSizeChanged()
void MainWindow::onVisibilityChanged() void MainWindow::onVisibilityChanged()
{ {
updateViewStruts();
// Always show // Always show
if (m_settings->visibility() == DockSettings::AlwaysShow) { if (m_settings->visibility() == DockSettings::AlwaysShow) {
setGeometry(windowRect()); setGeometry(windowRect());
setVisible(true); setVisible(true);
updateViewStruts(); // updateViewStruts();
// Delete fakewindow // Delete fakewindow
if (m_fakeWindow) { if (m_fakeWindow) {
@ -260,7 +264,7 @@ void MainWindow::onVisibilityChanged()
// Always hide // Always hide
if (m_settings->visibility() == DockSettings::AlwaysHide) { if (m_settings->visibility() == DockSettings::AlwaysHide) {
clearViewStruts(); // clearViewStruts();
setGeometry(windowRect()); setGeometry(windowRect());
setVisible(false); setVisible(false);