Bug 418699 - Keyboard Switching policy Application always shows keyboard change OSD notification on Wayland
Summary: Keyboard Switching policy Application always shows keyboard change OSD notifi...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard_layout (show other bugs)
Version: 5.18.1
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Andrey
URL: https://invent.kde.org/plasma/kwin/-/...
Keywords:
Depends on: 390079 425590 426120 426122
Blocks: 426450
  Show dependency treegraph
 
Reported: 2020-03-10 09:28 UTC by elman
Modified: 2021-05-22 17:02 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
butirsky: Usability+
butirsky: VisualDesign+


Attachments
Notification (52.48 KB, image/png)
2020-03-10 09:28 UTC, elman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description elman 2020-03-10 09:28:57 UTC
Created attachment 126708 [details]
Notification

SUMMARY
When I have 2 keyboard layouts configured and I change switching policy to "Application", whenever I switch foreground application with different layout, I get on screen notification that layout has changed. When I'm switching back and forth between applications, this behaviour quickly becomes irritating.

STEPS TO REPRODUCE
1. Configure 2 keyboard layouts
2. Change Switching policy to Application
3. Run 2 applications
4. Set first layout to first application and second layout to second application
5. Alt+Tab between applications

OBSERVED RESULT
OSD notification is shown.

EXPECTED RESULT
OSD notification should not be shown when switching keyboard layouts by Application Switching Policy. Only when explicitly switching layout using keyboard shortcut or via System Tray (this is how X11 switching works). Another issue is that layout indicator doesn't show current layout, but that is already reported.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro
KDE Plasma Version: 5.18.2
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 1 Andrey 2020-08-17 21:24:36 UTC
Hi,
I didn't use Plasma that time, but now it seem behaves differently.
It shows OSD only when you start input in app with different layout, not when you focusing it.
Could you retest?

About no layout shown in the indicator, could you point for me where it reported?
Thanks.
Comment 2 Andrey 2020-08-17 21:26:36 UTC
^
Comment 3 Bug Janitor Service 2020-09-01 04:33:07 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Andrey 2020-09-01 22:56:41 UTC
Is it really bug? Could we vote for it?
Comment 5 boingo-00 2020-09-02 11:50:49 UTC
Yes, it is might be annoying, but i'd like to have toggle for OSD
Comment 6 elman 2020-09-02 15:08:31 UTC
Hi Andrey. I tried again on Plasma 5.19.5 and you are right. Now it behaves differently. OSD shows only when I start typing. Which is somehow even more confusing to me. When I use Thunderbird, sometimes I write in English and sometimes in different language. So I do not remember which layout I used last  and there is no way of knowing until I start typing. Not to mention that OSD might appear over the text I'm typing and it is distracting.

