Changeset View
Changeset View
Standalone View
Standalone View
plugins/kdecorations/aurorae/src/aurorae.cpp
Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Line(s) | 397 | if (m_extendedBorders) { | |||
---|---|---|---|---|---|
400 | }; | 400 | }; | ||
401 | updateExtendedBorders(); | 401 | updateExtendedBorders(); | ||
402 | connect(m_extendedBorders, &KWin::Borders::leftChanged, this, updateExtendedBorders); | 402 | connect(m_extendedBorders, &KWin::Borders::leftChanged, this, updateExtendedBorders); | ||
403 | connect(m_extendedBorders, &KWin::Borders::rightChanged, this, updateExtendedBorders); | 403 | connect(m_extendedBorders, &KWin::Borders::rightChanged, this, updateExtendedBorders); | ||
404 | connect(m_extendedBorders, &KWin::Borders::topChanged, this, updateExtendedBorders); | 404 | connect(m_extendedBorders, &KWin::Borders::topChanged, this, updateExtendedBorders); | ||
405 | connect(m_extendedBorders, &KWin::Borders::bottomChanged, this, updateExtendedBorders); | 405 | connect(m_extendedBorders, &KWin::Borders::bottomChanged, this, updateExtendedBorders); | ||
406 | } | 406 | } | ||
407 | connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection); | 407 | connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection); | ||
408 | connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateBorders); | ||||
cfeck: Do you remember why the other connection needed to be queued? | |||||
Yes, when maximizing it can happen that the deco gets destroyed. It would act like a delete this without the queued connection. With shade this cannot happen, so no need to queue. graesslin: Yes, when maximizing it can happen that the deco gets destroyed. It would act like a delete… | |||||
408 | updateBorders(); | 409 | updateBorders(); | ||
409 | if (!m_view.isNull()) { | 410 | if (!m_view.isNull()) { | ||
410 | auto resizeWindow = [this] { | 411 | auto resizeWindow = [this] { | ||
411 | QRect rect(QPoint(0, 0), size()); | 412 | QRect rect(QPoint(0, 0), size()); | ||
412 | if (m_padding && !client().data()->isMaximized()) { | 413 | if (m_padding && !client().data()->isMaximized()) { | ||
413 | rect = rect.adjusted(-m_padding->left(), -m_padding->top(), m_padding->right(), m_padding->bottom()); | 414 | rect = rect.adjusted(-m_padding->left(), -m_padding->top(), m_padding->right(), m_padding->bottom()); | ||
414 | } | 415 | } | ||
415 | m_view->setGeometry(rect); | 416 | m_view->setGeometry(rect); | ||
416 | }; | 417 | }; | ||
417 | connect(this, &Decoration::bordersChanged, this, resizeWindow); | 418 | connect(this, &Decoration::bordersChanged, this, resizeWindow); | ||
418 | connect(client().data(), &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow); | 419 | connect(client().data(), &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow); | ||
419 | connect(client().data(), &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow); | 420 | connect(client().data(), &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow); | ||
420 | connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow); | 421 | connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow); | ||
422 | connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow); | ||||
421 | resizeWindow(); | 423 | resizeWindow(); | ||
422 | } else { | 424 | } else { | ||
423 | // create a dummy shadow for the configuration interface | 425 | // create a dummy shadow for the configuration interface | ||
424 | if (m_padding) { | 426 | if (m_padding) { | ||
425 | auto s = QSharedPointer<KDecoration2::DecorationShadow>::create(); | 427 | auto s = QSharedPointer<KDecoration2::DecorationShadow>::create(); | ||
426 | s->setPadding(*m_padding); | 428 | s->setPadding(*m_padding); | ||
427 | s->setInnerShadowRect(QRect(m_padding->left(), m_padding->top(), 1, 1)); | 429 | s->setInnerShadowRect(QRect(m_padding->left(), m_padding->top(), 1, 1)); | ||
428 | setShadow(s); | 430 | setShadow(s); | ||
▲ Show 20 Lines • Show All 348 Lines • Show Last 20 Lines |
Do you remember why the other connection needed to be queued?