Skip to content

Commit

Permalink
panel: Fix reserved space on screen
Browse files Browse the repository at this point in the history
After @fde6b272e2fec87b5567c252bf28fe0348aa9afb calculation of reserved space was broken for
multihead configurations with different particular resolutions.
  • Loading branch information
palinek committed Oct 30, 2015
1 parent acc90ef commit b0965b2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions panel/lxqtpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ void LXQtPanel::updateWmStrut()
if(wid == 0 || !isVisible())
return;

const QRect wholeScreen = QApplication::desktop()->geometry();
const QRect rect = geometry();
// NOTE: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
// Quote from the EWMH spec: " Note that the strut is relative to the screen edge, and not the edge of the xinerama monitor."
Expand All @@ -484,7 +485,7 @@ void LXQtPanel::updateWmStrut()
KWindowSystem::setExtendedStrut(wid,
/* Left */ 0, 0, 0,
/* Right */ 0, 0, 0,
/* Top */ getReserveDimension(), rect.left(), rect.right(),
/* Top */ rect.top() + getReserveDimension(), rect.left(), rect.right(),
/* Bottom */ 0, 0, 0
);
break;
Expand All @@ -494,13 +495,13 @@ void LXQtPanel::updateWmStrut()
/* Left */ 0, 0, 0,
/* Right */ 0, 0, 0,
/* Top */ 0, 0, 0,
/* Bottom */ getReserveDimension(), rect.left(), rect.right()
/* Bottom */ wholeScreen.bottom() - rect.bottom() + getReserveDimension(), rect.left(), rect.right()
);
break;

case LXQtPanel::PositionLeft:
KWindowSystem::setExtendedStrut(wid,
/* Left */ getReserveDimension(), rect.top(), rect.bottom(),
/* Left */ rect.left() + getReserveDimension(), rect.top(), rect.bottom(),
/* Right */ 0, 0, 0,
/* Top */ 0, 0, 0,
/* Bottom */ 0, 0, 0
Expand All @@ -511,7 +512,7 @@ void LXQtPanel::updateWmStrut()
case LXQtPanel::PositionRight:
KWindowSystem::setExtendedStrut(wid,
/* Left */ 0, 0, 0,
/* Right */ getReserveDimension(), rect.top(), rect.bottom(),
/* Right */ wholeScreen.right() - rect.right() + getReserveDimension(), rect.top(), rect.bottom(),
/* Top */ 0, 0, 0,
/* Bottom */ 0, 0, 0
);
Expand Down

0 comments on commit b0965b2

Please sign in to comment.