Xephyr: fix segfault in hostx_set_win_title during startup

screen->pScreen is NULL during hostx_init() because it's set later
during screen initialization. Use screen->mynum (the KdScreenInfo's
screen number) which is available from the start.

Also fix hostx_paint_rect for consistency.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2026-09-25 20:05:25 +02:00 • committed by Enrico Weigelt
commit e85f7a9c22

View file

@ -196,7 +196,7 @@ hostx_set_win_title(KdScreenInfo *screen, const char *extra_text)
memset(buf, 0, BUF_LEN + 1);
snprintf(buf, BUF_LEN, "Xephyr on %s.%d %s",
HostX.server_dpy_name ? HostX.server_dpy_name : ":0",
screen->pScreen->myNum, (extra_text != NULL) ? extra_text : "");
screen->mynum, (extra_text != NULL) ? extra_text : "");
xcb_icccm_set_wm_name(HostX.conn,
scrpriv->win,
@ -1038,7 +1038,7 @@ hostx_paint_rect(KdScreenInfo *screen,
{
EphyrScrPriv *scrpriv = screen->driver;
EPHYR_DBG("painting in screen %d\n", screen->pScreen->myNum);
EPHYR_DBG("painting in screen %d\n", screen->mynum);
#ifdef GLAMOR
if (ephyr_glamor) {