Review Request 126287: [text-ui] Use KWindowSystem to detect active window change for keyboard layout switching
Martin Gräßlin
mgraesslin at kde.org
Wed Dec 9 07:59:39 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126287/#review89270
-----------------------------------------------------------
The interesting question is why does the OSD trigger a WindowDeactivate. This needs investigation as otherwise we start to work around issues (like here) without fixing the root cause.
app/chat-window.cpp (lines 207 - 211)
<https://git.reviewboard.kde.org/r/126287/#comment61052>
just add this as context to your lambda connection.
So
connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, this, []{...});
- Martin Gräßlin
On Dec. 9, 2015, 6:03 a.m., Martin Klapetek wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126287/
> -----------------------------------------------------------
>
> (Updated Dec. 9, 2015, 6:03 a.m.)
>
>
> Review request for Telepathy and Martin Gräßlin.
>
>
> Bugs: 356220
> http://bugs.kde.org/show_bug.cgi?id=356220
>
>
> Repository: ktp-text-ui
>
>
> Description
> -------
>
> So it turns out that with text-ui's "remember layout per tab" feature
> and Plasma's OSD, there's a problem when activating the global keyboard
> layout change shortcut. It triggers the OSD and in turn that causes
> QEvent::WindowDeactivate and QEvent::WindowActivate events in the app,
> leading to text-ui immediately setting the old keyboard layout, making
> it look like it's actualy blocking the changes.
>
> While checking KWindowSystem::activeWindowChanged I noticed that the
> active window actually does not change. So I've moved setting the kbd
> layout to KWindowSystem::activeWindowChanged slot rather than in the
> event() handler. Seems to work perfectly.
>
> I think this is the same bug that is causing the hidden panel to raise
> on OSD/notifications and the one that is showing the "plasma" task in
> task manager for split second, these two:
>
> https://bugs.kde.org/show_bug.cgi?id=352278
> https://bugs.kde.org/show_bug.cgi?id=332024
>
>
> Diffs
> -----
>
> app/chat-window.h 0d1e0bb
> app/chat-window.cpp fdde18d
>
> Diff: https://git.reviewboard.kde.org/r/126287/diff/
>
>
> Testing
> -------
>
> With "remember keyboard layout per tab" I can now successfully change
> keyboard layout from text-ui and the keyboard layout is properly restored
> when switching to the window.
>
>
> Thanks,
>
> Martin Klapetek
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20151209/ed6884f9/attachment.html>
More information about the KDE-Telepathy
mailing list