Bug 269661 - Per-application keyboard layout switching ignores the desktop
Summary: Per-application keyboard layout switching ignores the desktop
Status: RESOLVED INTENTIONAL
Alias: None
Product: kxkb
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Andriy Rysin
URL:
Keywords:
: 260912 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-29 05:32 UTC by Nikos Chantziaras
Modified: 2017-07-23 04:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2011-03-29 05:32:47 UTC
Version:           unspecified (using KDE 4.6.1) 
OS:                Linux

I've hit a bug where switching the current keyboard layout while per-application switching policy is selected, does not switch back to the previous layout when the application is minimized or loses focus.  Furthermore, when the app loses focus, switching the keyboard layout will result in the (now unfocused) application also switching the layout.

For example, suppose we switch from the US English ("us") layout to the DE German ("de") layout in Dolphin.  Now when we click on the desktop, and therefore Dolphin loses focus, the current layout will stay at "de" rather than going back to "us". Typing text in some desktop widget (like renaming a file in a folder view) will use the German layout. Now if we switch the layout to "us" again, and then click on the Dolphin window, Dolphin will not go back to the "de" layout but will stay in the "us" one. It seems like KDE can't distinguish between the current application window and the desktop. It treats them as one and the same when it comes to keyboard layouts switching.

Reproducible: Always
Comment 1 Nikos Chantziaras 2011-03-29 05:38:35 UTC
Oopsy, I forgot to include steps to reproduce this:

1. Open System Settings, and in the "Hardware" section select "Input Devices".

2. If you're using only one keyboard layout, go to the "Layouts" tab, and add a second layout.

3. Select the "Application" radio button in the "Switching Policy" button group.

4. Enable the "Show layout indicator" in the "Layout Indicator" group.

5. Apply the settings and run an application. In the new application, switch to another keyboard layout.

6. Click on the desktop. You will notice that the keyboard layout will not switch back to the previous one.
Comment 2 Nikos Chantziaras 2011-04-06 23:02:06 UTC
Bug also there in 4.6.2.
Comment 3 Andriy Rysin 2011-04-07 00:37:34 UTC
Ignoring desktop was intentional, the problem with this was that we have the keyboard layout applet which if desktop is ignore can't switch the layout for other apps in window or application mode.
We probably should just ignore keyboard applet but I'm not sure how to do it yet - current window is desktop window...
Any suggestions are welcome.
Comment 4 Andriy Rysin 2011-05-11 05:12:22 UTC
So I could not find an easy way to make a desktop separate layout container without breaking keyboard layout switcher applet. The conversation on k-c-d is here http://lists.kde.org/?t=130274125600001&r=1&w=2. As I said before any ideas or patches are welcome.
Comment 5 Nikos Chantziaras 2011-05-11 12:47:23 UTC
Maybe getting KWin involved would solve this? KWin should always know which window has focus or when no one has.
Comment 6 Andriy Rysin 2011-05-11 13:32:37 UTC
Currently kwin is used to tell which window is active, but it knows noting about applets, so from kwin point of view any applet on desktop belongs to desktop window.
Comment 7 Nikos Chantziaras 2011-05-11 13:37:23 UTC
Well, as I envision it, applets are part of the desktop itself; that their different to normal windows.  So treating them all as the same app would be consistent.
Comment 8 Andriy Rysin 2011-05-11 18:38:31 UTC
The problem is that keyboard layout switcher applet is added to the desktop and per-window/per-application mode is on when user clicks on this applet the desktop layout will be switched not the currently active application's one.
Comment 9 Nikos Chantziaras 2011-05-11 18:57:07 UTC
Still better than the current behavior :-P  At least the fact that the current window will lose its focus when the user clicks on the applet should be a hint at what is going on.
Comment 10 Nikos Chantziaras 2012-10-19 14:10:00 UTC
KDE 4.9.2 still has the problem.
Comment 11 Nikos Chantziaras 2012-11-24 05:46:31 UTC
Problem persists in KDE 4.9.3.
Comment 12 Andriy Rysin 2012-11-25 01:21:30 UTC
Problem is going to persist until there's good solution, so far I don't see one, but I'll take the patch that does it right any day :)
Comment 13 Andriy Rysin 2014-04-22 01:19:50 UTC
*** Bug 260912 has been marked as a duplicate of this bug. ***
Comment 14 Kirill Elagin 2014-04-22 04:56:17 UTC
Placing the keyboard applet on the desktop itself is clearly broken and should be prohibited (do applets have a flag like panelOnly?) or just left unfunctional (if I'm trying to switch a layout by clicking somewhere on the desktop, when windows clearly loses focus, I should be fine with the fact that this doesn't work).

On the other hand, panels are clearly special and should be treated, well, as a part of current window. So, the question is: is it possible to separate panels from the rest of the desktop? If they are in the same window, can we ask plasma guys to create panels in another window? This totally makes sense.
Comment 15 Kirill Elagin 2014-04-22 04:59:33 UTC
Oh, and by the way, right now if I click on the desktop the window loses focus. But when I click on the panel, it doesn't. So, looks like it should be working properly when the applet is _on a panel_ without that hack with ignoring desktop, right?
In this case, breaking user experience described by the reported of this bug and in bug 260912 just to have the layout switcher applet work when placed _on desktop_ is a weird decision. You should reconsider it.
Comment 16 Nikos Chantziaras 2017-07-23 04:29:04 UTC
Closing. I don't care anymore.