Bug 333742

Summary: Text-UI breaks "Per window" keyboard layout switching
Product: [Unmaintained] telepathy Reporter: Eugene Shalygin <eugene.shalygin+bugzilla.kde>
Component: text-uiAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: mklapetek
Priority: NOR    
Version: git-latest   
Target Milestone: Future   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Eugene Shalygin 2014-04-22 21:43:15 UTC
I use several languages and switching policy is set to "Window". After the specified commit  plasma notifications switches layout of the current active window to the layout of the chat that activated the notification. Also, quick switching via taskbar to and then from chat window changes keyboard layout for the active window. 

Reproducible: Always

Steps to Reproduce:
1. Setup several keyboard layouts
2. Set switching policy to "Window"
3. Open several applications
4. Open KDE telepathy text chat window
5. Switch layout for the chat window
6. Switch to another application
7. Send a message into that chat window
Actual Results:  
Appeared notification changes layout of current application to the layout of
the chat 

Expected Results:  
Current layoud does not change
Comment 1 Martin Klapetek 2014-04-22 21:47:29 UTC
Broken with commit 7599bc88d73901e4a8eb05fee0791a604d8a1e08 (taken from the original bug title)
Comment 2 David Edmundson 2014-04-23 20:34:19 UTC
Git commit 68ffd6e4ec2525287a3a00ddbabefcac0be3ce9f by David Edmundson, on behalf of Ahmed Ibrahim.
Committed on 23/04/2014 at 20:34.
Pushed by davidedmundson into branch 'master'.

Text-UI breaks "Per window" keyboard layout switching

This bug happens when the user has switched the keyboard layout of a chat tab and then switched to another application with another language, And he received a message or an "is typing" chat status, the language is then changed to the language of the Chat Tab that he was previously in, which is of course is an annoying behavior.

The reason of this behavior is that the restoreKeyboardLayout method is called inside the onCurrentIndexChanged without making sure that the Chat Window is active.

REVIEW: 117729

M  +3    -1    app/chat-window.cpp

http://commits.kde.org/telepathy-text-ui/68ffd6e4ec2525287a3a00ddbabefcac0be3ce9f
Comment 3 Eugene Shalygin 2014-07-25 01:15:55 UTC
The bug is acytive again in a new incarnation. ktp master branch.

When I switch to chat window, justy before the window switch the keyboard layout of the chat window is applied to the previously active window.

1. Setup several keyboard layouts
2. Set switching policy to "Window"
3. Open several applications
4. Open KDE telepathy text chat window
5. Switch layout for the chat window
6. Switch to another application
6. Switch to telepathy window and back

Actual Results: keyboard layout of the other application changed to the one of the chat window.
Comment 4 Eugene Shalygin 2014-07-25 11:53:54 UTC
one more sequence to reproduce:

1. Setup several keyboard layouts
2. Set switching policy to "Window"
3. Open several applications
4. Open KDE telepathy text chat window
5. Switch layout for the chat window
6. Switch to another application
6. Switch to telepathy window and CLOSE IT
7. Keyboard layout of the previously active window (which is active now) has changed
Comment 5 Martin Klapetek 2015-12-10 20:54:45 UTC
Marking as duplicate of bug 356220 which has the investigation and everything.

*** This bug has been marked as a duplicate of bug 356220 ***