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.
This commit is contained in:
wennmach 2000-08-18 08:46:13 +00:00
parent edf4cd57c6
commit 45a94bc8f1
2 changed files with 31 additions and 1 deletions

View file

@ -1,6 +1,7 @@
$NetBSD: patch-sum,v 1.5 2000/08/17 18:38:00 fredb Exp $
$NetBSD: patch-sum,v 1.6 2000/08/18 08:46:13 wennmach Exp $
MD5 (patch-aa) = 77c1d0c6752a84a93f7fb566c6ba3a6e
MD5 (patch-ab) = 7a372dfcb44f68a52e65eed100883f7d
MD5 (patch-ac) = 5d1eab63a888564e347b8687a2ff6876
MD5 (patch-ad) = 3b92140a80b821e161cae0372140bab5
MD5 (patch-ae) = 6c97d0d546917a422f8947aedcf58cf3

View file

@ -0,0 +1,29 @@
$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;