summaryrefslogtreecommitdiff
path: root/tests/noresize.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-07-10 23:27:02 +0000
committerDana Jansens <danakj@orodu.net>2003-07-10 23:27:02 +0000
commit81af5a8b0caadc0a82ff2304c315f816c9576e93 (patch)
treeccbe40fccf5bd00b6a5cba87c20aec3ad8b6e55a /tests/noresize.c
parentb0e8e276e451639689ebc9c58c1afe54897bceb2 (diff)
add disabled buttons, instead of now showing buttons at all when they wont do anything, now show a disabled button instead. this severely breaks compatibility with blackbox themes since there is no good way to automiatically create a disabled button that i can think of, so if they dont exist in the theme you get black and white for the button.
when a window cant be resized, its handle is not removed but its grips are. change allowing the user to disable individual decorations as that is overkill, instead allow a toggle through the client.decorate boolean.
Diffstat (limited to 'tests/noresize.c')
-rw-r--r--tests/noresize.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/noresize.c b/tests/noresize.c
new file mode 100644
index 00000000..dd33fd47
--- /dev/null
+++ b/tests/noresize.c
@@ -0,0 +1,61 @@
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+int main () {
+ XSetWindowAttributes xswa;
+ unsigned long xswamask;
+ Display *display;
+ Window win;
+ XEvent report;
+ int x=10,y=10,h=100,w=400;
+ XSizeHints size;
+
+ display = XOpenDisplay(NULL);
+
+ if (display == NULL) {
+ fprintf(stderr, "couldn't connect to X server :0\n");
+ return 0;
+ }
+
+ xswa.win_gravity = StaticGravity;
+ xswamask = CWWinGravity;
+
+ win = XCreateWindow(display, RootWindow(display, 0),
+ x, y, w, h, 10, CopyFromParent, CopyFromParent,
+ CopyFromParent, xswamask, &xswa);
+
+ XSetWindowBackground(display,win,WhitePixel(display,0));
+
+ size.flags = PMinSize | PMaxSize;
+ size.max_width = 0;
+ size.min_width = w;
+ size.max_height = 0;
+ size.min_height = h;
+ XSetWMNormalHints(display, win, &size);
+
+ XMapWindow(display, win);
+ XFlush(display);
+
+ XSelectInput(display, win, ExposureMask | StructureNotifyMask);
+
+ while (1) {
+ XNextEvent(display, &report);
+
+ switch (report.type) {
+ case Expose:
+ printf("exposed\n");
+ break;
+ case ConfigureNotify:
+ x = report.xconfigure.x;
+ y = report.xconfigure.y;
+ w = report.xconfigure.width;
+ h = report.xconfigure.height;
+ printf("confignotify %i,%i-%ix%i\n",x,y,w,h);
+ break;
+ }
+
+ }
+
+ return 1;
+}