Call frameRendered for undamaged Wayland surfaces
ClosedPublic

Authored by ekurzinger on Jan 16 2019, 11:18 PM.

Details

Summary

Currently, if a Wayland surface registers a frame callback but does not send a damage event, the callback will not be serviced even after KWin has completed a compositing cycle and is therefore ready to render a new frame for the surface. Since some clients, including any using NVIDIA's Wayland EGL implementation, wait for frame events before preparing each frame this behavior can result in hangs if a compositing cycle occurs between registering the frame callback and sending the damage event.

Instead, in accordance with the Wayland specification, frame callbacks should be serviced (via KWayland::Server::SurfaceInterface::frameRendered) for all visible windows - not just those damaged since the last compositing cycle.

Diff Detail

Repository
R108 KWin
Lint
Lint Skipped
Unit
Unit Tests Skipped
ekurzinger created this revision.Jan 16 2019, 11:18 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 16 2019, 11:18 PM
Restricted Application edited subscribers, added: kwin; removed: KWin. · View Herald Transcript
davidedmundson accepted this revision.Jan 16 2019, 11:42 PM
This revision is now accepted and ready to land.Jan 16 2019, 11:42 PM

I was really hoping this would turn out to be the cause of our Firefox SHM bug, but having tested it doesn't seem like it :(

composite.cpp
767

When you commit, you may as well keep it as

for(Toplevel * win: qAsConst(windows))

it'll save a shallow copy.

zzag added a subscriber: zzag.Jan 17 2019, 10:29 AM

@ekurzinger Do you have commit access?

This does not take into account: A server should avoid signaling the frame callbacks if the surface is not visible in any way, e.g. the surface is off-screen, or completely obscured by other opaque surfaces.

Now all windows are signaled. Especially also when the screen is locked.

This does not take into account: A server should avoid signaling the frame callbacks if the surface is not visible in any way,

ToplevelList windows = Workspace::self()->xStackingOrder();

This should exclude unmapped or minimised.

or completely obscured by other opaque surfaces.

We don't do this now.

especially lockscreen

There's a line above that removes from the "windows" list. (composite.cpp:740)

foreach (Toplevel *t, windows) {
   if (waylandServer() && waylandServer()->isScreenLocked()) {
        if(!t->isLockScreen() && !t->isInputMethod()) {
            windows.removeAll(t);
        }
    }

If anything, that means it was broken before and this fixes it.

ekurzinger updated this revision to Diff 49748.Jan 17 2019, 7:12 PM
In D18307#394965, @zzag wrote:

@ekurzinger Do you have commit access?

I do not, I believe someone would need to commit on my behalf.
Also, the diff has been updated per David's suggestion (thanks)

I believe someone would need to commit on my behalf.

You should have access now.

ekurzinger closed this revision.Jan 29 2019, 9:42 PM