Changeset View
Changeset View
Standalone View
Standalone View
shell/desktopview.cpp
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | void DesktopView::setScreenToFollow(QScreen *screen) | 82 | void DesktopView::setScreenToFollow(QScreen *screen) | ||
83 | { | 83 | { | ||
84 | if (screen == m_screenToFollow) { | 84 | if (screen == m_screenToFollow) { | ||
85 | return; | 85 | return; | ||
86 | } | 86 | } | ||
87 | 87 | | |||
88 | /*connect(screen, &QObject::destroyed, this, [this]() { | | |||
89 | if (DesktopView::screen()) { | | |||
90 | m_screenToFollow = DesktopView::screen(); | | |||
91 | adaptToScreen(); | | |||
92 | } | | |||
93 | });*/ | | |||
94 | m_screenToFollow = screen; | 88 | m_screenToFollow = screen; | ||
95 | setScreen(screen); | 89 | setScreen(screen); | ||
96 | adaptToScreen(); | 90 | adaptToScreen(); | ||
97 | } | 91 | } | ||
98 | 92 | | |||
99 | QScreen *DesktopView::screenToFollow() const | 93 | QScreen *DesktopView::screenToFollow() const | ||
100 | { | 94 | { | ||
101 | return m_screenToFollow; | 95 | return m_screenToFollow; | ||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | |||||
205 | bool DesktopView::event(QEvent *e) | 199 | bool DesktopView::event(QEvent *e) | ||
206 | { | 200 | { | ||
207 | if (e->type() == QEvent::KeyRelease) { | 201 | if (e->type() == QEvent::KeyRelease) { | ||
208 | QKeyEvent *ke = static_cast<QKeyEvent *>(e); | 202 | QKeyEvent *ke = static_cast<QKeyEvent *>(e); | ||
209 | if (KWindowSystem::showingDesktop() && ke->key() == Qt::Key_Escape) { | 203 | if (KWindowSystem::showingDesktop() && ke->key() == Qt::Key_Escape) { | ||
210 | ShellCorona *c = qobject_cast<ShellCorona *>(corona()); | 204 | ShellCorona *c = qobject_cast<ShellCorona *>(corona()); | ||
211 | if (c) { | 205 | if (c) { | ||
212 | KWindowSystem::setShowingDesktop(false); | 206 | KWindowSystem::setShowingDesktop(false); | ||
213 | } | 207 | } | ||
davidedmundson: if you add this in setScreen you'll reduce a lot of false positive signals on initial… | |||||
when the outputs get switched, setScreen won't happen, the expose event is the only place that is guaranteed to be triggered when this happen mart: when the outputs get switched, setScreen won't happen, the expose event is the only place that… | |||||
214 | } | 208 | } | ||
215 | } else if (e->type() == QEvent::PlatformSurface) { | 209 | } else if (e->type() == QEvent::PlatformSurface) { | ||
216 | if (auto pe = dynamic_cast<QPlatformSurfaceEvent*>(e)) { | 210 | if (auto pe = dynamic_cast<QPlatformSurfaceEvent*>(e)) { | ||
217 | switch (pe->surfaceEventType()) { | 211 | switch (pe->surfaceEventType()) { | ||
218 | case QPlatformSurfaceEvent::SurfaceCreated: | 212 | case QPlatformSurfaceEvent::SurfaceCreated: | ||
219 | setupWaylandIntegration(); | 213 | setupWaylandIntegration(); | ||
220 | ensureWindowType(); | 214 | ensureWindowType(); | ||
221 | break; | 215 | break; | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |
if you add this in setScreen you'll reduce a lot of false positive signals on initial connection/ startup