Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show panel when showing desktop and hide on overlap enabled #1689

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion panel/lxqtpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,13 @@ LXQtPanel::LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidg
mShowDelayTimer.start();
}
});
connect(KWindowSystem::self(), &KWindowSystem::showingDesktopChanged, this, [this] (bool showing) {
if (showing && mHidable && mHideOnOverlap) {
mHideTimer.stop();
if (mHidden)
mShowDelayTimer.start();
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code may not be compatible with all WMs. It may show the panel on showing desktop but there's no guarantee that the panel is made hidden again on toggling the desktop state when there is an overlap. A WM can show desktop without changing NET::WMGeometry or NET::WMState, as KWin does.

Copy link
Contributor Author

@elviosak elviosak Dec 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code may not be compatible with all WMs.

i tested on kwin, openbox and xfwm4, all of them were showing (actually it was showing panel even without the patch, but didn't when i was reproducing the issue reported), but kwin would autohide again, added a new commit to prevent that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panel is overlapped (and so, hidden) → Desktop is shown → Panel is shown (sadly, by force). So far, so good. But, with this code, there's no guarantee that Panel is hidden again after Desktop is hidden.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Compiz does without needing a patch:

show-desktop.mp4

Compiz removes overlapping and restores it. Another WM may neither remove nor restore it.

}

/************************************************
Expand Down Expand Up @@ -1460,7 +1467,8 @@ void LXQtPanel::hidePanelWork()
{
if (!testAttribute(Qt::WA_UnderMouse))
{
if (!mStandaloneWindows->isAnyWindowShown())
if (!mStandaloneWindows->isAnyWindowShown()
&& !(mHideOnOverlap && KWindowSystem::showingDesktop()))
{
if (!mHideOnOverlap || isPanelOverlapped())
{
Expand Down