Bug 293265

Summary: When two Konsole windows are set as fullscreen mode, one of then tends to behave as if "Keep Above Others" has been enabled.
Product: [Plasma] kwin Reporter: Jekyll Wu <adaptee>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jekyll Wu 2012-02-04 05:31:24 UTC
Version:           git master (using Devel) 
OS:                Linux

This might be the same problem as bug 261799, but this is reproducible when using single monitor.

0. make sure all Konsole windows are closed
1. switch to an empty virtual desktop
3. launch Konsole through krunner( let's call that Konsole window as Konsole #1)
4. (optionally)change the tab title format of the only tab in Konsole #1 to "#1", so that its title bar becomes "#1" for better recognition.
5. use "File -> New Window" to get another Konsole window( call it Konsole #2)
6. launch dolphin
7. set Konsole #1 as fullscreen mode
8. use Alt+Tab to switch between Konsole #1, #2 and dolphin. No problem at the moment.
9. set Konsole #2 as fullscreen mode, too
10. use Alt+Tab to switch between Konsole #1, #2 and dolphin.


Reproducible: Always

Steps to Reproduce:
0. make sure all Konsole windows are closed
1. switch to an empty virtual desktop
3. launch Konsole through krunner( let's call that Konsole window as Konsole #1)
4. (optionally)change the tab title format of the only tab in Konsole #1 to "#1", so that its title bar becomes #1 for better recognition.
5. use "File -> New Window" to get another Konsole window( call it Konsole #2)
6. launch dolphin
7. set Konsole #1 as fullscreen mode
8. use Alt+Tab to switch between Konsole #1, #2 and dolphin. No problem at the moment.
9. set Konsole #2 as fullscreen mode, too
10. use Alt+Tab to switch between Konsole #1, #2 and dolphin.


Actual Results:  
In step 10, quite often, when I want to switch the current window from konsole #2(or #1) to dolphin, Konsole #2(or #1) is still shown in the front in fullscreen mode as if "Keep Above Others" has been enabled.


Expected Results:  
same result as in step 8


This is reproducible using a clean account, so it is not related with kwin rules

And the problem does not exist when using konsole in GNOME and XFCE

The code within Konsole directly related with fullscreen mode is only this:

void MainWindow::viewFullScreen(bool fullScreen)
{
    if (fullScreen)
        setWindowState(windowState() | Qt::WindowFullScreen);
    else
        setWindowState(windowState() & ~Qt::WindowFullScreen);
}

I failed to see how that might possibly lead to the reported problem, so I report it as a kwin bug.
Comment 1 Thomas Lübking 2012-02-04 15:01:46 UTC
layers.cpp:841


bool Client::isActiveFullScreen() const
{
...
-         && (top == this || this->group() == top->group()));
+         && (top == this ));
}

It's however not *that* easy because it should cover at least transients.
Comment 2 Thomas Lübking 2012-02-04 15:57:16 UTC
https://git.reviewboard.kde.org/r/103866/
Comment 3 Jekyll Wu 2012-02-05 19:27:43 UTC
The patch in the review request seems working fine.

Er, is bug 261799 also caused by the same defect? Should it be marked as a duplicate of this?
Comment 4 Thomas Lübking 2012-02-05 19:51:30 UTC
yes, very likely. i'll test it later but should be the same (+ there's afair a similar kwin bug)
Comment 5 Thomas Lübking 2012-02-05 21:40:35 UTC
No, it's not.

I can raise windows above the non fullscreen konsole after activating the fullscreen konsole (on the other screen) but no more after activating the non-fullscreen konsole (until i activate the fullscreen konsole again)

Gonna check why this.
Comment 6 Thomas Lübking 2012-02-08 19:52:39 UTC
Git commit 10cd4faa8a0cb0619ebcfd462ee0104b1db58171 by Thomas Lübking.
Committed on 04/02/2012 at 16:45.
Pushed by luebking into branch 'master'.

Only keep fullscreen for transients on top - not random group members
REVIEW: 103866

M  +26   -4    kwin/layers.cpp

http://commits.kde.org/kde-workspace/10cd4faa8a0cb0619ebcfd462ee0104b1db58171
Comment 7 Thomas Lübking 2012-03-22 19:47:04 UTC
Git commit 8634d94682800ad0d62b2c6f0c9877b8ba745009 by Thomas Lübking.
Committed on 04/02/2012 at 16:45.
Pushed by luebking into branch 'KDE/4.8'.

Only keep fullscreen for transients on top - not random group members
REVIEW: 103866

M  +26   -4    kwin/layers.cpp

http://commits.kde.org/kde-workspace/8634d94682800ad0d62b2c6f0c9877b8ba745009