xwayland: Don't create wl_buffer backing pixmap

In non-rootless mode, not all pixmaps need a wl_buffer backing.

Suggested-by: Twaik Yont (@twaik) in #834
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
Olivier Fourdan 2019-07-09 11:08:27 +02:00 committed by Olivier Fourdan
parent edf964434e
commit 0f19381f49
3 changed files with 6 additions and 4 deletions

View File

@ -66,7 +66,8 @@ xwl_realize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
PixmapPtr pixmap;
pixmap = xwl_shm_create_pixmap(screen, cursor->bits->width,
cursor->bits->height, 32, 0);
cursor->bits->height, 32,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, pixmap);
return TRUE;

View File

@ -212,9 +212,9 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
PixmapPtr pixmap = NULL;
if (width > 0 && height > 0 && depth >= 15 &&
(hint == 0 ||
hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP ||
hint == CREATE_PIXMAP_USAGE_SHARED)) {
(hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP ||
hint == CREATE_PIXMAP_USAGE_SHARED ||
(xwl_screen->rootless && hint == 0))) {
uint32_t format = gbm_format_for_depth(depth);
#ifdef GBM_BO_WITH_MODIFIERS

View File

@ -202,6 +202,7 @@ xwl_shm_create_pixmap(ScreenPtr screen,
int fd;
if (hint == CREATE_PIXMAP_USAGE_GLYPH_PICTURE ||
(!xwl_screen->rootless && hint != CREATE_PIXMAP_USAGE_BACKING_PIXMAP) ||
(width == 0 && height == 0) || depth < 15)
return fbCreatePixmap(screen, width, height, depth, hint);