xwayland: use pixmap size on present flip
If the pixmap size does not match the present box size, flickering occurs. This can happen when the client changes its size (e.g. switching to fullscreen), and since the buffer is kept as long as the pixmap is valid, once the buffer is created, it remains at the wrong (old) size and causes continuous flickering. Use the actual pixmap's drawable size instead of the present box to create the buffer so that it's sized appropriately. Bugzilla: https://bugs.freedesktop.org/106841 Fixes:0fb2cca193
"xwayland: Preliminary support for Present's new window flip mode" Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Roman Gilg <subdiff@gmail.com> (cherry picked from commit1993f147d0
)
This commit is contained in:
parent
883d4d00b4
commit
2e66ed066e
|
@ -440,7 +440,7 @@ xwl_present_flip(WindowPtr present_window,
|
|||
{
|
||||
struct xwl_window *xwl_window = xwl_window_from_window(present_window);
|
||||
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(present_window);
|
||||
BoxPtr present_box, damage_box;
|
||||
BoxPtr damage_box;
|
||||
Bool buffer_created;
|
||||
struct wl_buffer *buffer;
|
||||
struct xwl_present_event *event;
|
||||
|
@ -448,7 +448,6 @@ xwl_present_flip(WindowPtr present_window,
|
|||
if (!xwl_window)
|
||||
return FALSE;
|
||||
|
||||
present_box = RegionExtents(&present_window->winSize);
|
||||
damage_box = RegionExtents(damage);
|
||||
|
||||
event = malloc(sizeof *event);
|
||||
|
@ -458,8 +457,8 @@ xwl_present_flip(WindowPtr present_window,
|
|||
xwl_window->present_window = present_window;
|
||||
|
||||
buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap,
|
||||
present_box->x2 - present_box->x1,
|
||||
present_box->y2 - present_box->y1,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height,
|
||||
&buffer_created);
|
||||
|
||||
event->event_id = event_id;
|
||||
|
|
Loading…
Reference in New Issue