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 { | ||
▲ Show 20 Lines • Show All 168 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 | | ||
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(); | ||
400 | markAsMapped(); | ||||
graesslin: why did you swap those two lines? | |||||
398 | doSetGeometry(QRect(geom.topLeft(), m_clientSize)); | 401 | doSetGeometry(QRect(geom.topLeft(), m_clientSize)); | ||
399 | Toplevel::setInternalFramebufferObject(fbo); | 402 | Toplevel::setInternalFramebufferObject(fbo); | ||
400 | Toplevel::addDamage(QRegion(0, 0, width(), height())); | 403 | Toplevel::addDamage(QRegion(0, 0, width(), height())); | ||
401 | } | 404 | } | ||
402 | 405 | | |||
403 | void ShellClient::markAsMapped() | 406 | void ShellClient::markAsMapped() | ||
404 | { | 407 | { | ||
405 | if (!m_unmapped) { | 408 | if (!m_unmapped) { | ||
▲ Show 20 Lines • Show All 1001 Lines • Show Last 20 Lines |
why did you swap those two lines?