~mdw
/
xtoys
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xatom.1: Add missing vertical space.
[xtoys]
/
xatom.c
diff --git
a/xatom.c
b/xatom.c
index
e030021
..
0e486bb
100644
(file)
--- a/
xatom.c
+++ b/
xatom.c
@@
-35,9
+35,7
@@
#include <sys/wait.h>
#include <X11/cursorfont.h>
#include <sys/wait.h>
#include <X11/cursorfont.h>
-#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xlib.h>
-#include <X11/Xutil.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
@@
-48,7
+46,7
@@
/*----- Static variables --------------------------------------------------*/
/*----- Static variables --------------------------------------------------*/
-static Display *d
ispla
y = 0;
+static Display *d
p
y = 0;
static Window window = None;
/*----- Command implementations -------------------------------------------*/
static Window window = None;
/*----- Command implementations -------------------------------------------*/
@@
-64,10
+62,10
@@
static int c_get(int argc, char **argv)
if (argc != 2)
die(EXIT_FAILURE, "Usage: get PROPERTY");
if (argc != 2)
die(EXIT_FAILURE, "Usage: get PROPERTY");
- if ((p = XInternAtom(d
ispla
y, argv[1], True)) == None ||
- (a = xatom_get(d
ispla
y, window, p)) == None)
+ if ((p = XInternAtom(d
p
y, argv[1], True)) == None ||
+ (a = xatom_get(d
p
y, window, p)) == None)
return (0);
return (0);
- name = XGetAtomName(d
ispla
y, a);
+ name = XGetAtomName(d
p
y, a);
puts(name);
return (0);
}
puts(name);
return (0);
}
@@
-78,9
+76,9
@@
static int c_set(int argc, char **argv)
if (argc != 3)
die(EXIT_FAILURE, "Usage: set PROPERTY VALUE");
if (argc != 3)
die(EXIT_FAILURE, "Usage: set PROPERTY VALUE");
- p = XInternAtom(d
ispla
y, argv[1], False);
- a = XInternAtom(d
ispla
y, argv[2], False);
- xatom_set(d
ispla
y, window, p, a);
+ p = XInternAtom(d
p
y, argv[1], False);
+ a = XInternAtom(d
p
y, argv[2], False);
+ xatom_set(d
p
y, window, p, a);
return (0);
}
return (0);
}
@@
-90,9
+88,9
@@
static int c_delete(int argc, char **argv)
if (argc != 2)
die(EXIT_FAILURE, "Usage: delete PROPERTY");
if (argc != 2)
die(EXIT_FAILURE, "Usage: delete PROPERTY");
- if ((p = XInternAtom(d
ispla
y, argv[1], True)) == None)
+ if ((p = XInternAtom(d
p
y, argv[1], True)) == None)
return (0);
return (0);
- xatom_delete(d
ispla
y, window, p);
+ xatom_delete(d
p
y, window, p);
return (0);
}
return (0);
}
@@
-105,16
+103,16
@@
static int c_wait(int argc, char **argv)
if (argc < 2)
die(EXIT_FAILURE, "Usage: wait PROPERTY [VALUE...]");
if (argc < 2)
die(EXIT_FAILURE, "Usage: wait PROPERTY [VALUE...]");
- p = XInternAtom(d
ispla
y, argv[1], False);
+ p = XInternAtom(d
p
y, argv[1], False);
n = argc - 2;
if (n) {
aa = xmalloc(n * sizeof(Atom));
n = argc - 2;
if (n) {
aa = xmalloc(n * sizeof(Atom));
- XInternAtoms(d
ispla
y, argv + 2, n, False, aa);
+ XInternAtoms(d
p
y, argv + 2, n, False, aa);
}
}
- a = xatom_wait(d
ispla
y, window, p, aa, n);
+ a = xatom_wait(d
p
y, window, p, aa, n);
if (n != 1) {
if (n != 1) {
- name = XGetAtomName(d
ispla
y, a);
+ name = XGetAtomName(d
p
y, a);
puts(name);
XFree(name);
}
puts(name);
XFree(name);
}
@@
-136,11
+134,11
@@
static int c_wait(int argc, char **argv)
static Window choosewindow(void)
{
static Window choosewindow(void)
{
- Cursor cross = XCreateFontCursor(d
ispla
y, XC_crosshair);
+ Cursor cross = XCreateFontCursor(d
p
y, XC_crosshair);
XEvent event;
XEvent event;
- XGrabPointer(d
ispla
y,
- DefaultRootWindow(d
ispla
y),
+ XGrabPointer(d
p
y,
+ DefaultRootWindow(d
p
y),
False,
ButtonPressMask,
GrabModeAsync,
False,
ButtonPressMask,
GrabModeAsync,
@@
-150,19
+148,19
@@
static Window choosewindow(void)
CurrentTime);
for (;;) {
CurrentTime);
for (;;) {
- XNextEvent(d
ispla
y, &event);
+ XNextEvent(d
p
y, &event);
switch (event.type) {
case ButtonPress:
switch (event.xbutton.button) {
case 3:
switch (event.type) {
case ButtonPress:
switch (event.xbutton.button) {
case 3:
- XUngrabPointer(d
ispla
y, event.xbutton.time);
+ XUngrabPointer(d
p
y, event.xbutton.time);
die(EXIT_FAILURE, "aborted window selection");
break;
case 1:
window = event.xbutton.subwindow;
if (window == None)
window = event.xbutton.window;
die(EXIT_FAILURE, "aborted window selection");
break;
case 1:
window = event.xbutton.subwindow;
if (window == None)
window = event.xbutton.window;
- XUngrabPointer(d
ispla
y, event.xbutton.time);
+ XUngrabPointer(d
p
y, event.xbutton.time);
return (window);
}
break;
return (window);
}
break;
@@
-296,7
+294,7
@@
The following subcommands are understood:\n\n",
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- const char *d
p
y = 0;
+ const char *d
ispla
y = 0;
const char *win = 0;
unsigned f = 0;
const char *win = 0;
unsigned f = 0;
@@
-322,7
+320,7
@@
int main(int argc, char *argv[])
case 'h': help(argv + optind); exit(0);
case 'u': usage(stdout); exit(0);
case 'v': version(); exit(0);
case 'h': help(argv + optind); exit(0);
case 'u': usage(stdout); exit(0);
case 'v': version(); exit(0);
- case 'd': d
p
y = optarg; break;
+ case 'd': d
ispla
y = optarg; break;
case 'w': win = optarg; break;
default: f |= F_BOGUS; break;
}
case 'w': win = optarg; break;
default: f |= F_BOGUS; break;
}
@@
-335,13
+333,13
@@
int main(int argc, char *argv[])
/* --- Initialize --- */
autoreap();
/* --- Initialize --- */
autoreap();
- if ((d
isplay = XOpenDisplay(dp
y)) == 0)
+ if ((d
py = XOpenDisplay(displa
y)) == 0)
die(EXIT_FAILURE, "couldn't open display");
/* --- Select a target window --- */
if (!win)
die(EXIT_FAILURE, "couldn't open display");
/* --- Select a target window --- */
if (!win)
- window = DefaultRootWindow(d
ispla
y);
+ window = DefaultRootWindow(d
p
y);
else if (strcmp(win, "choose") == 0)
window = choosewindow();
else
else if (strcmp(win, "choose") == 0)
window = choosewindow();
else