aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-02-01 13:17:43 -0500
committerB. Watson <urchlay@slackware.uk>2024-02-01 13:17:43 -0500
commite194849bdaec6f61812cd0f3aca1235075acdeca (patch)
tree41b0c36829a60a29328d4a9569b849453da1cd51
parentf53d06bbec6ef3ae051c4af85870a7a88ca11ce2 (diff)
downloadxdeadzone-e194849bdaec6f61812cd0f3aca1235075acdeca.tar.gz
Do not allow "-n -i".
-rw-r--r--xdeadzone.14
-rw-r--r--xdeadzone.c5
-rw-r--r--xdeadzone.rst4
3 files changed, 8 insertions, 5 deletions
diff --git a/xdeadzone.1 b/xdeadzone.1
index abb9051..543ff4a 100644
--- a/xdeadzone.1
+++ b/xdeadzone.1
@@ -36,7 +36,7 @@ xdeadzone \- keep the mouse pointer out of the dead zone, on mismatched multihea
.
.SH SYNOPSIS
.sp
-xdeadzone <[\fB\-i\fP \fB\-b\fP | \fB\-w\fP ]> [\fB\-nw\fP | \fB\-ne\fP | \fB\-sw\fP | \fB\-se\fP | \fB\-abs\fP] \fIgeometry\fP
+xdeadzone <[\fB\-i\fP \fB\-b\fP | \fB\-w\fP ]> <\fB\-n*> [\fP\-nw** | \fB\-ne\fP | \fB\-sw\fP | \fB\-se\fP | \fB\-abs\fP] \fIgeometry\fP
.sp
xdeadzone \fB\-\-help\fP | \fB\-\-version\fP
.SH DESCRIPTION
@@ -116,7 +116,7 @@ Make window visible, display as a white rectangle.
.B \fB\-n\fP
Create window as a normal window, with titlebar and without
appearing on all desktops. Implies \fB\-w\fP, but can be followed
-by \fB\-b\fP for a black rectangle.
+by \fB\-b\fP for a black rectangle. Cannot be combined with \fB\-i\fP\&.
.UNINDENT
.SS Informational options
.INDENT 0.0
diff --git a/xdeadzone.c b/xdeadzone.c
index e3446f9..2e43dc3 100644
--- a/xdeadzone.c
+++ b/xdeadzone.c
@@ -154,6 +154,9 @@ int main(int argc, char **argv) {
if(width == 0 || height == 0)
errmsg("bad geometry: width and height must be non-zero");
+ if(normal_window && !visible)
+ errmsg("cannot combine -i (invisible) with -n (normal window)");
+
if(!(d = XOpenDisplay(NULL)))
errmsg("can't open X display");
@@ -188,7 +191,7 @@ int main(int argc, char **argv) {
DefaultRootWindow(d),
x, y, width, height, 0,
CopyFromParent,
- InputOutput,
+ (visible ? InputOutput : InputOnly),
CopyFromParent,
(visible ? CWBackPixel : 0) | CWOverrideRedirect | CWEventMask,
&setattr);
diff --git a/xdeadzone.rst b/xdeadzone.rst
index 909da79..9d26326 100644
--- a/xdeadzone.rst
+++ b/xdeadzone.rst
@@ -20,7 +20,7 @@ keep the mouse pointer out of the dead zone, on mismatched multihead displays.
SYNOPSIS
========
-xdeadzone <[**-i** **-b** | **-w** ]> [**-nw** | **-ne** | **-sw** | **-se** | **-abs**] *geometry*
+xdeadzone <[**-i** **-b** | **-w** ]> <**-n*> [**-nw** | **-ne** | **-sw** | **-se** | **-abs**] *geometry*
xdeadzone **--help** | **--version**
@@ -105,7 +105,7 @@ look and behave.
**-n**
Create window as a normal window, with titlebar and without
appearing on all desktops. Implies **-w**, but can be followed
- by **-b** for a black rectangle.
+ by **-b** for a black rectangle. Cannot be combined with **-i**.
Informational options
---------------------