https://bugs.kde.org/show_bug.cgi?id=417146

--- Comment #1 from Mariusz Libera <[email protected]> ---
So I got curious and started debugging this.
Adding those 2 lines:

qCDebug(KWIN_OPENGL) << "viewport-limit-width:" << limit[0] <<
"\tviewport-limit-height:" << limit[1];
qCDebug(KWIN_OPENGL) << "size-width:" << size.width() << "\tsize-height:" <<
size.height();

in function SceneOpenGL::viewportLimitsMatched right after this call:

glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit);

somehow eliminated the race condition and I could no longer reproduce the
issue.
However the debug output sometimes showed expected values:

kwin_scene_opengl: viewport-limit-width: 32768         viewport-limit-height:
32768

and other times something odd:

kwin_scene_opengl: viewport-limit-width: 1023711040        
viewport-limit-height: 21890

Anyway, it stopped triggering the if condition:

if (limit[0] < size.width() || limit[1] < size.height())

When I moved those debug statements inside the if block, the problem returned.
Here is the output of the debug statements:

kwin_scene_opengl: viewport-limit-width: -40918160        
viewport-limit-height: 22066
kwin_scene_opengl: size-width: 3840         size-height: 1080

So it seems that glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit) sometimes fails for
some reason, leaving garbage values.
I'm not an OpenGL expert so I have no idea why it would fail.

Given that this viewport limit check is not executed at all in Wayland, is it
really needed?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to