Workaround for split terminal focus on window retract when using KWin compositing.
Needs ReviewPublic

Authored by dkorth on Jul 26 2017, 2:21 AM.

Details

Reviewers
hein
Summary

There is a glitch in the KWin compositing path that causes focus to change to a different terminal in split terminal windows if the user presses the hotkey to retract the window. This workaround saves the last-focused terminal window on retract and refocuses it on show.

Test Plan
  1. Enable KWin compositing.
  2. Run yakuake.
  3. Open a split window (either horizontal or vertical). Note the split that currently has focus.
  4. Press the yakuake hotkey twice. The yakuake window will retract and reappear, and focus will be moved to a different split.

With this patch, focus will not be changed when the window is retracted.

Diff Detail

Repository
R369 Yakuake
Lint
Lint Skipped
Unit
Unit Tests Skipped
dkorth created this revision.Jul 26 2017, 2:21 AM

Thanks, I noticed this issue as well. However, I'm not sure if this is the right fix, the issue might lie elsewhere?

app/mainwindow.cpp
1067–1068

Coding style, braces on same line

1074

No need for explicit this

app/mainwindow.h
213

You can just use a QPointer<QWidget> which will automatically set itself to nullptr if the widget is destroyed.

Also, don't appreviate name, m_previouslyFocusedWidget

dkorth updated this revision to Diff 17268.Jul 27 2017, 2:26 AM

Updated the formatting and use QPointer.

I'm not sure if Yakuake's primary development is done here or on Review Board, so I ended up posting on both.

Review Board: https://git.reviewboard.kde.org/r/130203/

hein edited edge metadata.Jul 29 2017, 6:22 AM

Phabricator is correct.

This is a hack though, and more or less equivalent to what ee7152471d already did. We really need to figure out why this actually breaks in Qt. This would also break things when using DBus to switch tabs while the window is hidden and then showing.