From 6c9ef7905a40bd8696bb0217a177767e7ab42270 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 30 Aug 2024 16:40:04 +0200 Subject: [PATCH] WIP: rootless mode 2do: input not working yet properties (eg. window name aren't set) connection closes when window closed --- hw/xnest/Args.c | 7 +++++++ hw/xnest/Args.h | 1 + hw/xnest/Window.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c index 8f448babb..fb64ff164 100644 --- a/hw/xnest/Args.c +++ b/hw/xnest/Args.c @@ -46,6 +46,7 @@ char *xnestWindowName = NULL; int xnestNumScreens = 0; Bool xnestDoDirectColormaps = FALSE; xcb_window_t xnestParentWindow = 0; +Bool xnestRootless = FALSE; int ddxProcessArgument(int argc, char *argv[], int i) @@ -63,6 +64,11 @@ ddxProcessArgument(int argc, char *argv[], int i) noDPMSExtension = TRUE; #endif + if (!strcmp(argv[i], "-rootless")) { + xnestRootless = TRUE; + return 1; + } + if (!strcmp(argv[i], "-display")) { if (++i < argc) { xnestDisplayName = argv[i]; @@ -182,6 +188,7 @@ ddxProcessArgument(int argc, char *argv[], int i) void ddxUseMsg(void) { + ErrorF("-rootless enable rootless mode\n"); ErrorF("-display string display name of the real server\n"); ErrorF("-full utilize full regeneration\n"); ErrorF("-class string default visual class\n"); diff --git a/hw/xnest/Args.h b/hw/xnest/Args.h index c742aa37d..ad464bf71 100644 --- a/hw/xnest/Args.h +++ b/hw/xnest/Args.h @@ -35,5 +35,6 @@ extern char *xnestWindowName; extern int xnestNumScreens; extern Bool xnestDoDirectColormaps; extern xcb_window_t xnestParentWindow; +extern Bool xnestRootless; #endif /* XNESTARGS_H */ diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index 97c3b530c..535f985ef 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -49,6 +49,9 @@ DevPrivateKeyRec xnestWindowPrivateKeyRec; */ static inline xcb_window_t xnest_upstream_window_parent(WindowPtr pWin) { + if (xnestRootless && pWin->parent && !pWin->parent->parent) + return xnestUpstreamInfo.screenInfo->root; + return (pWin->parent ? xnestWindow(pWin->parent) : xnest_screen_priv(pWin->drawable.pScreen)->upstream_frame_window);