http://bugs.winehq.org/show_bug.cgi?id=60555 Bug ID: 60555 Summary: winex11.drv: OpenGL child window rendered offscreen shows the previous frame until the application presents again (EGL, Xwayland) Product: Wine Version: 11.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@list.winehq.org Reporter: alessandro.abbinante@live.it Target Milestone: --- Distribution: --- An application that draws its OpenGL viewport in a child window and only redraws on input (Autodesk Fusion 360) always shows the frame before the last one. Hovering a vertex or face draws the highlight, but it only appears on screen when the next input (a click, the wheel) makes the application present another frame. A rubber-band rectangle stopped halfway lags one step behind the cursor. Reports from other users with the same symptom on AMD and NVIDIA cards: https://codeberg.org/cryinkfly/Autodesk-Fusion-360-on-Linux/issues/686 Environment: Arch Linux, wine 11.20 (Arch package), winex11.drv with the default EGL backend, Hyprland 0.56 with Xwayland 24.1.14, NVIDIA RTX 5080 with driver 615.78. What I observed: - With WINEDEBUG=+timestamp,+wgl and the cursor position logged on the same clock: while the cursor rests on a vertex for 4 seconds there is no GL call at all. The application had already drawn and swapped the frame with the highlight on the last mouse move, but the screen shows the frame before it. - Not affected by __GL_SYNC_TO_VBLANK=0 or by UseEGL=N (GLX path; this driver has no GLX_OML_sync_control). I have only tested Hyprland's Xwayland, not a plain X server. Analysis (from reading dlls/winex11.drv/opengl.c and init.c at wine-11.20 and current master): The viewport is a child window, so needs_offscreen_rendering() always returns TRUE ("child window, needs compositing") and the client window is redirected. After eglSwapBuffers(), x11drv_egl_surface_swap() only calls XFlush() and then client_surface_present(), which immediately copies the redirected window into the top-level window (X11DRV_client_surface_present -> StretchBlt). Nothing waits until the X server has applied the swap, and with a swap interval of 1 Xwayland applies it at the next frame, so the copy reads the previous contents. The GLX path waits with glXWaitForSbcOML() when GLX_OML_sync_control is available, but the EGL path has no equivalent. As an experiment, making the offscreen swap complete before the copy (swap interval 0 for offscreen surfaces, glFinish() before eglSwapBuffers() and XSync() after it) makes the highlight and the rubber band follow the cursor exactly. I am not attaching that change: it was written with an AI assistant, which the Developer FAQ does not accept. A proper fix probably needs to wait for the presentation to complete, or to copy again once it has. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.