improvements for !compositing mode

--fixed struts gap for !compositing mode in order
to handle the strange kwin behavior. Kwin under
!compositing removes 1px. from the struts specified
by windows
--plenty of fixes concerning automatic coloring
under !compositing mode
pull/5/head
Michail Vourlakos 6 years ago
parent 43a007c39b
commit 8a99a9249b

@ -105,12 +105,17 @@ void XWindowInterface::setViewStruts(QWindow &view, const QRect &rect
const QRect currentScreen {screen->geometry()};
const QRect wholeScreen {{0, 0}, screen->virtualSize()};
//! WORKAROUND in order to fix KWin faulty behavior concerning struts
//! under !compositing mode. Under !compositing mode, kwin removes 1px.
//! from the struts
const int strutsGap = KWindowSystem::compositingActive ? 1 : 2;
switch (location) {
case Plasma::Types::TopEdge: {
const int topOffset {screen->geometry().top()};
strut.top_width = rect.height() + topOffset;
strut.top_start = rect.x();
strut.top_end = rect.x() + rect.width() - 1;
strut.top_end = rect.x() + rect.width() - strutsGap;
break;
}
@ -118,7 +123,7 @@ void XWindowInterface::setViewStruts(QWindow &view, const QRect &rect
const int bottomOffset {wholeScreen.bottom() - currentScreen.bottom()};
strut.bottom_width = rect.height() + bottomOffset;
strut.bottom_start = rect.x();
strut.bottom_end = rect.x() + rect.width() - 1;
strut.bottom_end = rect.x() + rect.width() - strutsGap;
break;
}
@ -126,7 +131,7 @@ void XWindowInterface::setViewStruts(QWindow &view, const QRect &rect
const int leftOffset = {screen->geometry().left()};
strut.left_width = rect.width() + leftOffset;
strut.left_start = rect.y();
strut.left_end = rect.y() + rect.height() - 1;
strut.left_end = rect.y() + rect.height() - strutsGap;
break;
}
@ -134,7 +139,7 @@ void XWindowInterface::setViewStruts(QWindow &view, const QRect &rect
const int rightOffset = {wholeScreen.right() - currentScreen.right()};
strut.right_width = rect.width() + rightOffset;
strut.right_start = rect.y();
strut.right_end = rect.y() + rect.height() - 1;
strut.right_end = rect.y() + rect.height() - strutsGap;
break;
}

@ -238,8 +238,7 @@ Item{
|| ((root.backgroundOnlyOnMaximized
|| plasmoid.configuration.solidBackgroundForMaximized
|| root.disablePanelShadowMaximized
|| root.windowColors !== Latte.Types.NoneWindowColors)
&& Latte.WindowSystem.compositingActive)
|| root.windowColors !== Latte.Types.NoneWindowColors))
}
Connections{

@ -116,7 +116,7 @@ Loader{
readonly property color textColor: {
if (latteView && latteView.managedLayout
&& root.inConfigureAppletsMode
&& !Latte.WindowSystem.compositingActive
&& Latte.WindowSystem.compositingActive
&& root.panelTransparency<40
&& (root.themeColors === Latte.Types.SmartThemeColors)) {
return latteView.managedLayout.textColor;
@ -141,6 +141,10 @@ Loader{
readonly property string scheme: {
if (root.inConfigureAppletsMode && (root.themeColors === Latte.Types.SmartThemeColors)) {
if (!Latte.WindowSystem.compositingActive && applyTheme !== theme) {
return applyTheme.schemeFile;
}
//! in edit mode (that is shown the edit visual without opacity)
//! take care the applets that need a proper color scheme to paint themselves
if ((editModeTextColorIsBright && themeExtended.isLightTheme)

Loading…
Cancel
Save