Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit ec32e9b

Browse files
mmhobi7r00tdaemon
authored andcommitted
Add force desktop window type flag (#4)
* Add force desktop window type flag This flag places xwinwrap behind desktop icons on ubuntu * Update README.md
1 parent 099ea74 commit ec32e9b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ make clean
2020
### Usage
2121

2222
```
23-
Usage: xwinwrap [-g {w}x{h}+{x}+{y}] [-ni] [-argb] [-fs] [-s] [-st] [-sp] [-a] [-b] [-nf] [-o OPACITY] [-sh SHAPE] [-ov]-- COMMAND ARG1...
23+
Usage: xwinwrap [-g {w}x{h}+{x}+{y}] [-ni] [-argb] [-fdt] [-fs] [-s] [-st] [-sp] [-a] [-d] [-b] [-nf] [-o OPACITY] [-sh SHAPE] [-ov]-- COMMAND ARG1...
2424
Options:
2525
-g - Specify Geometry (w=width, h=height, x=x-coord, y=y-coord. ex: -g 640x480+100+100)
2626
-ni - Ignore Input
2727
-argb - RGB
28+
-fdt - force WID window a desktop type window
2829
-fs - Full Screen
2930
-un - Undecorated
3031
-s - Sticky
@@ -36,6 +37,7 @@ Options:
3637
-o - Opacity value between 0 to 1 (ex: -o 0.20)
3738
-sh - Shape of window (choose between rectangle, circle or triangle. Default is rectangle)
3839
-ov - Set override_redirect flag (For seamless desktop background integration in non-fullscreenmode)
40+
-d - Daemonize
3941
-debug - Enable debug messages
4042
```
4143
Example

Diff for: xwinwrap.c

+13-2
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ static void sigHandler (int sig)
133133
static void usage (void)
134134
{
135135
fprintf(stderr, "%s \n", NAME);
136-
fprintf (stderr, "\nUsage: %s [-g {w}x{h}+{x}+{y}] [-ni] [-argb] [-fs] [-s] [-st] [-sp] [-a] "
136+
fprintf (stderr, "\nUsage: %s [-g {w}x{h}+{x}+{y}] [-ni] [-argb] [-fdt] [-fs] [-s] [-st] [-sp] [-a] [-d] "
137137
"[-b] [-nf] [-o OPACITY] [-sh SHAPE] [-ov]-- COMMAND ARG1...\n", NAME);
138138
fprintf (stderr, "Options:\n \
139139
-g - Specify Geometry (w=width, h=height, x=x-coord, y=y-coord. ex: -g 640x480+100+100)\n \
140140
-ni - Ignore Input\n \
141141
-argb - RGB\n \
142+
-fdt - force WID window a desktop type window\n \
142143
-fs - Full Screen\n \
143144
-un - Undecorated\n \
144145
-s - Sticky\n \
@@ -275,6 +276,7 @@ int main(int argc, char **argv)
275276
bool have_argb_visual = false;
276277
bool noInput = false;
277278
bool argb = false;
279+
bool set_desktop_type = false;
278280
bool fullscreen = false;
279281
bool noFocus = false;
280282
bool override = false;
@@ -309,6 +311,10 @@ int main(int argc, char **argv)
309311
{
310312
argb = true;
311313
}
314+
else if (strcmp (argv[i], "-fdt") == 0)
315+
{
316+
set_desktop_type = true;
317+
}
312318
else if (strcmp (argv[i], "-fs") == 0)
313319
{
314320
fullscreen = 1;
@@ -526,7 +532,12 @@ int main(int argc, char **argv)
526532
xa = ATOM(_NET_WM_WINDOW_TYPE);
527533

528534
Atom prop;
529-
prop = ATOM(_NET_WM_WINDOW_TYPE_NORMAL);
535+
if (set_desktop_type)
536+
{
537+
prop = ATOM(_NET_WM_WINDOW_TYPE_DESKTOP);
538+
} else {
539+
prop = ATOM(_NET_WM_WINDOW_TYPE_NORMAL);
540+
}
530541

531542
XChangeProperty(display, window.window, xa, XA_ATOM, 32,
532543
PropModeReplace, (unsigned char *) &prop, 1);

0 commit comments

Comments
 (0)