Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package xwayland for openSUSE:Factory checked in at 2025-02-07 22:46:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xwayland (Old) and /work/SRC/openSUSE:Factory/.xwayland.new.2316 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xwayland" Fri Feb 7 22:46:57 2025 rev:39 rq:1243618 version:24.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/xwayland/xwayland.changes 2024-11-06 16:49:32.666199877 +0100 +++ /work/SRC/openSUSE:Factory/.xwayland.new.2316/xwayland.changes 2025-02-07 22:47:01.197172435 +0100 @@ -1,0 +2,26 @@ +Thu Feb 6 11:54:10 UTC 2025 - Stefan Dirsch <[email protected]> + +- Update to 24.1.5 + * os: NextDPMSTimeout: mark intentional fallthroughs in switch + * Xi: avoid NULL pointer dereference if GetXTestDevice returns NULL + * render: avoid NULL pointer dereference if PictureFindVisual returns NULL + * dix: fix button offset when generating DeviceButtonStateNotify events + * dix: limit checks to MAX_VALUATORS when generating Xi events + * dix-config.h: add HAVE_SOCKLEN_T definition + * xwayland: copy repeat settings from the compositor map + * xwayland: Don't run key behaviors and actions + * xwayland/glamor/gbm: Don't close fence_fd after xwl_glamor_wait_fence + * xwayland/present: Check allow_commits in xwl_present_flip + * xwayland/glamor: Drop expecting_event bailing from xwl_drm_handle_device + * xwayland: Always decrement expecting_event in xwl_output_create + * xwayland/glamor: Clean-up GBM's screen private on failure + * xwayland: Do not keep the cursor's pixmap around + * xkb: Always use MAP_LENGTH keymap size + * os/connection: Make sure partial is initialized + * xwayland/glamor: Disable GLAMOR after GBM cleanup + * glamor: return the result of gbm_format_for_depth + * glamor: use gbm_format_for_depth instead of open-coding it + * glamor: reject configs using unsupported rgbBits size + * xwayland: prevent potential null pointer dereference + +------------------------------------------------------------------- @@ -4 +30 @@ -- Security update 21.1.14 +- Security update 24.1.4 Old: ---- xwayland-24.1.4.tar.xz xwayland-24.1.4.tar.xz.sig New: ---- xwayland-24.1.5.tar.xz xwayland-24.1.5.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xwayland.spec ++++++ --- /var/tmp/diff_new_pack.QUYSnE/_old 2025-02-07 22:47:02.329219135 +0100 +++ /var/tmp/diff_new_pack.QUYSnE/_new 2025-02-07 22:47:02.333219300 +0100 @@ -1,7 +1,7 @@ # # spec file for package xwayland # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ %endif Name: xwayland -Version: 24.1.4 +Version: 24.1.5 Release: 0 URL: http://xorg.freedesktop.org Summary: Xwayland Xserver ++++++ xwayland-24.1.4.tar.xz -> xwayland-24.1.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/Xi/xichangehierarchy.c new/xwayland-24.1.5/Xi/xichangehierarchy.c --- old/xwayland-24.1.4/Xi/xichangehierarchy.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/Xi/xichangehierarchy.c 2025-02-05 13:51:33.000000000 +0100 @@ -271,11 +271,13 @@ goto unwind; XTestptr = GetXTestDevice(ptr); + BUG_RETURN_VAL(XTestptr == NULL, BadDevice); rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess); if (rc != Success) goto unwind; XTestkeybd = GetXTestDevice(keybd); + BUG_RETURN_VAL(XTestkeybd == NULL, BadDevice); rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, DixDestroyAccess); if (rc != Success) goto unwind; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/dix/enterleave.c new/xwayland-24.1.5/dix/enterleave.c --- old/xwayland-24.1.4/dix/enterleave.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/dix/enterleave.c 2025-02-05 13:51:33.000000000 +0100 @@ -740,7 +740,7 @@ (ev - 1)->deviceid |= MORE_EVENTS; bev->type = DeviceButtonStateNotify; bev->deviceid = dev->id; - memcpy((char *) &bev->buttons[4], (char *) &b->down[4], + memcpy((char *) &bev->buttons[0], (char *) &b->down[4], DOWN_LENGTH - 4); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/dix/eventconvert.c new/xwayland-24.1.5/dix/eventconvert.c --- old/xwayland-24.1.4/dix/eventconvert.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/dix/eventconvert.c 2025-02-05 13:51:33.000000000 +0100 @@ -736,7 +736,7 @@ ptr += xde->buttons_len * 4; axisval = (FP3232 *) (ptr + xde->valuators_len * 4); - for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++) { + for (i = 0; i < MAX_VALUATORS; i++) { if (BitIsOn(ev->valuators.mask, i)) { SetBit(ptr, i); *axisval = double_to_fp3232(ev->valuators.data[i]); @@ -803,7 +803,7 @@ ptr = (char *) &raw[1]; axisval = (FP3232 *) (ptr + raw->valuators_len * 4); axisval_raw = axisval + nvals; - for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++) { + for (i = 0; i < MAX_VALUATORS; i++) { if (BitIsOn(ev->valuators.mask, i)) { SetBit(ptr, i); *axisval = double_to_fp3232(ev->valuators.data[i]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/glamor/glamor_egl.c new/xwayland-24.1.5/glamor/glamor_egl.c --- old/xwayland-24.1.4/glamor/glamor_egl.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/glamor/glamor_egl.c 2025-02-05 13:51:33.000000000 +0100 @@ -520,6 +520,31 @@ return fd; } +static bool +gbm_format_for_depth(CARD8 depth, uint32_t *format) +{ + switch (depth) { + case 15: + *format = GBM_FORMAT_ARGB1555; + return true; + case 16: + *format = GBM_FORMAT_RGB565; + return true; + case 24: + *format = GBM_FORMAT_XRGB8888; + return true; + case 30: + *format = GBM_FORMAT_ARGB2101010; + return true; + case 32: + *format = GBM_FORMAT_ARGB8888; + return true; + default: + ErrorF("unexpected depth: %d\n", depth); + return false; + } +} + Bool glamor_back_pixmap_from_fd(PixmapPtr pixmap, int fd, @@ -536,17 +561,14 @@ glamor_egl = glamor_egl_get_screen_private(scrn); - if (bpp != 32 || !(depth == 24 || depth == 32 || depth == 30) || width == 0 || height == 0) + if (!gbm_format_for_depth(depth, &import_data.format) || + width == 0 || height == 0) return FALSE; import_data.fd = fd; import_data.width = width; import_data.height = height; import_data.stride = stride; - if (depth == 30) - import_data.format = GBM_FORMAT_ARGB2101010; - else - import_data.format = GBM_FORMAT_ARGB8888; bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD, &import_data, 0); if (!bo) return FALSE; @@ -558,25 +580,6 @@ return ret; } -static uint32_t -gbm_format_for_depth(CARD8 depth) -{ - switch (depth) { - case 15: - return GBM_FORMAT_ARGB1555; - case 16: - return GBM_FORMAT_RGB565; - case 24: - return GBM_FORMAT_XRGB8888; - case 30: - return GBM_FORMAT_ARGB2101010; - default: - ErrorF("unexpected depth: %d\n", depth); - case 32: - return GBM_FORMAT_ARGB8888; - } -} - PixmapPtr glamor_pixmap_from_fds(ScreenPtr screen, CARD8 num_fds, const int *fds, @@ -599,6 +602,10 @@ struct gbm_import_fd_modifier_data import_data = { 0 }; struct gbm_bo *bo; + if (!gbm_format_for_depth(depth, &import_data.format) || + width == 0 || height == 0) + goto error; + import_data.width = width; import_data.height = height; import_data.num_fds = num_fds; @@ -608,7 +615,6 @@ import_data.strides[i] = strides[i]; import_data.offsets[i] = offsets[i]; } - import_data.format = gbm_format_for_depth(depth); bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD_MODIFIER, &import_data, 0); if (bo) { screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, strides[0], NULL); @@ -624,6 +630,7 @@ } } +error: if (ret == FALSE) { screen->DestroyPixmap(pixmap); return NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/glamor/glamor_glx_provider.c new/xwayland-24.1.5/glamor/glamor_glx_provider.c --- old/xwayland-24.1.4/glamor/glamor_glx_provider.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/glamor/glamor_glx_provider.c 2025-02-05 13:51:33.000000000 +0100 @@ -140,12 +140,14 @@ * - drawable type masks is suspicious */ static struct egl_config * -translate_eglconfig(struct egl_screen *screen, EGLConfig hc, +translate_eglconfig(ScreenPtr pScreen, struct egl_screen *screen, EGLConfig hc, struct egl_config *chain, Bool direct_color, Bool double_buffer, Bool duplicate_for_composite, Bool srgb_only) { EGLint value; + bool valid_depth; + int i; struct egl_config *c = calloc(1, sizeof *c); if (!c) @@ -218,6 +220,19 @@ } #undef GET + /* Only expose this config if rgbBits matches a supported + * depth value. + */ + valid_depth = false; + for (i = 0; i < pScreen->numDepths && !valid_depth; i++) { + if (pScreen->allowedDepths[i].depth == c->base.rgbBits) + valid_depth = true; + } + if (!valid_depth) { + free(c); + return chain; + } + /* derived state: config caveats */ eglGetConfigAttrib(screen->display, hc, EGL_CONFIG_CAVEAT, &value); if (value == EGL_NONE) @@ -340,13 +355,13 @@ for (j = 0; j < 3; j++) /* direct_color */ for (k = 0; k < 2; k++) /* double_buffer */ { if (can_srgb) - c = translate_eglconfig(screen, host_configs[i], c, + c = translate_eglconfig(pScreen, screen, host_configs[i], c, /* direct_color */ j == 1, /* double_buffer */ k > 0, /* duplicate_for_composite */ j == 0, /* srgb_only */ true); - c = translate_eglconfig(screen, host_configs[i], c, + c = translate_eglconfig(pScreen, screen, host_configs[i], c, /* direct_color */ j == 1, /* double_buffer */ k > 0, /* duplicate_for_composite */ j == 0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/hw/xwayland/xwayland-cursor.c new/xwayland-24.1.5/hw/xwayland/xwayland-cursor.c --- old/xwayland-24.1.4/hw/xwayland/xwayland-cursor.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/hw/xwayland/xwayland-cursor.c 2025-02-05 13:51:33.000000000 +0100 @@ -43,8 +43,6 @@ #define DELAYED_X_CURSOR_TIMEOUT 5 /* ms */ -static DevPrivateKeyRec xwl_cursor_private_key; - static void expand_source_and_mask(CursorPtr cursor, CARD32 *data) { @@ -80,29 +78,15 @@ static Bool xwl_realize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) { - PixmapPtr pixmap; - - pixmap = xwl_shm_create_pixmap(screen, cursor->bits->width, - cursor->bits->height, 32, - CREATE_PIXMAP_USAGE_BACKING_PIXMAP); - dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, pixmap); - return TRUE; } static Bool xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) { - PixmapPtr pixmap; struct xwl_screen *xwl_screen; struct xwl_seat *xwl_seat; - pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); - if (!pixmap) - return TRUE; - - dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, NULL); - /* When called from FreeCursor(), device is always NULL */ xwl_screen = xwl_screen_get(screen); xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { @@ -110,7 +94,7 @@ xwl_seat->x_cursor = NULL; } - return xwl_shm_destroy_pixmap(pixmap); + return TRUE; } static void @@ -173,8 +157,9 @@ xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); - /* Hold a reference on the pixmap until it's released by the compositor */ - pixmap->refcnt++; + /* The pixmap will be destroyed in xwl_cursor_buffer_release_callback() + * once the compositor is done with it. + */ xwl_pixmap_set_buffer_release_cb(pixmap, xwl_cursor_buffer_release_callback, pixmap); @@ -220,7 +205,9 @@ } cursor = xwl_seat->x_cursor; - pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); + pixmap = xwl_shm_create_pixmap(xwl_screen->screen, cursor->bits->width, + cursor->bits->height, 32, + CREATE_PIXMAP_USAGE_BACKING_PIXMAP); if (!pixmap) return; @@ -263,7 +250,9 @@ } cursor = xwl_seat->x_cursor; - pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); + pixmap = xwl_shm_create_pixmap(xwl_screen->screen, cursor->bits->width, + cursor->bits->height, 32, + CREATE_PIXMAP_USAGE_BACKING_PIXMAP); if (!pixmap) return; @@ -443,9 +432,6 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen) { - if (!dixRegisterPrivateKey(&xwl_cursor_private_key, PRIVATE_CURSOR, 0)) - return FALSE; - return miPointerInitialize(xwl_screen->screen, &xwl_pointer_sprite_funcs, &xwl_pointer_screen_funcs, TRUE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/hw/xwayland/xwayland-glamor-gbm.c new/xwayland-24.1.5/hw/xwayland/xwayland-glamor-gbm.c --- old/xwayland-24.1.4/hw/xwayland/xwayland-glamor-gbm.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/hw/xwayland/xwayland-glamor-gbm.c 2025-02-05 13:51:33.000000000 +0100 @@ -631,6 +631,13 @@ { struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + if (!xwl_gbm) + return; + + /* Cannot use GBM after clean-up, disable GLAMOR support from now on */ + ErrorF("XWAYLAND: Disabling GLAMOR support\n"); + xwl_screen->glamor = XWL_GLAMOR_NONE; + if (xwl_gbm->device_name) free(xwl_gbm->device_name); drmFreeDevice(&xwl_gbm->device); @@ -643,6 +650,8 @@ if (xwl_screen->explicit_sync) wp_linux_drm_syncobj_manager_v1_destroy(xwl_screen->explicit_sync); + dixSetPrivate(&xwl_screen->screen->devPrivates, &xwl_gbm_private_key, + NULL); free(xwl_gbm); } @@ -1318,6 +1327,7 @@ if (!xwl_gbm->device_name) { xwl_glamor_gbm_cleanup(xwl_screen); + xwl_screen->expecting_event--; return; } @@ -1326,12 +1336,14 @@ ErrorF("wayland-egl: could not open %s (%s)\n", xwl_gbm->device_name, strerror(errno)); xwl_glamor_gbm_cleanup(xwl_screen); + xwl_screen->expecting_event--; return; } if (drmGetDevice2(xwl_gbm->drm_fd, 0, &xwl_gbm->device) != 0) { ErrorF("wayland-egl: Could not fetch DRM device %s\n", xwl_gbm->device_name); + xwl_screen->expecting_event--; return; } @@ -1516,16 +1528,15 @@ #ifdef DRI3 struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); - int fence_fd; if (!xwl_screen->glamor || !xwl_pixmap) return; if (xwl_pixmap->syncobj) { - fence_fd = xwl_pixmap->syncobj->export_fence(xwl_pixmap->syncobj, - xwl_pixmap->timeline_point); + int fence_fd = xwl_pixmap->syncobj->export_fence(xwl_pixmap->syncobj, + xwl_pixmap->timeline_point); + xwl_glamor_wait_fence(xwl_screen, fence_fd); - close(fence_fd); } #endif /* DRI3 */ } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/hw/xwayland/xwayland-glamor.c new/xwayland-24.1.5/hw/xwayland/xwayland-glamor.c --- old/xwayland-24.1.4/hw/xwayland/xwayland-glamor.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/hw/xwayland/xwayland-glamor.c 2025-02-05 13:51:33.000000000 +0100 @@ -191,14 +191,17 @@ return fence_fd; } +/* Takes ownership of fence_fd, specifically eglCreateSyncKHR does */ void xwl_glamor_wait_fence(struct xwl_screen *xwl_screen, int fence_fd) { EGLint attribs[3]; EGLSyncKHR sync; - if (!xwl_screen->glamor) + if (!xwl_screen->glamor) { + close(fence_fd); return; + } xwl_glamor_egl_make_current(xwl_screen); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/hw/xwayland/xwayland-input.c new/xwayland-24.1.5/hw/xwayland/xwayland-input.c --- old/xwayland-24.1.4/hw/xwayland/xwayland-input.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/hw/xwayland/xwayland-input.c 2025-02-05 13:51:33.000000000 +0100 @@ -1183,9 +1183,20 @@ XkbUpdateDescActions(xkb, xkb->min_key_code, XkbNumKeys(xkb), &changes); - if (xwl_seat->keyboard->key) + memcpy( + xwl_seat->keyboard->kbdfeed->ctrl.autoRepeats, + xkb->ctrls->per_key_repeat, + XkbPerKeyBitArraySize + ); + if (xwl_seat->keyboard->key) { /* Keep the current controls */ XkbCopyControls(xkb, xwl_seat->keyboard->key->xkbInfo->desc); + memcpy( + xkb->ctrls->per_key_repeat, + xwl_seat->keyboard->kbdfeed->ctrl.autoRepeats, + XkbPerKeyBitArraySize + ); + } XkbDeviceApplyKeymap(xwl_seat->keyboard, xkb); @@ -1273,11 +1284,12 @@ old_state = dev->key->xkbInfo->state; new_state = &dev->key->xkbInfo->state; + new_state->base_group = 0; + new_state->latched_group = 0; new_state->locked_group = group & XkbAllGroupsMask; new_state->base_mods = mods_depressed & XkbAllModifiersMask; + new_state->latched_mods = mods_latched & XkbAllModifiersMask; new_state->locked_mods = mods_locked & XkbAllModifiersMask; - XkbLatchModifiers(dev, XkbAllModifiersMask, - mods_latched & XkbAllModifiersMask); XkbComputeDerivedState(dev->key->xkbInfo); @@ -1665,6 +1677,7 @@ dev->public.devicePrivate = xwl_seat; dev->type = SLAVE; dev->spriteInfo->spriteOwner = FALSE; + dev->ignoreXkbActionsBehaviors = TRUE; return dev; } @@ -3586,6 +3599,7 @@ mieqInit(); + inputInfo.keyboard->ignoreXkbActionsBehaviors = TRUE; xwl_screen->input_registry = wl_display_get_registry(xwl_screen->display); wl_registry_add_listener(xwl_screen->input_registry, &input_listener, xwl_screen); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/hw/xwayland/xwayland-output.c new/xwayland-24.1.5/hw/xwayland/xwayland-output.c --- old/xwayland-24.1.4/hw/xwayland/xwayland-output.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/hw/xwayland/xwayland-output.c 2025-02-05 13:51:33.000000000 +0100 @@ -907,6 +907,8 @@ struct xwl_output *xwl_output; char name[MAX_OUTPUT_NAME] = { 0 }; + --xwl_screen->expecting_event; + xwl_output = calloc(1, sizeof *xwl_output); if (xwl_output == NULL) { ErrorF("%s ENOMEM\n", __func__); @@ -955,7 +957,6 @@ * use it when binding to the xdg-output protocol... */ xorg_list_append(&xwl_output->link, &xwl_screen->output_list); - --xwl_screen->expecting_event; if (xwl_screen->xdg_output_manager) xwl_output_get_xdg_output(xwl_output); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/hw/xwayland/xwayland-present.c new/xwayland-24.1.5/hw/xwayland/xwayland-present.c --- old/xwayland-24.1.4/hw/xwayland/xwayland-present.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/hw/xwayland/xwayland-present.c 2025-02-05 13:51:33.000000000 +0100 @@ -870,7 +870,7 @@ struct xwl_present_event *event = xwl_present_event_from_vblank(vblank); Bool implicit_sync = TRUE; - if (!xwl_window) + if (!xwl_window || !xwl_window->allow_commits) return FALSE; buffer = xwl_pixmap_get_wl_buffer(pixmap); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/hw/xwayland/xwayland-xtest.c new/xwayland-24.1.5/hw/xwayland/xwayland-xtest.c --- old/xwayland-24.1.4/hw/xwayland/xwayland-xtest.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/hw/xwayland/xwayland-xtest.c 2025-02-05 13:51:33.000000000 +0100 @@ -358,11 +358,12 @@ } xwl_ei_client = calloc(1, sizeof *xwl_ei_client); - xwl_ei_client->cmdline = xstrdup(cmdname); if (!xwl_ei_client) { error_ei("OOM, cannot setup EI\n"); goto out; } + + xwl_ei_client->cmdline = xstrdup(cmdname); xorg_list_init(&xwl_ei_client->link); ei = ei_new(NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/include/inputstr.h new/xwayland-24.1.5/include/inputstr.h --- old/xwayland-24.1.4/include/inputstr.h 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/include/inputstr.h 2025-02-05 13:51:33.000000000 +0100 @@ -631,6 +631,8 @@ DeviceSendEventsProc sendEventsProc; struct _SyncCounter *idle_counter; + + Bool ignoreXkbActionsBehaviors; /* TRUE if keys don't trigger behaviors and actions */ } DeviceIntRec; typedef struct { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/include/meson.build new/xwayland-24.1.5/include/meson.build --- old/xwayland-24.1.4/include/meson.build 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/include/meson.build 2025-02-05 13:51:33.000000000 +0100 @@ -159,6 +159,8 @@ conf_data.set('HAVE_SHMCTL64', cc.has_function('shmctl64') ? '1' : false) conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction') ? '1' : false) conf_data.set('HAVE_SIGPROCMASK', cc.has_function('sigprocmask') ? '1' : false) +# HAVE_SOCKLEN_T is used by xtrans when IPv6 is disabled +conf_data.set('HAVE_SOCKLEN_T', cc.has_type('socklen_t', prefix: '#include <sys/socket.h>') ? '1' : false) conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp') ? '1' : false) conf_data.set('HAVE_STRCASESTR', cc.has_function('strcasestr') ? '1' : false) conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat', dependencies: libbsd_dep) ? '1' : false) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/meson.build new/xwayland-24.1.5/meson.build --- old/xwayland-24.1.4/meson.build 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/meson.build 2025-02-05 13:51:33.000000000 +0100 @@ -3,10 +3,10 @@ 'buildtype=debugoptimized', 'c_std=gnu99', ], - version: '24.1.4', + version: '24.1.5', meson_version: '>= 0.56.0', ) -release_date = '2024-10-29' +release_date = '2025-02-05' add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc']) cc = meson.get_compiler('c') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/os/WaitFor.c new/xwayland-24.1.5/os/WaitFor.c --- old/xwayland-24.1.4/os/WaitFor.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/os/WaitFor.c 2025-02-05 13:51:33.000000000 +0100 @@ -416,13 +416,13 @@ switch (DPMSPowerLevel) { case DPMSModeOn: DPMS_CHECK_TIMEOUT(DPMSStandbyTime) - + /* fallthrough */ case DPMSModeStandby: DPMS_CHECK_TIMEOUT(DPMSSuspendTime) - + /* fallthrough */ case DPMSModeSuspend: DPMS_CHECK_TIMEOUT(DPMSOffTime) - + /* fallthrough */ default: /* DPMSModeOff */ return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/os/connection.c new/xwayland-24.1.5/os/connection.c --- old/xwayland-24.1.4/os/connection.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/os/connection.c 2025-02-05 13:51:33.000000000 +0100 @@ -242,7 +242,7 @@ CreateWellKnownSockets(void) { int i; - int partial; + int partial = 0; /* display is initialized to "0" by main(). It is then set to the display * number if specified on the command line. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/render/picture.c new/xwayland-24.1.5/render/picture.c --- old/xwayland-24.1.4/render/picture.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/render/picture.c 2025-02-05 13:51:33.000000000 +0100 @@ -428,6 +428,9 @@ else { VisualPtr pVisual = PictureFindVisual(pScreen, format->index.vid); + if (pVisual == NULL) + return FALSE; + if (CreateColormap(FakeClientID(0), pScreen, pVisual, &format->index.pColormap, AllocNone, 0) != Success) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/xkb/XKBMAlloc.c new/xwayland-24.1.5/xkb/XKBMAlloc.c --- old/xwayland-24.1.4/xkb/XKBMAlloc.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/xkb/XKBMAlloc.c 2025-02-05 13:51:33.000000000 +0100 @@ -41,7 +41,6 @@ Status XkbAllocClientMap(XkbDescPtr xkb, unsigned which, unsigned nTotalTypes) { - register int i; XkbClientMapPtr map; if ((xkb == NULL) || @@ -103,8 +102,7 @@ map->syms[0] = NoSymbol; } if (map->key_sym_map == NULL) { - i = xkb->max_key_code + 1; - map->key_sym_map = calloc(i, sizeof(XkbSymMapRec)); + map->key_sym_map = calloc(MAP_LENGTH, sizeof(XkbSymMapRec)); if (map->key_sym_map == NULL) return BadAlloc; } @@ -115,8 +113,7 @@ (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->modmap == NULL) { - i = xkb->max_key_code + 1; - map->modmap = calloc(i, sizeof(unsigned char)); + map->modmap = calloc(MAP_LENGTH, sizeof(unsigned char)); if (map->modmap == NULL) return BadAlloc; } @@ -149,8 +146,7 @@ (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->explicit == NULL) { - i = xkb->max_key_code + 1; - map->explicit = calloc(i, sizeof(unsigned char)); + map->explicit = calloc(MAP_LENGTH, sizeof(unsigned char)); if (map->explicit == NULL) return BadAlloc; } @@ -185,8 +181,7 @@ ((map->size_acts - map->num_acts) * sizeof(XkbAction))); } if (map->key_acts == NULL) { - i = xkb->max_key_code + 1; - map->key_acts = calloc(i, sizeof(unsigned short)); + map->key_acts = calloc(MAP_LENGTH, sizeof(unsigned short)); if (map->key_acts == NULL) return BadAlloc; } @@ -197,8 +192,7 @@ (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->behaviors == NULL) { - i = xkb->max_key_code + 1; - map->behaviors = calloc(i, sizeof(XkbBehavior)); + map->behaviors = calloc(MAP_LENGTH, sizeof(XkbBehavior)); if (map->behaviors == NULL) return BadAlloc; } @@ -209,8 +203,7 @@ (xkb->max_key_code < xkb->min_key_code)) return BadMatch; if (map->vmodmap == NULL) { - i = xkb->max_key_code + 1; - map->vmodmap = calloc(i, sizeof(unsigned short)); + map->vmodmap = calloc(MAP_LENGTH, sizeof(unsigned short)); if (map->vmodmap == NULL) return BadAlloc; } @@ -651,18 +644,9 @@ if (maxKC > xkb->max_key_code) { if (changes) changes->map.max_key_code = maxKC; - tmp = maxKC - xkb->max_key_code; + tmp = MAP_LENGTH - xkb->max_key_code; if (xkb->map) { if (xkb->map->key_sym_map) { - XkbSymMapRec *prev_key_sym_map = xkb->map->key_sym_map; - - xkb->map->key_sym_map = reallocarray(xkb->map->key_sym_map, - maxKC + 1, - sizeof(XkbSymMapRec)); - if (!xkb->map->key_sym_map) { - free(prev_key_sym_map); - return BadAlloc; - } memset((char *) &xkb->map->key_sym_map[xkb->max_key_code], 0, tmp * sizeof(XkbSymMapRec)); if (changes) { @@ -675,15 +659,6 @@ } } if (xkb->map->modmap) { - unsigned char *prev_modmap = xkb->map->modmap; - - xkb->map->modmap = reallocarray(xkb->map->modmap, - maxKC + 1, - sizeof(unsigned char)); - if (!xkb->map->modmap) { - free(prev_modmap); - return BadAlloc; - } memset((char *) &xkb->map->modmap[xkb->max_key_code], 0, tmp); if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, @@ -698,15 +673,6 @@ } if (xkb->server) { if (xkb->server->behaviors) { - XkbBehavior *prev_behaviors = xkb->server->behaviors; - - xkb->server->behaviors = reallocarray(xkb->server->behaviors, - maxKC + 1, - sizeof(XkbBehavior)); - if (!xkb->server->behaviors) { - free(prev_behaviors); - return BadAlloc; - } memset((char *) &xkb->server->behaviors[xkb->max_key_code], 0, tmp * sizeof(XkbBehavior)); if (changes) { @@ -720,15 +686,6 @@ } } if (xkb->server->key_acts) { - unsigned short *prev_key_acts = xkb->server->key_acts; - - xkb->server->key_acts = reallocarray(xkb->server->key_acts, - maxKC + 1, - sizeof(unsigned short)); - if (!xkb->server->key_acts) { - free(prev_key_acts); - return BadAlloc; - } memset((char *) &xkb->server->key_acts[xkb->max_key_code], 0, tmp * sizeof(unsigned short)); if (changes) { @@ -742,15 +699,6 @@ } } if (xkb->server->vmodmap) { - unsigned short *prev_vmodmap = xkb->server->vmodmap; - - xkb->server->vmodmap = reallocarray(xkb->server->vmodmap, - maxKC + 1, - sizeof(unsigned short)); - if (!xkb->server->vmodmap) { - free(prev_vmodmap); - return BadAlloc; - } memset((char *) &xkb->server->vmodmap[xkb->max_key_code], 0, tmp * sizeof(unsigned short)); if (changes) { @@ -765,14 +713,6 @@ } } if ((xkb->names) && (xkb->names->keys)) { - XkbKeyNameRec *prev_keys = xkb->names->keys; - - xkb->names->keys = reallocarray(xkb->names->keys, - maxKC + 1, sizeof(XkbKeyNameRec)); - if (!xkb->names->keys) { - free(prev_keys); - return BadAlloc; - } memset((char *) &xkb->names->keys[xkb->max_key_code], 0, tmp * sizeof(XkbKeyNameRec)); if (changes) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/xkb/xkbActions.c new/xwayland-24.1.5/xkb/xkbActions.c --- old/xwayland-24.1.4/xkb/xkbActions.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/xkb/xkbActions.c 2025-02-05 13:51:33.000000000 +0100 @@ -1368,9 +1368,12 @@ (event->type == ET_ButtonPress)); if (pressEvent) { - if (keyEvent) - act = XkbGetKeyAction(xkbi, &xkbi->state, key); - else { + if (keyEvent) { + if (kbd->ignoreXkbActionsBehaviors) + act.type = XkbSA_NoAction; + else + act = XkbGetKeyAction(xkbi, &xkbi->state, key); + } else { act = XkbGetButtonAction(kbd, dev, key); key |= BTN_ACT_FLAG; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/xkb/xkbPrKeyEv.c new/xwayland-24.1.5/xkb/xkbPrKeyEv.c --- old/xwayland-24.1.4/xkb/xkbPrKeyEv.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/xkb/xkbPrKeyEv.c 2025-02-05 13:51:33.000000000 +0100 @@ -68,7 +68,7 @@ /* do anything to implement the behavior, but it *does* report that */ /* key is hardwired */ - if (!(behavior.type & XkbKB_Permanent)) { + if (!keybd->ignoreXkbActionsBehaviors && !(behavior.type & XkbKB_Permanent)) { switch (behavior.type) { case XkbKB_Default: /* Neither of these should happen in practice, but ignore them diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xwayland-24.1.4/xkb/xkbUtils.c new/xwayland-24.1.5/xkb/xkbUtils.c --- old/xwayland-24.1.4/xkb/xkbUtils.c 2024-10-29 16:27:04.000000000 +0100 +++ new/xwayland-24.1.5/xkb/xkbUtils.c 2025-02-05 13:51:33.000000000 +0100 @@ -930,6 +930,7 @@ { void *tmp = NULL; int i; + int gap; XkbKeyTypePtr stype = NULL, dtype = NULL; /* client map */ @@ -959,15 +960,20 @@ } dst->map->num_syms = src->map->num_syms; dst->map->size_syms = src->map->size_syms; + gap = MAP_LENGTH - (src->max_key_code + 1); if (src->map->key_sym_map) { - if (src->max_key_code != dst->max_key_code) { + if (!dst->map->key_sym_map) { tmp = reallocarray(dst->map->key_sym_map, - src->max_key_code + 1, sizeof(XkbSymMapRec)); + MAP_LENGTH, sizeof(XkbSymMapRec)); if (!tmp) return FALSE; dst->map->key_sym_map = tmp; } + if (gap > 0) { + memset((char *) &dst->map->key_sym_map[gap], 0, + gap * sizeof(XkbSymMapRec)); + } memcpy(dst->map->key_sym_map, src->map->key_sym_map, (src->max_key_code + 1) * sizeof(XkbSymMapRec)); } @@ -1138,12 +1144,15 @@ } if (src->map->modmap) { - if (src->max_key_code != dst->max_key_code) { - tmp = realloc(dst->map->modmap, src->max_key_code + 1); + if (!dst->map->modmap) { + tmp = realloc(dst->map->modmap, MAP_LENGTH); if (!tmp) return FALSE; dst->map->modmap = tmp; } + if (gap > 0) { + memset(dst->map->modmap + gap, 0, gap); + } memcpy(dst->map->modmap, src->map->modmap, src->max_key_code + 1); } else { @@ -1163,6 +1172,7 @@ _XkbCopyServerMap(XkbDescPtr src, XkbDescPtr dst) { void *tmp = NULL; + int gap; /* server map */ if (src->server) { @@ -1173,13 +1183,16 @@ dst->server = tmp; } + gap = MAP_LENGTH - (src->max_key_code + 1); if (src->server->explicit) { - if (src->max_key_code != dst->max_key_code) { - tmp = realloc(dst->server->explicit, src->max_key_code + 1); + if (!dst->server->explicit) { + tmp = realloc(dst->server->explicit, MAP_LENGTH); if (!tmp) return FALSE; dst->server->explicit = tmp; } + if (gap > 0) + memset(dst->server->explicit + gap, 0, gap); memcpy(dst->server->explicit, src->server->explicit, src->max_key_code + 1); } @@ -1207,13 +1220,15 @@ dst->server->num_acts = src->server->num_acts; if (src->server->key_acts) { - if (src->max_key_code != dst->max_key_code) { + if (!dst->server->key_acts) { tmp = reallocarray(dst->server->key_acts, - src->max_key_code + 1, sizeof(unsigned short)); + MAP_LENGTH, sizeof(unsigned short)); if (!tmp) return FALSE; dst->server->key_acts = tmp; } + if (gap > 0) + memset((char *) &dst->server->key_acts[gap], 0, gap * sizeof(unsigned short)); memcpy(dst->server->key_acts, src->server->key_acts, (src->max_key_code + 1) * sizeof(unsigned short)); } @@ -1223,13 +1238,15 @@ } if (src->server->behaviors) { - if (src->max_key_code != dst->max_key_code) { + if (!dst->server->behaviors) { tmp = reallocarray(dst->server->behaviors, - src->max_key_code + 1, sizeof(XkbBehavior)); + MAP_LENGTH, sizeof(XkbBehavior)); if (!tmp) return FALSE; dst->server->behaviors = tmp; } + if (gap > 0) + memset((char *) &dst->server->behaviors[gap], 0, gap * sizeof(XkbBehavior)); memcpy(dst->server->behaviors, src->server->behaviors, (src->max_key_code + 1) * sizeof(XkbBehavior)); } @@ -1241,13 +1258,15 @@ memcpy(dst->server->vmods, src->server->vmods, XkbNumVirtualMods); if (src->server->vmodmap) { - if (src->max_key_code != dst->max_key_code) { + if (!dst->server->vmodmap) { tmp = reallocarray(dst->server->vmodmap, - src->max_key_code + 1, sizeof(unsigned short)); + MAP_LENGTH, sizeof(unsigned short)); if (!tmp) return FALSE; dst->server->vmodmap = tmp; } + if (gap > 0) + memset((char *) &dst->server->vmodmap[gap], 0, gap * sizeof(unsigned short)); memcpy(dst->server->vmodmap, src->server->vmodmap, (src->max_key_code + 1) * sizeof(unsigned short)); } @@ -1268,6 +1287,7 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst) { void *tmp = NULL; + int gap; /* names */ if (src->names) { @@ -1277,14 +1297,17 @@ return FALSE; } + gap = MAP_LENGTH - (src->max_key_code + 1); if (src->names->keys) { - if (src->max_key_code != dst->max_key_code) { - tmp = reallocarray(dst->names->keys, src->max_key_code + 1, + if (!dst->names->keys) { + tmp = reallocarray(dst->names->keys, MAP_LENGTH, sizeof(XkbKeyNameRec)); if (!tmp) return FALSE; dst->names->keys = tmp; } + if (gap > 0) + memset((char *) &dst->names->keys[gap], 0, gap * sizeof(XkbKeyNameRec)); memcpy(dst->names->keys, src->names->keys, (src->max_key_code + 1) * sizeof(XkbKeyNameRec)); }
