Commit 35193586 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

winex11.drv: Move the dummy parent window to (0, 0).

Move the dummy parent window from (-1, -1) to (0, 0) so that the window is considered visible by Wayland. The X11 window region is set to an empty rectangle so that the window is still in fact invisible. If Xshape support is not compiled in, then fall back to using (-1, -1). This fixes poor performance when running Office 2016 on Xwayland. It's caused by glXWaitForSbcOML() in glxdrv_wglSwapBuffers() taking 1 second every time it gets called. The timeout is from TIMER_LEN_FLIP (1000ms) in xwl_present_reset_timer() in the xserver source code hw/xwayland/xwayland-present.c. Xwayland doesn't actually know when a frame is visible on screen[1][2]. It relies on a timer to simulate the process and when the window is invisible it uses a timer with a 1000ms timeout. This patch makes the dummy parent window visible so that Xwayland will use the timer with a 17ms timeout(~60fps), which also means that there will still be a 60fps limit for some windows when running on Xwayland. [1]: https://gitlab.freedesktop.org/xorg/xserver/-/issues/971 [2]: https://gitlab.freedesktop.org/xorg/xserver/-/issues/973
parent 8713e2ad
......@@ -1512,9 +1512,22 @@ Window get_dummy_parent(void)
attrib.override_redirect = True;
attrib.border_pixel = 0;
attrib.colormap = default_colormap;
#ifdef HAVE_LIBXSHAPE
{
static XRectangle empty_rect;
dummy_parent = XCreateWindow( gdi_display, root_window, 0, 0, 1, 1, 0,
default_visual.depth, InputOutput, default_visual.visual,
CWColormap | CWBorderPixel | CWOverrideRedirect, &attrib );
XShapeCombineRectangles( gdi_display, dummy_parent, ShapeBounding, 0, 0, &empty_rect, 1,
ShapeSet, YXBanded );
}
#else
dummy_parent = XCreateWindow( gdi_display, root_window, -1, -1, 1, 1, 0, default_visual.depth,
InputOutput, default_visual.visual,
CWColormap | CWBorderPixel | CWOverrideRedirect, &attrib );
WARN("Xshape support is not compiled in. Applications under XWayland may have poor performance.");
#endif
XMapWindow( gdi_display, dummy_parent );
}
return dummy_parent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment