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.
Details
- Reviewers
hein
- Enable KWin compositing.
- Run yakuake.
- Open a split window (either horizontal or vertical). Note the split that currently has focus.
- 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
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 |
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/
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.