check window visibility at expose event
ClosedPublic

Authored by mart on Jun 13 2017, 3:33 PM.

Details

Summary

it's possible that a window gets an expose event even if the qwindow
is not visible, this can cause problems like the window decoration
created too soon, before kwin's ShellClient is created, so
setting the decoration mode has no effect, it can give
windows that have for an instant the wrong geometry as it
includes a non existing decoration

Test Plan

i now get the decoration client always being created after
the decoratininterface in kwin, so setting borders to none
actually works

Diff Detail

Repository
R135 Integration for Qt applications in Plasma
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Jun 13 2017, 3:33 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 13 2017, 3:33 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

it's possible that a window gets an expose event even if the qwindow

is not visible

How?

QWaylandXdgSurfaceV6::handleExpose returns false if it's not configured yet, and we can't receive a configure before we've created the shell, and we don't create the shell till we're visible.

davidedmundson accepted this revision.Jun 13 2017, 3:53 PM

Edit.

qwaylandwindow code is:

if (!  (mShellSurface && mShellSurface->handleExpose(rect)))
    QWindowSystemInterface::handleExposeEvent(window(), rect);

so if there's no shell, we always send the expose event. Sounds mad to me, but does mean this patch makes sense.

This revision is now accepted and ready to land.Jun 13 2017, 3:53 PM
mart added a comment.Jun 13 2017, 3:54 PM

it's possible that a window gets an expose event even if the qwindow

is not visible

How?

QWaylandXdgSurfaceV6::handleExpose returns false if it's not configured yet, and we can't receive a configure before we've created the shell, and we don't create the shell till we're visible.

tough i clearly receive an expose event right after windows are created, before they are set to visible (perhaps when qtwayland is creating the surface the first time before is shown?)

mart added a comment.Jun 13 2017, 3:54 PM

Edit.

qwaylandwindow code is:

if (!  (mShellSurface && mShellSurface->handleExpose(rect)))
    QWindowSystemInterface::handleExposeEvent(window(), rect);

so if there's no shell, we always send the expose event. Sounds mad to me, but does mean this patch makes sense.

Ha! indeed it is, and we'll probably need to do similar things in the other places we do the expose event workaround

This revision was automatically updated to reflect the committed changes.