diff options
author | Your Name <you@example.com> | 2021-11-20 12:32:07 +0000 |
---|---|---|
committer | Your Name <you@example.com> | 2021-11-20 12:36:12 +0000 |
commit | 401b5a5eb092173443253cdd57736cd6bf401e40 (patch) | |
tree | bcda566edd3bba82e7e4e4c678b0db621c126020 /xwinwrap.c | |
parent | Add force desktop window type flag (#4) (diff) | |
download | xwinwrap-master.tar.gz xwinwrap-master.tar.bz2 xwinwrap-master.zip |
This makes it so that fullscreen applications are not treated as the desktop, and only the Xorg root window will.
Diffstat (limited to 'xwinwrap.c')
-rw-r--r-- | xwinwrap.c | 21 |
1 files changed, 18 insertions, 3 deletions
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)) |