The other bug I mentioned is that system tray layout indicator doesn't show current layout. See https://bugs.kde.org/show_bug.cgi?id=390079
Comment 7 Andrey 2020-09-02 22:04:58 UTC
(In reply to elman from comment #6)
> Hi Andrey. I tried again on Plasma 5.19.5 and you are right. Now it behaves
> differently. OSD shows only when I start typing. Which is somehow even more
> confusing to me.
Hi Elman, thanks for testing. Actually, the behavior you described earlier is still there - just switch with Alt+Tab without typing between apps with different layout and you'll get the OSD.
Still, I'm not sure if the both OSDs are bugs or features.
There are bunch of fixes pending on that matter, so it looks OK for me here even with that OSDs.
I'll ask you to retest (e.g on KDE Neon Dev) when that fixes land so you could decide for yourself.

> When I use Thunderbird, sometimes I write in English and
> sometimes in different language. So I do not remember which layout I used
> last  and there is no way of knowing until I start typing.
It's not quite the case any more - see bug 425343. You can know the current layout at any time just by hovering the Keyboard Layout applet.

> Not to mention
> that OSD might appear over the text I'm typing and it is distracting.
Didn't notice that problem, but I don't use Plasma as my daily driver (yet?).

> The other bug I mentioned is that system tray layout indicator doesn't show
> current layout. See https://bugs.kde.org/show_bug.cgi?id=390079

Yeah, that's what should be done for sure. Thanks for reporting.
Comment 8 elman 2020-09-03 10:09:21 UTC
I just installed Neon Dev and you are right. When you switch applications with Alt+Tab, layout changes immediately, but when you switch applications with mouse clicks, layout changes only when you start typing.
Comment 9 Andrey 2020-09-03 14:21:47 UTC
Cool that you tried Neon Dev!
Actually, layout changes immediately in both cases. It's just OSD which is delayed when you switch windows with mouse. I suppose it's by design.

When you switch by Alt+Tab, OSD is actually triggered by key input, that is why you get it immediately. I don't know yet the right way how to suppress it.

Still, Neon doesn't have my OSD fixes since MR https://invent.kde.org/plasma/kwin/-/merge_requests/210 is not yet merged.
They will bring much improvements IMO so stay tuned :)
Comment 10 Andrey 2020-09-03 14:26:29 UTC
(In reply to elman from comment #6)
> ...OSD shows only when I start typing. Which is somehow even more
> confusing to me. ... 
> Not to mention that OSD might appear over the text I'm typing and it is distracting.

If you think it's a real issue how about opening a new bug?
Comment 11 elman 2020-09-03 14:41:44 UTC
First I will check Neon Dev when your fixes get merged and if described problems persists, I will create new issue. Thanks.
Comment 12 Andrey 2020-09-03 14:44:54 UTC
Actually I wanted to discuss in new bug if making OSD semi-transparent would solve the text hiding problem.
Comment 13 Bug Janitor Service 2020-09-03 20:47:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/236
Comment 14 Andrey 2020-09-03 20:57:22 UTC
Please note despite the fix is ready I'm not going to push it until we have a solid opinion about it's necessity.
Comment 15 Andrey 2020-09-03 21:40:07 UTC
(In reply to elman from comment #6)
> Not to mention that OSD might appear over the text I'm typing and it is distracting.

FYI: WIP: Make OSD position configurable
https://invent.kde.org/plasma/kwin/-/merge_requests/217
Comment 16 elman 2020-09-04 12:14:13 UTC
Cool, thanks :)
Comment 17 Andrey 2020-09-29 18:32:46 UTC
(In reply to elman from comment #11)
> First I will check Neon Dev when your fixes get merged and if described
> problems persists, I will create new issue. Thanks.

Hi elman and all, it happened! Please, test and report back. Thanks.
Comment 18 elman 2020-10-01 18:21:02 UTC
Hi. Thanks for the info. I just updated Neon unstable to 5.20.80.

It looks to me that functionality is the same as I described before. E.g. on each window switch OSD shows telling me about changed keyboard layout. Although OSD itself is much smaller, so it's not as distracting as before. That I like :)

I also noticed that I can turn off OSD completely, however I couldn't find a way how to change its position (title of https://invent.kde.org/plasma/kwin/-/merge_requests/217 says position should be configurable). In any case turning OSD off is not usable to me at this point, because I can't see current layout in status bar (I use flags). When that is fixed, hiding OSD might be a way to go.

In any case, thanks for the effort.
Comment 19 Andrey 2020-10-01 21:38:04 UTC
(In reply to elman from comment #18)
> It looks to me that functionality is the same as I described before. E.g. on
> each window switch OSD shows telling me about changed keyboard layout.
> Although OSD itself is much smaller, so it's not as distracting as before.
> That I like :)
> 

What was fixed is 3 bugs in MR https://invent.kde.org/plasma/kwin/-/merge_requests/210. You can see there how to reproduce them, if you had earlier version to compare with. Overall, it brought much prettier OSD experience for me than earlier.
I didn't touch the OSD size, just hoped improvements above would make OSD good enough to keep it..

Anyway, the biggest question to me now is that without this issue fix we have somewhat inconsistent behavior:
- when you switch apps with Alt+Tab, you got OSD
- when you switch by mouse - you don't.
Ideally we should have the behavior consistent - just wonder if anybody finds current behavior better..
We can keep it for a while, take the experience, and then decide if we really need this fixed (we have MR anyway).
So please report any time later what do you think (or if you are confident - you can say it now also).

> I also noticed that I can turn off OSD completely, however I couldn't find a
> way how to change its position (title of
> https://invent.kde.org/plasma/kwin/-/merge_requests/217 says position should
> be configurable).
On that I'm not aware of, sorry.

> In any case turning OSD off is not usable to me at this
> point, because I can't see current layout in status bar (I use flags). When
> that is fixed, hiding OSD might be a way to go.
> 
That's coming.

> In any case, thanks for the effort.
Thanks for testing/reports.
Comment 20 elman 2020-10-03 21:50:23 UTC
Thanks for all the effort. I appreciate it!

Ideal solution for me would be:
- Behavior for Alt+Tab and mouse click will be consistent.
- Status bar will display current layout (flag or label).
- There is an option to show / not to show notification when layout changes.

This way I guess everybody would be happy.
Comment 21 Andrey 2020-10-04 02:13:53 UTC
(In reply to elman from comment #20)
> - Behavior for Alt+Tab and mouse click will be consistent.

By the consistence here you mean no OSD I suppose?
Comment 22 elman 2020-10-05 19:04:53 UTC
If there is an option to show / not to show notification when layout changes, then Alt+Tab and mouse click both should obey this settings.
Comment 23 Jazz 2020-11-02 23:58:39 UTC
(In reply to Andrey from comment #12)
> Actually I wanted to discuss in new bug if making OSD semi-transparent would
> solve the text hiding problem.

I was searching for this feature and semi-transparency should be implemented regardless the original issue in this thread. OSD notification area is just simply on the way too many times and sometimes too big.
Comment 24 Andrey 2020-12-11 20:19:55 UTC
Git commit b127b5f45edeb3ae5660fa53b3e56b6a31649bdb by Andrey Butirsky.
Committed on 11/12/2020 at 20:19.
Pushed by butirsky into branch 'master'.

impr: no keyboard layout OSD on switching between windows

now if two windows have different layouts, there will be no OSD on
switching between them on Alt+Tab

GUI:
DIGEST:

M  +1    -1    keyboard_input.cpp

https://invent.kde.org/plasma/kwin/commit/b127b5f45edeb3ae5660fa53b3e56b6a31649bdb
Comment 25 Andrey 2020-12-11 20:31:24 UTC
As it fixed now I hope those of you who had OSD disabled globally will re-enable it again and give feedback about the new OSD behavior. Thanks.
Comment 26 elman 2020-12-16 22:36:22 UTC
I don't use Wayland at this moment, but will switch to it with next Plasma and this is certainly great news. Thanks.