Child windows are not raised when they are selected without clicking on them
Submitted by Hugues De Keyzer
Assigned to Olivier Fourdan @olivier
Description
Created attachment 8162 child windows test case
When an application has child windows, it can be tricky to raise a child window that is behind another child window. If one only clicks inside each window or on the title bar, that child window is raised as expected. But if the focus is given to a child window by using the Window Buttons or by switching to it with Alt+Tab, the child window receives the focus but is not raised. When it has received the focus like that, clicking inside the window or on the title bar doesn’t raise the window. To raise it, one has to click on another child window then back on that child window.
This behavior is especially annoying when a child window is completely hidden by another child window. To raise the hidden child window, one has to either move the overlapping window, or lower it by middle-clicking on the title bar.
Also, selecting the main window by using the Window Buttons doesn’t give focus to the main window but to the top child window (switching to it with Alt+Tab works).
Note that the “Raise on focus” setting has no effect on this.
What I would expect:
- Selecting a child window by using the Window Buttons or by switching to it with Alt+Tab gives it the focus and raises it, as if one had clicked on the window.
- Selecting the main window by using the Window Buttons should give focus to it.
Metacity and KWin behave this way.
A test case is attached to this bug. It creates a main window with 3 child windows. It uses Python 3 and PyQt 5.
I’m willing to fix it myself, but I have no idea in which file this is handled. If someone could give me a clue, it would be great.
Attachment 8162, "child windows test case":
child_windows_test.py
Version: 4.12.0