Bug 441013 - yakuake: highlight terminals when moving focus -> highlighting does not correctly disappear
Summary: yakuake: highlight terminals when moving focus -> highlighting does not corre...
Status: RESOLVED FIXED
Alias: None
Product: yakuake
Classification: Applications
Component: general (show other bugs)
Version: 22.04.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Eike Hein
URL:
Keywords:
: 441753 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-08-15 18:37 UTC by Till Schäfer
Modified: 2022-08-23 21:40 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 22.08.1


Attachments
video of yakuakes highlighting bug (1020.36 KB, video/x-matroska)
2021-08-15 18:37 UTC, Till Schäfer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Till Schäfer 2021-08-15 18:37:35 UTC
Created attachment 140756 [details]
video of yakuakes highlighting bug

SUMMARY
When using the "configure -> appearance -> highlight terminals when moving focus between between them" feature, yakuake used to highlight the focused terminal (by adding a collored overlay) for a short period of time, and returns to normal appearance afterwards. After upgrading to version 21.08, the highlighted area stays highlighted until some other operation updates it. This also results in partially removed highlighting in the lines that re currently updated only. For example, the line of the bash prompt returns to non-hihglighted appearance when typing something, while the rest of the terminal stays highlighted. 

Also see the attached video for a visual example. 



STEPS TO REPRODUCE
1. enable "highlight terminals when moving focus between between them"
2. move focus between terminals by shortcut


OBSERVED RESULT
the highlighting stays until other terminal refreshes happen.

EXPECTED RESULT
the highlighting disappears after some time

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.13.10-gentoo (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4790K CPU @ 4.00GHz
Memory: 23.4 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 970/PCIe/SSE2
Comment 1 geonicz 2021-08-22 08:42:21 UTC
Same thing is reproduced on arch linux. Seems like independent from kernel, kde versions. Very annoying thing and a very important feature. Please, fix it!
Comment 2 Ace 2021-09-15 19:14:21 UTC
I can also confirm this bug on several Arch installations, it is not fixed in the current git repository either.
Comment 3 Ace 2021-09-15 19:15:29 UTC
*** Bug 441753 has been marked as a duplicate of this bug. ***
Comment 4 Arek Guzinski 2021-10-01 15:28:03 UTC
For the record, it's also happening with Yakuake 21.08.1 with the following configuration:

Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-36-generic (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-6500 CPU @ 3.20GHz
Memory: 15,6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2

Can somebody test if this happens on non-Nvidia cards, too?
Comment 5 Till Schäfer 2021-10-01 15:30:59 UTC
yes(In reply to Arek Guzinski from comment #4)
> Can somebody test if this happens on non-Nvidia cards, too?

yes, same issue on intel.
Comment 6 Ebcdic 2022-01-11 13:35:52 UTC
I noticed that the issue is not seen in version 20.12, and comparing 20.12 with 21.08, the main difference I see that could be relevant is that m_cleanupTimerStarted switched to QElapsedTimer.
It would appear that in the file app/visualeventoverlay.cpp, VisualEventOverlay::scheduleCleanup uses m_cleanupTimerStarted.elapsed() before checking if m_cleanupTimerStarted.start() was ever called, and according to the QT documentation I could find, this might lead to unpredictable results.
I think this might lead to a situation where the returned value causes the following "if" to fail, thus preventing the start of the timer that will later reset the highlight.

So, to test this idea, I changed this line in VisualEventOverlay::scheduleCleanup in app/visualeventoverlay.cpp: (Line 203 in 21.08)
int left = m_cleanupTimerCeiling - m_cleanupTimerStarted.elapsed();
to:
int left = (m_cleanupTimerStarted.isValid())? m_cleanupTimerCeiling - m_cleanupTimerStarted.elapsed() : 0;

And the issue seems to be gone.
Comment 7 Till Schäfer 2022-04-29 07:21:03 UTC
Still Valid

Operating System: Gentoo Linux
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.15.32-gentoo-r1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-3770 CPU @ 3.40GHz
Memory: 30.8 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4000
Comment 8 Islam Rrapaj 2022-07-21 23:39:12 UTC
This is currently happening to me as well, on Ubuntu 22.04, GNOME
Only happens when using more than one terminal.

It only disappears if I issue my keybind to Retract and then issue it again to open Yakuake.

My solution was to uncheck the hilighting and enable cursor blinking, that way I know on which terminal I am at since its the only one with the blinking cursor.
Comment 9 Nicolas Fella 2022-08-23 21:38:24 UTC
Git commit 658f824609cc2de10c7876f2ecea0c9bb4fa7a94 by Nicolas Fella, on behalf of Wen Nutt.
Committed on 23/08/2022 at 21:37.
Pushed by nicolasfella into branch 'master'.

Fix highlight not disappearing when focussing terminal

If m_cleanupTimerStarted is not valid, i.e. not started, calling elapsed is undefined behavior. Avoid that

M  +1    -1    app/visualeventoverlay.cpp

https://invent.kde.org/utilities/yakuake/commit/658f824609cc2de10c7876f2ecea0c9bb4fa7a94
Comment 10 Nicolas Fella 2022-08-23 21:39:29 UTC
Git commit f12226e08780f983ef5964678c8047f27ac605b4 by Nicolas Fella, on behalf of Wen Nutt.
Committed on 23/08/2022 at 21:39.
Pushed by nicolasfella into branch 'release/22.08'.

Fix highlight not disappearing when focussing terminal

If m_cleanupTimerStarted is not valid, i.e. not started, calling elapsed is undefined behavior. Avoid that
(cherry picked from commit 658f824609cc2de10c7876f2ecea0c9bb4fa7a94)

M  +1    -1    app/visualeventoverlay.cpp

https://invent.kde.org/utilities/yakuake/commit/f12226e08780f983ef5964678c8047f27ac605b4