1
0
mirror of https://github.com/danog/patches.git synced 2024-12-12 09:29:43 +01:00
patches/qtbase_5_12_8/0022-save-dirtyopaquechildren.patch
Ilya Fedin 2b9afa7592 Separate patches
Backport support for opening directories with xdg desktop portals

Backport fix for ibus on wayland
2020-06-02 22:21:04 +04:00

54 lines
2.4 KiB
Diff

diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index bf339ca5c5..4cdf9189ad 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5161,6 +5161,17 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
return; // Fully transparent.
Q_D(QWidget);
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ //
+ // Just like in QWidget::grab() this field should be restored
+ // after the d->render() call, because it will be set to 1 and
+ // opaqueChildren field will be filled with empty region in
+ // case the widget is hidden (because all the opaque children
+ // will be skipped in isVisible() check).
+ //
+ const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren;
+
const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter;
const QRegion toBePainted = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags)
: sourceRegion;
@@ -5182,6 +5193,10 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
if (!inRenderWithPainter && (opacity < 1.0 || (target->devType() == QInternal::Printer))) {
d->render_helper(painter, targetOffset, toBePainted, renderFlags);
d->extra->inRenderWithPainter = inRenderWithPainter;
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
+
return;
}
@@ -5214,6 +5229,9 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
d->setSharedPainter(oldPainter);
d->extra->inRenderWithPainter = inRenderWithPainter;
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
}
static void sendResizeEvents(QWidget *target)
@@ -8968,7 +8986,8 @@ bool QWidget::event(QEvent *event)
case QEvent::KeyPress: {
QKeyEvent *k = (QKeyEvent *)event;
bool res = false;
- if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
+ // Patch: Enable Ctrl+Tab and Ctrl+Shift+Tab / Ctrl+Backtab handle in-app.
+ if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier))) {
if (k->key() == Qt::Key_Backtab
|| (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier)))
res = focusNextPrevChild(false);