plasma: pass the focus reason when setting focus

the focus reason serves some purpose

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-22 12:06:42 +03:00
parent 87b428e010
commit 2dcb8c968a
2 changed files with 3 additions and 8 deletions

View file

@ -683,22 +683,19 @@ void Dialog::showEvent(QShowEvent * event)
void Dialog::focusInEvent(QFocusEvent *event) void Dialog::focusInEvent(QFocusEvent *event)
{ {
Q_UNUSED(event)
if (d->view) { if (d->view) {
d->view->setFocus(); d->view->setFocus(event->reason());
} }
QGraphicsWidget *graphicsWidget = d->graphicsWidgetPtr.data(); QGraphicsWidget *graphicsWidget = d->graphicsWidgetPtr.data();
if (graphicsWidget) { if (graphicsWidget) {
graphicsWidget->setFocus(); graphicsWidget->setFocus(event->reason());
} }
} }
void Dialog::moveEvent(QMoveEvent *event) void Dialog::moveEvent(QMoveEvent *event)
{ {
Q_UNUSED(event) Q_UNUSED(event)
//kDebug();
d->scheduleBorderCheck(); d->scheduleBorderCheck();
} }

View file

@ -1177,10 +1177,8 @@ QSizeF ScrollWidget::snapSize() const
void ScrollWidget::focusInEvent(QFocusEvent *event) void ScrollWidget::focusInEvent(QFocusEvent *event)
{ {
Q_UNUSED(event)
if (d->widget) { if (d->widget) {
d->widget.data()->setFocus(); d->widget.data()->setFocus(event->reason());
} }
} }