1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 extentsrequest.c for the Openbox window manager
4 Copyright (c) 2003-2007 Dana Jansens
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 See the COPYING file for a copy of the GNU General Public License.
22 #include <X11/Xatom.h>
30 int x
=10,y
=10,h
=100,w
=400;
32 display
= XOpenDisplay(NULL
);
34 if (display
== NULL
) {
35 fprintf(stderr
, "couldn't connect to X server :0\n");
39 _restack
= XInternAtom(display
, "_NET_RESTACK_WINDOW", False
);
41 win
= XCreateWindow(display
, RootWindow(display
, 0),
42 x
, y
, w
, h
, 10, CopyFromParent
, CopyFromParent
,
43 CopyFromParent
, 0, NULL
);
44 XSetWindowBackground(display
,win
,WhitePixel(display
,0));
46 XMapWindow(display
, win
);
49 printf("requesting bottom in 3\n");
52 msg
.xclient
.type
= ClientMessage
;
53 msg
.xclient
.message_type
= _restack
;
54 msg
.xclient
.display
= display
;
55 msg
.xclient
.window
= win
;
56 msg
.xclient
.format
= 32;
57 msg
.xclient
.data
.l
[0] = 2l;
58 msg
.xclient
.data
.l
[1] = 0l;
59 msg
.xclient
.data
.l
[2] = Below
;
60 msg
.xclient
.data
.l
[3] = 0l;
61 msg
.xclient
.data
.l
[4] = 0l;
62 XSendEvent(display
, RootWindow(display
, 0), False
,
63 SubstructureNotifyMask
| SubstructureRedirectMask
, &msg
);
66 printf("requesting top in 3\n");
69 msg
.xclient
.type
= ClientMessage
;
70 msg
.xclient
.message_type
= _restack
;
71 msg
.xclient
.display
= display
;
72 msg
.xclient
.window
= win
;
73 msg
.xclient
.format
= 32;
74 msg
.xclient
.data
.l
[0] = 2l;
75 msg
.xclient
.data
.l
[1] = 0l;
76 msg
.xclient
.data
.l
[2] = Above
;
77 msg
.xclient
.data
.l
[3] = 0l;
78 msg
.xclient
.data
.l
[4] = 0l;
79 XSendEvent(display
, RootWindow(display
, 0), False
,
80 SubstructureNotifyMask
| SubstructureRedirectMask
, &msg
);
83 printf("requesting bottomif in 3\n");
86 msg
.xclient
.type
= ClientMessage
;
87 msg
.xclient
.message_type
= _restack
;
88 msg
.xclient
.display
= display
;
89 msg
.xclient
.window
= win
;
90 msg
.xclient
.format
= 32;
91 msg
.xclient
.data
.l
[0] = 2l;
92 msg
.xclient
.data
.l
[1] = 0l;
93 msg
.xclient
.data
.l
[2] = BottomIf
;
94 msg
.xclient
.data
.l
[3] = 0l;
95 msg
.xclient
.data
.l
[4] = 0l;
96 XSendEvent(display
, RootWindow(display
, 0), False
,
97 SubstructureNotifyMask
| SubstructureRedirectMask
, &msg
);
100 printf("requesting topif in 3\n");
103 msg
.xclient
.type
= ClientMessage
;
104 msg
.xclient
.message_type
= _restack
;
105 msg
.xclient
.display
= display
;
106 msg
.xclient
.window
= win
;
107 msg
.xclient
.format
= 32;
108 msg
.xclient
.data
.l
[0] = 2l;
109 msg
.xclient
.data
.l
[1] = 0l;
110 msg
.xclient
.data
.l
[2] = TopIf
;
111 msg
.xclient
.data
.l
[3] = 0l;
112 msg
.xclient
.data
.l
[4] = 0l;
113 XSendEvent(display
, RootWindow(display
, 0), False
,
114 SubstructureNotifyMask
| SubstructureRedirectMask
, &msg
);
117 printf("requesting opposite in 3\n");
120 msg
.xclient
.type
= ClientMessage
;
121 msg
.xclient
.message_type
= _restack
;
122 msg
.xclient
.display
= display
;
123 msg
.xclient
.window
= win
;
124 msg
.xclient
.format
= 32;
125 msg
.xclient
.data
.l
[0] = 2l;
126 msg
.xclient
.data
.l
[1] = 0l;
127 msg
.xclient
.data
.l
[2] = Opposite
;
128 msg
.xclient
.data
.l
[3] = 0l;
129 msg
.xclient
.data
.l
[4] = 0l;
130 XSendEvent(display
, RootWindow(display
, 0), False
,
131 SubstructureNotifyMask
| SubstructureRedirectMask
, &msg
);
135 XNextEvent(display
, &report
);