From 401b5a5eb092173443253cdd57736cd6bf401e40 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 20 Nov 2021 12:32:07 +0000 Subject: Add the assume_root_window_is_desktop setting (-r) This makes it so that fullscreen applications are not treated as the desktop, and only the Xorg root window will. --- xwinwrap.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'xwinwrap.c') diff --git a/xwinwrap.c b/xwinwrap.c index 2cfb8aa..dda771d 100644 --- a/xwinwrap.c +++ b/xwinwrap.c @@ -152,6 +152,7 @@ static void usage (void) -sh - Shape of window (choose between rectangle, circle or triangle. Default is rectangle)\n \ -ov - Set override_redirect flag (For seamless desktop background integration in non-fullscreenmode)\n \ -d - Daemonize\n \ + -r - Assume the root window is the desktop\n \ -debug - Enable debug messages\n"); } @@ -287,6 +288,7 @@ int main(int argc, char **argv) bool skip_taskbar = false; bool skip_pager = false; bool daemonize = false; + bool assume_root_window_is_desktop = false; win_shape shape = SHAPE_RECT; Pixmap mask; @@ -378,6 +380,10 @@ int main(int argc, char **argv) { daemonize = true; } + else if(strcmp (argv[i], "-r") == 0) + { + assume_root_window_is_desktop = true; + } else if (strcmp (argv[i], "--") == 0) { break; @@ -450,9 +456,18 @@ int main(int argc, char **argv) int depth = 0, flags = CWOverrideRedirect | CWBackingStore; Visual *visual = NULL; - if (!find_desktop_window(&window.root, &window.desktop)) { - fprintf (stderr, NAME": Error: couldn't find desktop window\n"); - return 1; + if(assume_root_window_is_desktop) + { + Window true_root = RootWindow(display, screen); + window.root = true_root; + window.desktop = true_root; + } + else + { + if (!find_desktop_window(&window.root, &window.desktop)) { + fprintf (stderr, NAME": Error: couldn't find desktop window\n"); + return 1; + } } if (argb && get_argb_visual(&visual, &depth)) -- cgit 1.4.1