Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package xwayland for openSUSE:Factory checked in at 2024-08-26 22:05:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xwayland (Old) and /work/SRC/openSUSE:Factory/.xwayland.new.2698 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xwayland" Mon Aug 26 22:05:27 2024 rev:35 rq:1195855 version:24.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/xwayland/xwayland.changes 2024-07-14 08:49:56.735223001 +0200 +++ /work/SRC/openSUSE:Factory/.xwayland.new.2698/xwayland.changes 2024-08-26 22:06:41.573153343 +0200 @@ -1,0 +2,9 @@ +Sat Aug 24 20:14:05 UTC 2024 - Stefan Dirsch <sndir...@suse.com> + +- Update to bugfix release 24.1.2 + * This release addresses several issues, including the first + events being skipped with input emulation using libEI or a fix + with rendering using the UYVY format with the X-Video extension + using GLAMOR. + +------------------------------------------------------------------- Old: ---- xwayland-24.1.1.tar.xz xwayland-24.1.1.tar.xz.sig New: ---- xwayland-24.1.2.tar.xz xwayland-24.1.2.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xwayland.spec ++++++ --- /var/tmp/diff_new_pack.26dIiq/_old 2024-08-26 22:06:42.041172897 +0200 +++ /var/tmp/diff_new_pack.26dIiq/_new 2024-08-26 22:06:42.041172897 +0200 @@ -22,7 +22,7 @@ %endif Name: xwayland -Version: 24.1.1 +Version: 24.1.2 Release: 0 URL: http://xorg.freedesktop.org Summary: Xwayland Xserver ++++++ xwayland-24.1.1.tar.xz -> xwayland-24.1.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/Xi/listdev.c new/xwayland-24.1.2/Xi/listdev.c --- old/xwayland-24.1.1/Xi/listdev.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/Xi/listdev.c 2024-08-07 11:22:21.000000000 +0200 @@ -350,7 +350,7 @@ }; /* allocate space for saving skip value */ - skip = calloc(sizeof(Bool), inputInfo.numDevices); + skip = calloc(inputInfo.numDevices, sizeof(Bool)); if (!skip) return BadAlloc; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/Xi/xiquerydevice.c new/xwayland-24.1.2/Xi/xiquerydevice.c --- old/xwayland-24.1.1/Xi/xiquerydevice.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/Xi/xiquerydevice.c 2024-08-07 11:22:21.000000000 +0200 @@ -88,7 +88,7 @@ len += SizeDeviceInfo(dev); } else { - skip = calloc(sizeof(Bool), inputInfo.numDevices); + skip = calloc(inputInfo.numDevices, sizeof(Bool)); if (!skip) return BadAlloc; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/dix/extension.c new/xwayland-24.1.2/dix/extension.c --- old/xwayland-24.1.1/dix/extension.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/dix/extension.c 2024-08-07 11:22:21.000000000 +0200 @@ -89,7 +89,7 @@ return ((ExtensionEntry *) NULL); } - ext = calloc(sizeof(ExtensionEntry), 1); + ext = calloc(1, sizeof(ExtensionEntry)); if (!ext) return NULL; if (!dixAllocatePrivates(&ext->devPrivates, PRIVATE_EXTENSION)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/dix/main.c new/xwayland-24.1.2/dix/main.c --- old/xwayland-24.1.1/dix/main.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/dix/main.c 2024-08-07 11:22:21.000000000 +0200 @@ -156,7 +156,7 @@ CreateWellKnownSockets(); for (i = 1; i < LimitClients; i++) clients[i] = NullClient; - serverClient = calloc(sizeof(ClientRec), 1); + serverClient = calloc(1, sizeof(ClientRec)); if (!serverClient) FatalError("couldn't create server client"); InitClient(serverClient, 0, (void *) NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/dix/privates.c new/xwayland-24.1.2/dix/privates.c --- old/xwayland-24.1.1/dix/privates.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/dix/privates.c 2024-08-07 11:22:21.000000000 +0200 @@ -413,7 +413,7 @@ assert(key->type == type); return TRUE; } - key = calloc(sizeof(DevPrivateKeyRec), 1); + key = calloc(1, sizeof(DevPrivateKeyRec)); if (!key) return FALSE; if (!dixRegisterPrivateKey(key, type, size)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/glamor/glamor_egl.c new/xwayland-24.1.2/glamor/glamor_egl.c --- old/xwayland-24.1.1/glamor/glamor_egl.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/glamor/glamor_egl.c 2024-08-07 11:22:21.000000000 +0200 @@ -1089,7 +1089,7 @@ Bool force_es = FALSE; const char *glvnd_vendor = NULL; - glamor_egl = calloc(sizeof(*glamor_egl), 1); + glamor_egl = calloc(1, sizeof(*glamor_egl)); if (glamor_egl == NULL) return FALSE; if (xf86GlamorEGLPrivateIndex == -1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/glamor/glamor_program.c new/xwayland-24.1.2/glamor/glamor_program.c --- old/xwayland-24.1.1/glamor/glamor_program.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/glamor/glamor_program.c 2024-08-07 11:22:21.000000000 +0200 @@ -359,8 +359,6 @@ vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_prog_string); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, fs_prog_string); - free(vs_prog_string); - free(fs_prog_string); glAttachShader(prog->prog, vs_prog); glDeleteShader(vs_prog); glAttachShader(prog->prog, fs_prog); @@ -394,6 +392,8 @@ prog->atlas_uniform = glamor_get_uniform(prog, glamor_program_location_atlas, "atlas"); free(version_string); + free(vs_prog_string); + free(fs_prog_string); free(fs_vars); free(vs_vars); return TRUE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/glamor/glamor_transfer.c new/xwayland-24.1.2/glamor/glamor_transfer.c --- old/xwayland-24.1.1/glamor/glamor_transfer.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/glamor/glamor_transfer.c 2024-08-07 11:22:21.000000000 +0200 @@ -37,8 +37,8 @@ PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); int box_index; - int bytes_per_pixel = drawable->bitsPerPixel >> 3; const struct glamor_format *f = glamor_format_for_pixmap(pixmap); + int bytes_per_pixel = PICT_FORMAT_BPP(f->render_format) >> 3; char *tmp_bits = NULL; if (glamor_drawable_effective_depth(drawable) == 24 && pixmap->drawable.depth == 32) @@ -145,8 +145,8 @@ PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); int box_index; - int bytes_per_pixel = drawable->bitsPerPixel >> 3; const struct glamor_format *f = glamor_format_for_pixmap(pixmap); + int bytes_per_pixel = PICT_FORMAT_BPP(f->render_format) >> 3; glamor_make_current(glamor_priv); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/glamor/glamor_xv.c new/xwayland-24.1.2/glamor/glamor_xv.c --- old/xwayland-24.1.1/glamor/glamor_xv.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/glamor/glamor_xv.c 2024-08-07 11:22:21.000000000 +0200 @@ -141,24 +141,22 @@ "in vec2 tcs;\n" ), .fs_exec = ( - " vec3 uyv;\n" - " vec4 frameOut = texture2D(sampler, tcs.st);\n" - "\n" - " vec4 prevPixel = texture2D(sampler, vec2(tcs.s - texelSize.x, tcs.t));\n" - " vec4 nextPixel = texture2D(sampler, vec2(tcs.s + texelSize.x, tcs.t));\n" - "\n" - " float delta = 0.50;\n" - "\n" - " int even = int(mod(tcs.x / texelSize.x, 2.0));\n" - "\n" - " uyv.rgb = float(even)*vec3(frameOut.rg, nextPixel.r) + (1.0-float(even))*vec3(prevPixel.r, frameOut.gr);\n" - "\n" - " frameOut.r = uyv.g + 1.403*(uyv.r - delta);\n" - " frameOut.g = uyv.g - 0.714*(uyv.r - delta) - 0.344*(uyv.b - delta);\n" - " frameOut.b = uyv.g + 1.773*(uyv.b - delta);\n" - " frameOut.a = 1.0;\n" - " frag_color = frameOut;\n" - ), + " vec4 temp1;\n" + " vec2 xy = texture(sampler, tcs.st).xy;\n" + " vec2 prev_xy = texture(sampler, vec2(tcs.s - texelSize.x, tcs.t)).xy;\n" + " vec2 next_xy = texture(sampler, vec2(tcs.s + texelSize.x, tcs.t)).xy;\n" + "\n" + " vec3 sample_yuv;\n" + " int odd = int(mod(tcs.x / texelSize.x, 2.0));\n" + " int even = 1 - odd;\n" + " sample_yuv.yxz = float(even)*vec3(xy, next_xy.x) + float(odd)*vec3(prev_xy.x, xy.yx);\n" + "\n" + " temp1.xyz = offsetyco.www * vec3(sample_yuv.x) + offsetyco.xyz;\n" + " temp1.xyz = ucogamma.xyz * vec3(sample_yuv.y) + temp1.xyz;\n" + " temp1.xyz = clamp(vco.xyz * vec3(sample_yuv.z) + temp1.xyz, 0.0, 1.0);\n" + " temp1.w = 1.0;\n" + " frag_color = temp1;\n" + ), }; static const glamor_facet glamor_facet_xv_rgb_raw = { @@ -379,9 +377,16 @@ offsets[0] = 0; size *= *h; break; - case FOURCC_RGB565: case FOURCC_UYVY: /* UYVU is single-plane really, all tranformation is processed inside a shader */ + size = ALIGN(*w, 2) * 2; + if (pitches) + pitches[0] = size; + if (offsets) + offsets[0] = 0; + size *= *h; + break; + case FOURCC_RGB565: size = *w * 2; if (pitches) pitches[0] = size; @@ -787,6 +792,15 @@ buf + s2offset, srcPitch); break; case FOURCC_UYVY: + srcPitch = ALIGN(width, 2) * 2; + full_box.x1 = 0; + full_box.y1 = 0; + full_box.x2 = width; + full_box.y2 = height; + glamor_upload_boxes(&port_priv->src_pix[0]->drawable, &full_box, 1, + 0, 0, 0, 0, + buf, srcPitch); + break; case FOURCC_RGB565: srcPitch = width * 2; full_box.x1 = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/hw/xwayland/xwayland-glamor-gbm.c new/xwayland-24.1.2/hw/xwayland/xwayland-glamor-gbm.c --- old/xwayland-24.1.1/hw/xwayland/xwayland-glamor-gbm.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/hw/xwayland/xwayland-glamor-gbm.c 2024-08-07 11:22:21.000000000 +0200 @@ -33,7 +33,9 @@ #include <fcntl.h> #include <errno.h> #include <poll.h> +#ifdef DRI3 #include <sys/eventfd.h> +#endif /* DRI3 */ #include <sys/stat.h> #include <xf86drm.h> #include <drm_fourcc.h> @@ -234,9 +236,9 @@ xwl_pixmap->bo = bo; xwl_pixmap->buffer = NULL; xwl_pixmap->implicit_modifier = implicit_modifier; -#ifdef XWL_HAS_GLAMOR +#if defined(XWL_HAS_GLAMOR) && defined(DRI3) xwl_pixmap->efd = -1; -#endif /* XWL_HAS_GLAMOR */ +#endif /* defined(XWL_HAS_GLAMOR) && defined(DRI3) */ #ifdef GBM_BO_FD_FOR_PLANE if (xwl_gbm->dmabuf_capable) { @@ -679,6 +681,7 @@ } } +#ifdef DRI3 static void sync_callback(void *data, struct wl_callback *callback, uint32_t serial) { @@ -741,6 +744,7 @@ return Success; } +#endif /* DRI3 */ PixmapPtr glamor_pixmap_from_fds(ScreenPtr screen, CARD8 num_fds, const int *fds, @@ -981,6 +985,7 @@ close(sync_file); } +#ifdef DRI3 struct xwl_dri3_syncobj { struct dri3_syncobj base; @@ -1239,6 +1244,7 @@ .get_drawable_modifiers = xwl_glamor_get_drawable_modifiers, .import_syncobj = NULL, /* need to check for kernel support */ }; +#endif /* DRI3 */ static const char * get_render_node_path_for_device(const drmDevicePtr drm_device, @@ -1768,7 +1774,7 @@ } /* NVIDIA driver does not support implicit sync */ xwl_gbm->implicit_sync = !strstr(egl_vendor, "NVIDIA"); - +#ifdef DRI3 if (xwl_gbm_supports_syncobjs(xwl_screen) && epoxy_has_egl_extension(xwl_screen->egl_display, "ANDROID_native_fence_sync")) @@ -1779,7 +1785,7 @@ wp_linux_drm_syncobj_manager_v1_destroy(xwl_screen->explicit_sync); xwl_screen->explicit_sync = NULL; } - +#endif /* DRI3 */ return TRUE; error: if (xwl_screen->egl_display != EGL_NO_DISPLAY) { @@ -1796,7 +1802,7 @@ xwl_glamor_gbm_init_screen(struct xwl_screen *xwl_screen) { struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); - +#ifdef DRI3 if (xwl_gbm->supports_syncobjs) { xwl_dri3_info.version = 4; xwl_dri3_info.import_syncobj = xwl_dri3_import_syncobj; @@ -1806,7 +1812,7 @@ ErrorF("Failed to initialize dri3\n"); goto error; } - +#endif /* DRI3 */ if (xwl_gbm->fd_render_node) goto skip_drm_auth; @@ -1850,7 +1856,7 @@ if (!dixRegisterPrivateKey(&xwl_gbm_private_key, PRIVATE_SCREEN, 0)) return FALSE; - xwl_gbm = calloc(sizeof(*xwl_gbm), 1); + xwl_gbm = calloc(1, sizeof(*xwl_gbm)); if (!xwl_gbm) { ErrorF("glamor: Not enough memory to setup GBM, disabling\n"); return FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/hw/xwayland/xwayland-input.c new/xwayland-24.1.2/hw/xwayland/xwayland-input.c --- old/xwayland-24.1.1/hw/xwayland/xwayland-input.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/hw/xwayland/xwayland-input.c 2024-08-07 11:22:21.000000000 +0200 @@ -1213,6 +1213,10 @@ xwl_seat->xwl_screen->serial = serial; xwl_seat->keyboard_focus = surface; + /* If `leave` wasn't sent (for a destroyed surface), release keys here. */ + wl_array_for_each(k, &xwl_seat->keys) + QueueKeyboardEvents(xwl_seat->keyboard, LeaveNotify, *k + 8); + wl_array_copy(&xwl_seat->keys, keys); wl_array_for_each(k, &xwl_seat->keys) QueueKeyboardEvents(xwl_seat->keyboard, EnterNotify, *k + 8); @@ -1227,6 +1231,7 @@ wl_array_for_each(k, &xwl_seat->keys) QueueKeyboardEvents(xwl_seat->keyboard, LeaveNotify, *k + 8); + xwl_seat->keys.size = 0; xwl_seat->keyboard_focus = NULL; @@ -2870,7 +2875,7 @@ struct xwl_seat *xwl_seat = data; struct xwl_tablet *xwl_tablet; - xwl_tablet = calloc(sizeof *xwl_tablet, 1); + xwl_tablet = calloc(1, sizeof *xwl_tablet); if (xwl_tablet == NULL) { ErrorF("%s ENOMEM\n", __func__); return; @@ -2901,7 +2906,7 @@ struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; struct xwl_tablet_tool *xwl_tablet_tool; - xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1); + xwl_tablet_tool = calloc(1, sizeof *xwl_tablet_tool); if (xwl_tablet_tool == NULL) { ErrorF("%s ENOMEM\n", __func__); return; @@ -2924,7 +2929,7 @@ struct xwl_seat *xwl_seat = data; struct xwl_tablet_pad *xwl_tablet_pad; - xwl_tablet_pad = calloc(sizeof *xwl_tablet_pad, 1); + xwl_tablet_pad = calloc(1, sizeof *xwl_tablet_pad); if (xwl_tablet_pad == NULL) { ErrorF("%s ENOMEM\n", __func__); return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/hw/xwayland/xwayland-present.c new/xwayland-24.1.2/hw/xwayland/xwayland-present.c --- old/xwayland-24.1.1/hw/xwayland/xwayland-present.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/hw/xwayland/xwayland-present.c 2024-08-07 11:22:21.000000000 +0200 @@ -31,7 +31,9 @@ #endif #include <windowstr.h> #include <present.h> +#ifdef DRI3 #include <sys/eventfd.h> +#endif /* DRI3 */ #include "xwayland-present.h" #include "xwayland-screen.h" @@ -328,7 +330,7 @@ static void xwl_present_free_idle_vblank(present_vblank_ptr vblank) { -#ifdef XWL_HAS_GLAMOR +#if defined(XWL_HAS_GLAMOR) && defined(DRI3) if (vblank->release_syncobj) { /* transfer implicit fence to release syncobj */ int fence_fd = xwl_glamor_dmabuf_export_sync_file(vblank->pixmap); @@ -336,7 +338,7 @@ vblank->release_point, fence_fd); } else -#endif /* XWL_HAS_GLAMOR */ +#endif /* defined(XWL_HAS_GLAMOR) && defined(DRI3) */ present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); xwl_present_free_event(xwl_present_event_from_vblank(vblank)); @@ -393,7 +395,9 @@ xwl_present_flip_notify_vblank(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) { WindowPtr window = vblank->window; +#ifdef DRI3 struct xwl_screen *xwl_screen = xwl_screen_get(window->drawable.pScreen); +#endif /* DRI3 */ struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); uint8_t mode = PresentCompleteModeFlip; @@ -507,7 +511,7 @@ vblank = &event->vblank; -#ifdef XWL_HAS_GLAMOR +#if defined(XWL_HAS_GLAMOR) && defined(DRI3) if (vblank->release_syncobj) { /* transfer implicit fence to release syncobj */ int fence_fd = xwl_glamor_dmabuf_export_sync_file(vblank->pixmap); @@ -515,7 +519,7 @@ vblank->release_point, fence_fd); } else -#endif /* XWL_HAS_GLAMOR */ +#endif /* defined(XWL_HAS_GLAMOR) && defined(DRI3) */ present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); xwl_present_window = xwl_present_window_priv(vblank->window); @@ -881,7 +885,7 @@ event->pixmap = pixmap; -#ifdef XWL_HAS_GLAMOR +#if defined(XWL_HAS_GLAMOR) && defined(DRI3) if (vblank->acquire_syncobj && vblank->release_syncobj) { if (xwl_window->xwl_screen->explicit_sync) { xwl_glamor_dri3_syncobj_passthrough(xwl_window, @@ -898,7 +902,7 @@ xwl_glamor_dmabuf_import_sync_file(vblank->pixmap, fence_fd); } } -#endif /* XWL_HAS_GLAMOR */ +#endif /* defined(XWL_HAS_GLAMOR) && defined(DRI3) */ if (implicit_sync) { xwl_pixmap_set_buffer_release_cb(pixmap, xwl_present_buffer_release, event); @@ -950,7 +954,7 @@ return TRUE; } -#ifdef XWL_HAS_GLAMOR +#if defined(XWL_HAS_GLAMOR) && defined(DRI3) static void xwl_present_acquire_fence_avail(int fd, int xevents, void *data) { @@ -962,13 +966,13 @@ xwl_present_re_execute(vblank); } -#endif /* XWL_HAS_GLAMOR */ +#endif /* defined(XWL_HAS_GLAMOR) && defined(DRI3) */ static Bool xwl_present_wait_acquire_fence_avail(struct xwl_screen *xwl_screen, present_vblank_ptr vblank) { -#ifdef XWL_HAS_GLAMOR +#if defined(XWL_HAS_GLAMOR) && defined(DRI3) /* If the compositor does not support explicit sync we need to wait for the * acquire fence to be submitted before flipping. */ if (vblank->flip && !xwl_screen->explicit_sync && @@ -982,7 +986,7 @@ vblank->efd); return TRUE; } -#endif /* XWL_HAS_GLAMOR */ +#endif /* defined(XWL_HAS_GLAMOR) && defined(DRI3) */ return FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/hw/xwayland/xwayland-window-buffers.c new/xwayland-24.1.2/hw/xwayland/xwayland-window-buffers.c --- old/xwayland-24.1.1/hw/xwayland/xwayland-window-buffers.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/hw/xwayland/xwayland-window-buffers.c 2024-08-07 11:22:21.000000000 +0200 @@ -39,7 +39,9 @@ #include "dri3.h" #include <poll.h> +#ifdef DRI3 #include <sys/eventfd.h> +#endif #include "linux-drm-syncobj-v1-client-protocol.h" #define BUFFER_TIMEOUT 1 * 1000 /* ms */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/hw/xwayland/xwayland-window.c new/xwayland-24.1.2/hw/xwayland/xwayland-window.c --- old/xwayland-24.1.1/hw/xwayland/xwayland-window.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/hw/xwayland/xwayland-window.c 2024-08-07 11:22:21.000000000 +0200 @@ -494,6 +494,18 @@ return window; } +static Bool +is_output_suitable_for_fullscreen(struct xwl_output *xwl_output) +{ + if (xwl_output == NULL) + return FALSE; + + if (xwl_output->width == 0 || xwl_output->height == 0) + return FALSE; + + return TRUE; +} + static struct xwl_output * xwl_window_get_output(struct xwl_window *xwl_window) { @@ -501,11 +513,11 @@ struct xwl_output *xwl_output; xwl_output = xwl_output_get_output_from_name(xwl_screen, xwl_screen->output_name); - if (xwl_output) + if (is_output_suitable_for_fullscreen(xwl_output)) return xwl_output; xwl_output = xwl_output_from_wl_output(xwl_screen, xwl_window->wl_output); - if (xwl_output) + if (is_output_suitable_for_fullscreen(xwl_output)) return xwl_output; return xwl_screen_get_first_output(xwl_screen); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/hw/xwayland/xwayland-xtest.c new/xwayland-24.1.2/hw/xwayland/xwayland-xtest.c --- old/xwayland-24.1.1/hw/xwayland/xwayland-xtest.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/hw/xwayland/xwayland-xtest.c 2024-08-07 11:22:21.000000000 +0200 @@ -724,6 +724,38 @@ } static void +xwl_ei_update_caps(struct xwl_ei_client *xwl_ei_client, + struct ei_device *ei_device) +{ + struct xwl_abs_device *abs; + + if (ei_device == xwl_ei_client->ei_pointer) + xwl_ei_client->accept_pointer = true; + + if (ei_device == xwl_ei_client->ei_keyboard) + xwl_ei_client->accept_keyboard = true; + + xorg_list_for_each_entry(abs, &xwl_ei_client->abs_devices, link) { + if (ei_device == abs->device) + xwl_ei_client->accept_abs = true; + } +} + +static bool +xwl_ei_devices_are_ready(struct xwl_ei_client *xwl_ei_client) +{ + if ((xwl_ei_client->accept_keyboard || + !ei_seat_has_capability(xwl_ei_client->ei_seat, EI_DEVICE_CAP_KEYBOARD)) && + (xwl_ei_client->accept_pointer || + !ei_seat_has_capability(xwl_ei_client->ei_seat, EI_DEVICE_CAP_POINTER)) && + (xwl_ei_client->accept_abs || + !ei_seat_has_capability(xwl_ei_client->ei_seat, EI_DEVICE_CAP_POINTER_ABSOLUTE))) + return true; + + return false; +} + +static void xwl_handle_ei_event(int fd, int ready, void *data) { struct xwl_ei_client *xwl_ei_client = data; @@ -828,32 +860,25 @@ break; case EI_EVENT_DEVICE_RESUMED: debug_ei("Device resumed\n"); - if (ei_device == xwl_ei_client->ei_pointer) - xwl_ei_client->accept_pointer = true; - if (ei_device == xwl_ei_client->ei_keyboard) - xwl_ei_client->accept_keyboard = true; - { - struct xwl_abs_device *abs; - - xorg_list_for_each_entry(abs, &xwl_ei_client->abs_devices, - link) { - if (ei_device == abs->device) - xwl_ei_client->accept_abs = true; - } - } - + xwl_ei_update_caps(xwl_ei_client, ei_device); /* Server has accepted our device (or resumed them), * we can now start sending events */ /* FIXME: Maybe add a timestamp and discard old events? */ - xwl_ei_start_emulating(xwl_ei_client); - xwl_dequeue_emulated_events(xwl_ei_client); + if (xwl_ei_devices_are_ready(xwl_ei_client)) { + xwl_ei_start_emulating(xwl_ei_client); + xwl_dequeue_emulated_events(xwl_ei_client); + } if (!xwl_ei_client->client && xorg_list_is_empty(&xwl_ei_client->pending_emulated_events)) /* All events dequeued and client has disconnected in the meantime */ xwl_ei_stop_emulating(xwl_ei_client); break; + case EI_EVENT_KEYBOARD_MODIFIERS: + debug_ei("Ignored event %s (%d)\n", ei_event_type_to_string(type), type); + /* Don't care */ + break; default: - error_ei("Unhandled event %d\n", type); + error_ei("Unhandled event %s (%d)\n", ei_event_type_to_string(type), type); break; } ei_event_unref(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/meson.build new/xwayland-24.1.2/meson.build --- old/xwayland-24.1.1/meson.build 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/meson.build 2024-08-07 11:22:21.000000000 +0200 @@ -3,10 +3,10 @@ 'buildtype=debugoptimized', 'c_std=gnu99', ], - version: '24.1.1', + version: '24.1.2', meson_version: '>= 0.56.0', ) -release_date = '2024-07-10' +release_date = '2024-08-07' add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc']) cc = meson.get_compiler('c') @@ -332,14 +332,18 @@ libdrm_dep = dependency('libdrm', version: libdrm_req, required: false) +have_eventfd = cc.has_header('sys/eventfd.h') if get_option('dri3') == 'auto' - build_dri3 = dri3proto_dep.found() and xshmfence_dep.found() and libdrm_dep.found() + build_dri3 = dri3proto_dep.found() and xshmfence_dep.found() and libdrm_dep.found() and have_eventfd else build_dri3 = get_option('dri3') == 'true' if build_dri3 if not xshmfence_dep.found() error('DRI3 requested, but xshmfence not found') endif + if not have_eventfd + error('DRI3 requested, but sys/eventfd.h not found') + endif endif endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/os/access.c new/xwayland-24.1.2/os/access.c --- old/xwayland-24.1.1/os/access.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/os/access.c 2024-08-07 11:22:21.000000000 +0200 @@ -1866,7 +1866,7 @@ char hostname[SI_HOSTNAME_MAXLEN]; int f, hostaddrlen; void *hostaddr; - const char **addrlist; + char **addrlist; if (siAddrLen >= sizeof(hostname)) return FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.1/xfixes/cursor.c new/xwayland-24.1.2/xfixes/cursor.c --- old/xwayland-24.1.1/xfixes/cursor.c 2024-07-10 13:40:59.000000000 +0200 +++ new/xwayland-24.1.2/xfixes/cursor.c 2024-08-07 11:22:21.000000000 +0200 @@ -379,8 +379,8 @@ width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; - rep = calloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32), - 1); + rep = calloc(1, + sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32)); if (!rep) return BadAlloc; @@ -531,8 +531,8 @@ name = pCursor->name ? NameForAtom(pCursor->name) : ""; nbytes = strlen(name); nbytesRound = pad_to_int32(nbytes); - rep = calloc(sizeof(xXFixesGetCursorImageAndNameReply) + - npixels * sizeof(CARD32) + nbytesRound, 1); + rep = calloc(1, sizeof(xXFixesGetCursorImageAndNameReply) + + npixels * sizeof(CARD32) + nbytesRound); if (!rep) return BadAlloc;