Bug 335270 - Enabling 'desktopchangeosd' in KCM doesn't have any effect unless window focus has changed
Summary: Enabling 'desktopchangeosd' in KCM doesn't have any effect unless window focu...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git master
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 5
Assignee: KWin default assignee
URL: https://bugreports.qt-project.org/bro...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-24 11:13 UTC by Elias Probst
Modified: 2014-06-02 11:35 UTC (History)
0 users

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 Elias Probst 2014-05-24 11:13:22 UTC
When enabling the 'desktopchangeosd' in the 'desktop' KCM the OSD won't be shown until the focus has changed to another focus than the KCM window.

Reproducible: Always

Steps to Reproduce:
1. Open 'kcmshell5 desktop'
2. Enable "Desktop Switch On-Screen Display" under "Switching" tab
3. Click "Apply"
4. Use CTRL+F{1,2,3,…} to switch to another desktop
Actual Results:  
The OSD does not show up.
Only after changing the window focus (moving mouse to another window than the KCM), the OSD is enabled when using CTRL+F{1,2,3,…}.

Expected Results:  
The OSD should show up immediately when using CTRL+F{1,2,3,…} without having to change window focus first.

Running latest git master of all KF5/Plasma components.
Using Qt 5.3.0.
Comment 1 Elias Probst 2014-05-24 11:32:30 UTC
This applies also to the kwin startup.
The OSD won't be shown before the first window focus change.
Comment 2 Martin Flöser 2014-05-24 11:36:48 UTC
from my experience any QML window doesn't show on the first try. This affects:
* Alt+Tab
* Outline
* Desktop Change OSD

Invoking them a second time normally always works. I have not noticed any relation to focus change yet.
Comment 3 Elias Probst 2014-05-24 11:43:00 UTC
> I have not noticed any relation to focus change yet.
Maybe my focus policy affects this ("Focus Follows Mouse - Mouse Precedence", 0 ms delay).
Comment 4 Martin Flöser 2014-05-26 17:21:35 UTC
Git commit 20fcb774f1bdef60b45d242c6fd8c0814ad761ac by Martin Gräßlin.
Committed on 24/05/2014 at 12:04.
Pushed by graesslin into branch 'master'.

[kcmkwin/desktop] Fix activating the desktop effects

We need to load/unload the changed effects.
REVIEW: 118292

M  +2    -0    kcmkwin/kwindesktop/CMakeLists.txt
M  +30   -15   kcmkwin/kwindesktop/main.cpp

http://commits.kde.org/kwin/20fcb774f1bdef60b45d242c6fd8c0814ad761ac
Comment 5 Martin Flöser 2014-05-28 07:36:46 UTC
whoops, I closed the wrong bug.

I just made a discovery: this seems to be related to compositing. Without compositing the window is shown instantly.
Comment 6 Martin Flöser 2014-05-28 07:46:01 UTC
just played a little bit with the QtQuick based outline in non-composited: from time to time the window is completely black, which would indicate a completely transparent window in the composited case.
Comment 7 Martin Flöser 2014-05-28 08:40:07 UTC
I have a fix for the outline. Totally crazy and weird, but I hope it helps me to find a proper solution:

if (QQuickWindow *w = qobject_cast<QQuickWindow*>(m_mainItem)) {
    QObject::connect(w, &QQuickWindow::frameSwapped,
        [w]() {
            Unmanaged *u = Workspace::self()->findUnmanaged(w->winId());
            if (!u) {
                return;
            }
            if (!u->readyForPainting()) {
                w->update();
            }
        }
    );
}
Comment 8 Martin Flöser 2014-05-28 08:59:58 UTC
further testing: I replaced the FrameSvg by a simple white rectangle and tested with the non composited case: was not able to reproduce the black window mentioned in comment #6.
Comment 9 Martin Flöser 2014-05-28 10:32:17 UTC
yet another update: I can reproduce with a plain Image item, which means either problem in QtQuick or in the driver. After lunch I'm going to test on non-intel hardware to rule out the possibility of driver.
Comment 10 Martin Flöser 2014-05-28 12:01:07 UTC
result from test with NVIDIA: not able to reproduce with outline, but able to reproduce with TabBox.
Comment 11 Elias Probst 2014-05-28 12:31:12 UTC
This might explain why I sometimes don't see any TabBox (or similar effects) at all… already wanted to file a separate bug for that, but it looks like I should wait for further progress on this one.
Comment 12 Martin Flöser 2014-05-28 12:32:00 UTC
it's related to the override redirect state of the window - upstream bug reported: https://bugreports.qt-project.org/browse/QTBUG-39329
Comment 13 Martin Flöser 2014-06-02 11:35:35 UTC
right now I don't think there is anything we can do on our side -> RESOLVED UPSTREAM