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()) {
m_delayedMouseTimer.start();
}
} else if (e->type() == QEvent::Show) {
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
}
return QQuickView::event(e);

View file

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