OSX window control buttons and mouse leaving window

Started by Obsyd, April 18, 2016, 20:29:38

Previous topic - Next topic

Obsyd

Hello there!

I have been testing the latest "build 72" version of lwjgl 3.0. Fired up the "Getting started" example code and measured the time spent between the glClear,glfwSwapBuffers,glfwPollEvents. As expected nice semi consistent 16ms loop because of enabled vsync on a 60hz monitor.

Now, my problem is that when the cursor leaves the window I get noticeable loop time variations.
When the cursor leaves the window the loop sometimes finises in 14ms sometimes 20. (not that bad)
But when I hover around the window control buttons (red,yellow and green OSX window buttons) the loop time fluctuates excessively. Sometimes 0ms to 55ms.
It gets even more excessive if the cursor leaves the window and enters again while hovering above the window control buttons.

At first I thought my IDE was causing the troubles so I made a jar and quit every other application. Ran the jar from the terminal but no change.
Also tried to control the loop with a hungry sync that burns cpu cycles. This got the loop extremely precise but when the cursor leaves the window and interacts with the window control buttons the same fluctuation happens.

Thank you for your help!

My system:
OSX 10.10.3
i7 4770 cpu
AMD 7970 gpu



spasi

I cannot reproduce this on OSX 10.11.4, Intel Iris 6100. Could you share a short code sample that reproduces the issue please?

Obsyd

Made a small video:
https://www.youtube.com/watch?v=l1k0FtxYa8U

The only change in the "Getting started" code:
while (!glfwWindowShouldClose(window)) {
            long s = System.nanoTime();
            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer

            glfwSwapBuffers(window); // swap the color buffers

            // Poll for window events. The key callback above will only be
            // invoked during this call.
            glfwPollEvents();
            long e = System.nanoTime();
            System.out.println((e - s) / 1000000d);
        }

spasi


Obsyd

A part of the output:

16.2936
17.115284
16.417982
16.855391
50.01605
0.226693
16.671909
16.011766
16.758341
16.696481
16.499978
16.472038

spasi

I wouldn't worry about it. It's either a driver problem or an issue with the OS X compositor.

Obsyd

Ok! Thank you!

What I will do later is test on different operating systems. Will report back!

Obsyd

Tested it on windows 8.1 and there are no problems there. It is weird that lwjgl 2 does not show such behaviour on osx. (probably not so weird because all of lwjgl has changed)

Also on the windows 8.1 machine I tested the loop was extremely inconsistent with glfwSwapInterval(1);. It has an integrated inteh hd 4600 gpu. With glfwSwapInterval(0); the loop was smooth again.