Bug 421234 - Focus tracking not working with full desktop zoom.
Summary: Focus tracking not working with full desktop zoom.
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: 5.18.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-09 17:46 UTC by Jos Wijdeven
Modified: 2020-06-01 13:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.20.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jos Wijdeven 2020-05-09 17:46:13 UTC
SUMMARY
Desktop effects -> Zoom -> Settings:
- Enable focus tracking
- Follow focus
The zoomed area does not move to a newly opened windows/application/dialog/notification or to an existing window when it receives focus with alt-tab.

STEPS TO REPRODUCE
1. Enable Zoom in "Desktop effects" and enable "Enable focus tracking" and "Follow focus"
2. Zoom up until about only one quarter of the screen is visible in the zoomed area.
3. Open several windows/applications spread out over the desktop so that some of them are always outside of the zoom area.
4. Alt-tab through the windows.

OBSERVED RESULT
The zoomed area stays in the same place while a window outside of the zoomed area receives focus.

EXPECTED RESULT
Zoomed area moves to the focused or newly opened window.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 20.04
(available in About System)
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION
Looking at the source code on github (https://github.com/KDE/kwin/tree/master/effects/zoom) it seems that kaccessible (org.kde.kaccessibleapp) is used for focus tracking. But that package is not installed and not available (any more) in the repository.
If this is the cause and if kaccessible is deprecated can the zoom component be updated to use another way to follow the focus?
Comment 1 Vlad Zahorodnii 2020-05-12 06:21:01 UTC
(In reply to Jos Wijdeven from comment #0)
> ADDITIONAL INFORMATION
> Looking at the source code on github
> (https://github.com/KDE/kwin/tree/master/effects/zoom) it seems that
> kaccessible (org.kde.kaccessibleapp) is used for focus tracking. But that
> package is not installed and not available (any more) in the repository.
> If this is the cause and if kaccessible is deprecated can the zoom component
> be updated to use another way to follow the focus?
Yes, kaccessible is dead. We should use libqaccessibilityclient.

The focus tracking had been brought up to the discussion quite a while ago (see bug 362189) and I even wrote a patch to port the zoom effect to libqaccessibilityclient. However, someone had started reasoning whether focus tracking is actually needed in the zoom effect and the discussion kind of died out after that.

*** This bug has been marked as a duplicate of bug 362189 ***
Comment 2 Jos Wijdeven 2020-05-13 00:31:57 UTC
Thank you. Yes, I had seen the other bug but that was about the caret (text cursor) tracking? (which is high on my wish list too) 
Or is what I described/expected not what "Enable focus tracking" and "Follow focus" are supposed to do?
Comment 3 Vlad Zahorodnii 2020-05-13 05:21:16 UTC
(In reply to Jos Wijdeven from comment #2)
> Thank you. Yes, I had seen the other bug but that was about the caret (text
> cursor) tracking? (which is high on my wish list too) 
> Or is what I described/expected not what "Enable focus tracking" and "Follow
> focus" are supposed to do?

So, iirc with the focus tracking, the zoom effect ensures that the focused region (e.g. a ui control) is in the zoom area. It's not about focused or newly opened windows.
Comment 4 Vlad Zahorodnii 2020-05-13 05:25:33 UTC
In general, we should answer first whether the zoom effect needs to have accessibility features such as focus tracking or caret tracking. If indeed it needs to have those features, then I would be glad to accept/approve a patch that ports the zoom effect to libqaccessibilityclient.
Comment 5 Vlad Zahorodnii 2020-05-13 05:28:01 UTC
Yeah, I probably marked this bug report as a duplicate of 362189 too quickly.
Comment 6 Vlad Zahorodnii 2020-05-13 05:29:26 UTC
@Frederik Does libqaccessibilityclient allow to track the focused region?
Comment 7 Jos Wijdeven 2020-05-13 13:19:11 UTC
The zoom effect itself is already an accessibility feature. I (and a lot of visually impaired users) can't use a computer without it. Adding/fixing the focus tracking will be greatly appreciated.
Comment 8 Vlad Zahorodnii 2020-05-18 12:07:00 UTC
Relevant MR https://invent.kde.org/plasma/kwin/-/merge_requests/1
Comment 9 Vlad Zahorodnii 2020-06-01 07:44:54 UTC
Git commit c1ea0412a45a64d99c120eedfa80ef376c7e6610 by Vlad Zahorodnii.
Committed on 01/06/2020 at 07:43.
Pushed by vladz into branch 'master'.

[effects/zoom] Implement focus tracking with QAccessibilityClient

Currently, the focus tracking functionality in the zoom effect does not
work because it relies on kaccessibleapp, which is dead. Luckily for us,
there is a library called libqaccessibilityclient that provides a way
to monitor focus changes.

M  +9    -0    CMakeLists.txt
M  +1    -0    config-kwin.h.cmake
M  +15   -0    effects/CMakeLists.txt
A  +91   -0    effects/zoom/accessibilityintegration.cpp     [License: GPL (v2)]
A  +53   -0    effects/zoom/accessibilityintegration.h     [License: GPL (v2)]
M  +26   -31   effects/zoom/zoom.cpp
M  +12   -11   effects/zoom/zoom.h
M  +0    -2    effects/zoom/zoom.kcfg
M  +4    -0    effects/zoom/zoom_config.cpp
M  +5    -39   effects/zoom/zoom_config.ui

https://invent.kde.org/plasma/kwin/commit/c1ea0412a45a64d99c120eedfa80ef376c7e6610