45a94bc8f1
Don't exit in this case, select min(width, height) as size.
29 lines
954 B
Text
29 lines
954 B
Text
$NetBSD: patch-ae,v 1.1 2000/08/18 08:46:14 wennmach Exp $
|
|
|
|
Some window managers don't honour our X size hint for a square window geometry.
|
|
Don't exit in this case, select min(width, height) as size.
|
|
|
|
--- xworld.c.orig Fri Aug 18 10:01:18 2000
|
|
+++ xworld.c Fri Aug 18 10:01:23 2000
|
|
@@ -63,6 +63,8 @@
|
|
#define BORDER 5
|
|
#define SLEEP 120
|
|
|
|
+#define MIN(x,y) (((x)<(y))?(x):(y))
|
|
+
|
|
char *MainTitle[] = {"Hello, world"};
|
|
char *IconTitle[] = {"xworld"};
|
|
|
|
@@ -451,8 +453,12 @@
|
|
ConfigureEvent = (XConfigureEvent *)&event;
|
|
size = ConfigureEvent->width;
|
|
if (ConfigureEvent->height != size) {
|
|
+#if 0
|
|
fprintf(stderr, "xworld: error: width != height\n");
|
|
exit(1);
|
|
+#else
|
|
+ size = MIN(size, ConfigureEvent->height);
|
|
+#endif
|
|
}
|
|
if (size != old_size) {
|
|
old_size = size;
|