Lines 30-60
Link Here
|
30 |
/* nothing fancy */ |
30 |
/* nothing fancy */ |
31 |
int main(int argc, char **argv) |
31 |
int main(int argc, char **argv) |
32 |
{ |
32 |
{ |
33 |
int gotd = 0; |
33 |
double d = -1.0; |
34 |
double d; |
|
|
35 |
unsigned int opacity; |
34 |
unsigned int opacity; |
36 |
|
35 |
|
37 |
/* wonderful utility */ |
36 |
/* wonderful utility */ |
38 |
Setup_Display_And_Screen(&argc, argv); |
37 |
Setup_Display_And_Screen(&argc, argv); |
|
|
38 |
d = Get_Translucence(&argc, argv); |
39 |
target_win = Select_Window_Args(&argc, argv); |
39 |
|
40 |
|
40 |
if (argv[1]) |
41 |
/* grab mouse and return window that is next clicked */ |
|
|
42 |
if (target_win == 0) |
43 |
target_win = Select_Window(dpy); |
44 |
/* get the target_win id from argument id */ |
45 |
else |
41 |
{ |
46 |
{ |
42 |
printf ("got arg %s\n", argv[1]); |
47 |
Window parent,root; |
43 |
d = atof (argv[1]); |
48 |
Window* ch_ret; |
44 |
printf ("d is %g\n", d); |
49 |
unsigned int nch_ret; |
45 |
gotd = 1; |
50 |
XQueryTree(dpy,target_win,&root,&parent,&ch_ret,&nch_ret); |
|
|
51 |
XFree(ch_ret); |
52 |
XQueryTree(dpy,parent,&root,&parent,&ch_ret,&nch_ret); |
53 |
XFree(ch_ret); |
54 |
target_win=parent; |
46 |
} |
55 |
} |
47 |
|
56 |
|
48 |
/* grab mouse and return window that is next clicked */ |
|
|
49 |
target_win = Select_Window(dpy); |
50 |
|
51 |
unsigned char *data; |
57 |
unsigned char *data; |
52 |
|
58 |
|
53 |
Atom actual; |
59 |
Atom actual; |
54 |
int format; |
60 |
int format; |
55 |
unsigned long n, left; |
61 |
unsigned long n, left; |
56 |
|
62 |
|
57 |
if (gotd) |
63 |
if (d >= 0.0) |
58 |
opacity = (unsigned int) (d * OPAQUE); |
64 |
opacity = (unsigned int) (d * OPAQUE); |
59 |
else |
65 |
else |
60 |
{ |
66 |
{ |