Changeset View
Changeset View
Standalone View
Standalone View
shell_client.cpp
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 176 | { | |||
---|---|---|---|---|---|
181 | SurfaceInterface *s = surface(); | 181 | SurfaceInterface *s = surface(); | ||
182 | Q_ASSERT(s); | 182 | Q_ASSERT(s); | ||
183 | if (s->buffer()) { | 183 | if (s->buffer()) { | ||
184 | setReadyForPainting(); | 184 | setReadyForPainting(); | ||
185 | if (shouldExposeToWindowManagement()) { | 185 | if (shouldExposeToWindowManagement()) { | ||
186 | setupWindowManagementInterface(); | 186 | setupWindowManagementInterface(); | ||
187 | } | 187 | } | ||
188 | m_unmapped = false; | 188 | m_unmapped = false; | ||
189 | m_clientSize = s->buffer()->size(); | 189 | m_clientSize = s->size(); | ||
190 | } else { | 190 | } else { | ||
191 | ready_for_painting = false; | 191 | ready_for_painting = false; | ||
192 | } | 192 | } | ||
193 | if (m_internalWindow) { | 193 | if (m_internalWindow) { | ||
194 | updateInternalWindowGeometry(); | 194 | updateInternalWindowGeometry(); | ||
195 | setOnAllDesktops(true); | 195 | setOnAllDesktops(true); | ||
196 | updateDecoration(true); | 196 | updateDecoration(true); | ||
197 | } else { | 197 | } else { | ||
198 | doSetGeometry(QRect(QPoint(0, 0), m_clientSize)); | 198 | doSetGeometry(QRect(QPoint(0, 0), m_clientSize)); | ||
199 | setDesktop(VirtualDesktopManager::self()->current()); | 199 | setDesktop(VirtualDesktopManager::self()->current()); | ||
200 | } | 200 | } | ||
201 | if (waylandServer()->inputMethodConnection() == s->client()) { | 201 | if (waylandServer()->inputMethodConnection() == s->client()) { | ||
202 | m_windowType = NET::OnScreenDisplay; | 202 | m_windowType = NET::OnScreenDisplay; | ||
203 | } | 203 | } | ||
204 | 204 | | |||
205 | connect(s, &SurfaceInterface::sizeChanged, this, | 205 | connect(s, &SurfaceInterface::sizeChanged, this, | ||
206 | [this] { | 206 | [this] { | ||
207 | m_clientSize = surface()->buffer()->size(); | 207 | m_clientSize = surface()->size(); | ||
208 | doSetGeometry(QRect(geom.topLeft(), m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); | 208 | doSetGeometry(QRect(geom.topLeft(), m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); | ||
209 | } | 209 | } | ||
210 | ); | 210 | ); | ||
211 | connect(s, &SurfaceInterface::unmapped, this, &ShellClient::unmap); | 211 | connect(s, &SurfaceInterface::unmapped, this, &ShellClient::unmap); | ||
212 | connect(s, &SurfaceInterface::unbound, this, &ShellClient::destroyClient); | 212 | connect(s, &SurfaceInterface::unbound, this, &ShellClient::destroyClient); | ||
213 | connect(s, &SurfaceInterface::destroyed, this, &ShellClient::destroyClient); | 213 | connect(s, &SurfaceInterface::destroyed, this, &ShellClient::destroyClient); | ||
214 | if (m_shellSurface) { | 214 | if (m_shellSurface) { | ||
215 | initSurface(m_shellSurface); | 215 | initSurface(m_shellSurface); | ||
▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Line(s) | 360 | { | |||
366 | m_opacity = newOpacity; | 366 | m_opacity = newOpacity; | ||
367 | addRepaintFull(); | 367 | addRepaintFull(); | ||
368 | emit opacityChanged(this, oldOpacity); | 368 | emit opacityChanged(this, oldOpacity); | ||
369 | } | 369 | } | ||
370 | 370 | | |||
371 | void ShellClient::addDamage(const QRegion &damage) | 371 | void ShellClient::addDamage(const QRegion &damage) | ||
372 | { | 372 | { | ||
373 | auto s = surface(); | 373 | auto s = surface(); | ||
374 | if (s->buffer()->size().isValid()) { | 374 | if (s->size().isValid()) { | ||
375 | m_clientSize = s->buffer()->size(); | 375 | m_clientSize = s->size(); | ||
376 | QPoint position = geom.topLeft(); | 376 | QPoint position = geom.topLeft(); | ||
377 | if (m_positionAfterResize.isValid()) { | 377 | if (m_positionAfterResize.isValid()) { | ||
378 | addLayerRepaint(geometry()); | 378 | addLayerRepaint(geometry()); | ||
379 | position = m_positionAfterResize.point(); | 379 | position = m_positionAfterResize.point(); | ||
380 | m_positionAfterResize.clear(); | 380 | m_positionAfterResize.clear(); | ||
381 | } | 381 | } | ||
382 | doSetGeometry(QRect(position, m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); | 382 | doSetGeometry(QRect(position, m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); | ||
383 | } | 383 | } | ||
384 | markAsMapped(); | 384 | markAsMapped(); | ||
385 | setDepth((s->buffer()->hasAlphaChannel() && !isDesktop()) ? 32 : 24); | 385 | setDepth((s->buffer()->hasAlphaChannel() && !isDesktop()) ? 32 : 24); | ||
386 | repaints_region += damage.translated(clientPos()); | 386 | repaints_region += damage.translated(clientPos()); | ||
387 | Toplevel::addDamage(damage); | 387 | Toplevel::addDamage(damage); | ||
388 | } | 388 | } | ||
389 | 389 | | |||
390 | void ShellClient::setInternalFramebufferObject(const QSharedPointer<QOpenGLFramebufferObject> &fbo) | 390 | void ShellClient::setInternalFramebufferObject(const QSharedPointer<QOpenGLFramebufferObject> &fbo) | ||
391 | { | 391 | { | ||
392 | if (fbo.isNull()) { | 392 | if (fbo.isNull()) { | ||
393 | unmap(); | 393 | unmap(); | ||
394 | return; | 394 | return; | ||
395 | } | 395 | } | ||
396 | markAsMapped(); | 396 | markAsMapped(); | ||
397 | //Kwin currently scales internal windows to 1, so this is currently always correct | ||||
398 | //when that changes, this needs adjusting | ||||
397 | m_clientSize = fbo->size(); | 399 | m_clientSize = fbo->size(); | ||
398 | doSetGeometry(QRect(geom.topLeft(), m_clientSize)); | 400 | doSetGeometry(QRect(geom.topLeft(), m_clientSize)); | ||
graesslin: why did you swap those two lines? | |||||
399 | Toplevel::setInternalFramebufferObject(fbo); | 401 | Toplevel::setInternalFramebufferObject(fbo); | ||
400 | Toplevel::addDamage(QRegion(0, 0, width(), height())); | 402 | Toplevel::addDamage(QRegion(0, 0, width(), height())); | ||
401 | } | 403 | } | ||
402 | 404 | | |||
403 | void ShellClient::markAsMapped() | 405 | void ShellClient::markAsMapped() | ||
404 | { | 406 | { | ||
405 | if (!m_unmapped) { | 407 | if (!m_unmapped) { | ||
406 | return; | 408 | return; | ||
▲ Show 20 Lines • Show All 1000 Lines • Show Last 20 Lines |
why did you swap those two lines?