Changeset View
Changeset View
Standalone View
Standalone View
ksmserver/shutdowndlg.cpp
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Line(s) | 155 | { | |||
---|---|---|---|---|---|
187 | connect(rootObject(), SIGNAL(rebootRequested2(int)), SLOT(slotReboot(int)) ); | 187 | connect(rootObject(), SIGNAL(rebootRequested2(int)), SLOT(slotReboot(int)) ); | ||
188 | connect(rootObject(), SIGNAL(cancelRequested()), SLOT(reject())); | 188 | connect(rootObject(), SIGNAL(cancelRequested()), SLOT(reject())); | ||
189 | connect(rootObject(), SIGNAL(lockScreenRequested()), SLOT(slotLockScreen())); | 189 | connect(rootObject(), SIGNAL(lockScreenRequested()), SLOT(slotLockScreen())); | ||
190 | 190 | | |||
191 | connect(screen(), &QScreen::geometryChanged, this, [this] { | 191 | connect(screen(), &QScreen::geometryChanged, this, [this] { | ||
192 | setGeometry(screen()->geometry()); | 192 | setGeometry(screen()->geometry()); | ||
193 | }); | 193 | }); | ||
194 | 194 | | |||
195 | //decide in backgroundcontrast wether doing things darker or lighter | ||||
196 | //set backgroundcontrast here, because in QEvent::PlatformSurface | ||||
197 | //is too early and we don't have the root object yet | ||||
198 | const QColor backgroundColor = rootObject() ? rootObject()->property("backgroundColor").value<QColor>() : QColor(); | ||||
199 | KWindowEffects::enableBackgroundContrast(winId(), true, | ||||
broulik: From what I can tell KWin doesn't support different background contrasts, ie. once you click… | |||||
right, i see that the panel gets dark, then suddenly gets ok again as soon i open a panel popup (so reapplies the old contrast on the popup window) this is quite unexpected, as the contrast values are in an atom that should be per window. Martin, any idea on this? mart: right, i see that the panel gets dark, then suddenly gets ok again as soon i open a panel popup… | |||||
200 | 0.4, | ||||
201 | (backgroundColor.value() > 128 ? 1.6 : 0.3), | ||||
202 | 1.7); | ||||
195 | QQuickView::show(); | 203 | QQuickView::show(); | ||
196 | requestActivate(); | 204 | requestActivate(); | ||
197 | 205 | | |||
198 | KWindowSystem::setState(winId(), NET::SkipTaskbar|NET::SkipPager); | 206 | KWindowSystem::setState(winId(), NET::SkipTaskbar|NET::SkipPager); | ||
199 | 207 | | |||
200 | setKeyboardGrabEnabled(true); | 208 | setKeyboardGrabEnabled(true); | ||
201 | } | 209 | } | ||
202 | 210 | | |||
Show All 9 Lines | 219 | // setMask(m_view->mask()); | |||
212 | } | 220 | } | ||
213 | } | 221 | } | ||
214 | 222 | | |||
215 | bool KSMShutdownDlg::event(QEvent *e) | 223 | bool KSMShutdownDlg::event(QEvent *e) | ||
216 | { | 224 | { | ||
217 | if (e->type() == QEvent::PlatformSurface) { | 225 | if (e->type() == QEvent::PlatformSurface) { | ||
218 | if (auto pe = dynamic_cast<QPlatformSurfaceEvent*>(e)) { | 226 | if (auto pe = dynamic_cast<QPlatformSurfaceEvent*>(e)) { | ||
219 | switch (pe->surfaceEventType()) { | 227 | switch (pe->surfaceEventType()) { | ||
220 | case QPlatformSurfaceEvent::SurfaceCreated: | 228 | case QPlatformSurfaceEvent::SurfaceCreated: | ||
broulik: Unrelated | |||||
221 | setupWaylandIntegration(); | 229 | setupWaylandIntegration(); | ||
222 | KWindowEffects::enableBlurBehind(winId(), true); | 230 | KWindowEffects::enableBlurBehind(winId(), true); | ||
223 | break; | 231 | break; | ||
224 | case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed: | 232 | case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed: | ||
225 | delete m_shellSurface; | 233 | delete m_shellSurface; | ||
226 | m_shellSurface = nullptr; | 234 | m_shellSurface = nullptr; | ||
227 | break; | 235 | break; | ||
228 | } | 236 | } | ||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |
From what I can tell KWin doesn't support different background contrasts, ie. once you click Leave you'll change your Panel background contrast.
Bhushan experienced the same when running a plasmoid in plasmoidviewer using a different theme, as soon as a tooltip shows up, it globally changes the contrast.