ports/139490: [patch] tvtwm fixes for users of firefox3, gimp and other apps

Kurt Jaeger pi at opsec.eu
Sat Oct 10 19:10:01 UTC 2009


>Number:         139490
>Category:       ports
>Synopsis:       [patch] tvtwm fixes for users of firefox3, gimp and other apps
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 10 19:10:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Kurt Jaeger
>Release:        FreeBSD 8.0-RC1 amd64
>Organization:
-
>Environment:
System: FreeBSD fa8.opsec.eu 8.0-RC1 FreeBSD 8.0-RC1 #0: Wed Oct 7 14:12:32 CEST 2009 pi at f8-64.opsec.eu:/usr/obj/usr/src/sys/GENERIC amd64


>Description:
	tvtwm has several problems which manifest themselves when using
	modern applications like firefox3 or gimp or many others.

	1) If you use the 'print' menue in firefox3 and 'cancel' after
	the firefox3 menue comes up, twm will restart, which de-iconifies
	your icons and reshuffles window locations. This is very annoying
	and makes tvtwm unusable if many windows/icons are in use.
	Similar effects come in many modern applications which trigger
	file selection popups.

	2) If you stop and restart tvtwm, all windows sometimes move
	a little bit to the right and a little bit to the bottom.
	This is due to incomplete support for window borders calculations
	during restart.

	3) If you use the virtual screen feature of tvtwm and
	select eg. virtual screen 5, then stop tvtwm and restart it,
	all windows in virtual screens 1-4 become unaccessible because
	the window location is wrongly calculated.

	4) If you start a second firefox3 profile in a different
	virtual screen n than virtual screen 1, the window offsets during
	the iconify operation will be miscalculated, which causes
	firefox3 windows to disappear after one iconify/deiconify/iconify
	cycle. They will not really disappear, but their x coordinates
	are miscalculated and the window will reappear in virtual
	screen n*2.

	All those bugs make tvtwm unusable with modern applications.
	The tvtwm port attached contains the patches to fix this.

>How-To-Repeat:
	1) how to repeat
	- start some xterm, iconify it
	- start firefox3
	- press ctrl-p in firefox3 and select 'cancel'
	the iconified xterm will de-iconify and loose its coordinates.

	2) how to repeat
	- startx and start tvtwm
	- start some xterm
	- stop tvtwm and restart it
	the window will move for the values of 'border and title' pixels
	to the right and bottom.

	3) how to repeat
	- start tvtwm with virtual screens, with
	  VirtualDesktop  "eval(WIDTH*7)`x'eval(HEIGHT)"
	  "F2"    = m     : all   : f.scroll "+1+1"
	  "F5"    = m     : all   : f.scroll "+4+1"
          in the .twmrc
	- start some xterm in virtual screen 1
	- select key F5 to move to the 5th virtual screen
	- start some other xterm in virtual screen 5
	- stop tvtwm and restart
	virtual screen 5 will become virtual screen 1 and
	the screens below virtual screen 5 will become unreachable.

	4) how to repeat
	- start tvtwm like in 3)
	- start a firefox3 browser in virtual screen 2
	- iconify, deiconify and iconify again
	the icon will appear in some other virtual screen (3, 4, 5?)
	or will disappear because it will land in negative y coordinates

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	.
#	./Makefile
#	./distinfo
#	./pkg-descr
#	./files
#	./files/patch-aa
#	./files/patch-ab
#	./files/patch-ac
#	./files/patch-parse.c
#	./files/patch-parse.h
#	./files/patch-icons.c
#	./files/patch-menus.c
#	./files/patch-twm.c
#
echo c - .
mkdir -p . > /dev/null 2>&1
echo x - ./Makefile
sed 's/^X//' >./Makefile << '464ef7c6571951809b23e262cbe26e19'
X# New ports collection makefile for:	tvtwm
X# Date created:		5th December 1994
X# Whom:			gpalmer
X#
X# $FreeBSD: ports/x11-wm/tvtwm/Makefile,v 1.28 2008/05/13 10:27:08 flz Exp $
X#
X
XPORTNAME=	tvtwm
XPORTVERSION=	pl11
XPORTREVISION=	1
XCATEGORIES=	x11-wm
XMASTER_SITES=	${MASTER_SITE_XCONTRIB}
XMASTER_SITE_SUBDIR=	window_managers
XDISTNAME=	${PORTNAME}.${PORTVERSION}
X
XMAINTAINER=	ports at FreeBSD.org
XCOMMENT=	Twm with a virtual desktop
X
XWRKSRC=		${WRKDIR}/tvtwm
XUSE_IMAKE=	yes
XUSE_XORG=	xbitmaps xpm xmu
XMAN1=		tvtwm.1
XMANCOMPRESSED=	no
XPLIST_FILES=	bin/tvtwm
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/tvtwm ${PREFIX}/bin
X	${INSTALL_MAN} ${WRKSRC}/tvtwm.man ${MANPREFIX}/man/man1/tvtwm.1
X
X.include <bsd.port.mk>
464ef7c6571951809b23e262cbe26e19
echo x - ./distinfo
sed 's/^X//' >./distinfo << 'aec8793adfd5b7c3f00e62ae41a09ac2'
XMD5 (tvtwm.pl11.tar.gz) = 0e91b9c05ad9709e5843606200bff42a
XSHA256 (tvtwm.pl11.tar.gz) = aae4c23347497c3246388d42cf753616b2df4dee25f936e54910af2c5625c5d5
XSIZE (tvtwm.pl11.tar.gz) = 224935
aec8793adfd5b7c3f00e62ae41a09ac2
echo x - ./pkg-descr
sed 's/^X//' >./pkg-descr << '0e313719ff012ceaf97a028d51caa8f5'
Xtvtwm is a version of twm which incorporates virtual desktops, similar
Xto vtwm and swm. It is nearly identical to twm until you specify a 
Xvirtual desktop size in your .[tv]twmrc file, which is when you start
Xgetting the benefits of this window manager.
X
XGary Palmer
Xgpalmer at FreeBSD.org
0e313719ff012ceaf97a028d51caa8f5
echo c - ./files
mkdir -p ./files > /dev/null 2>&1
echo x - ./files/patch-aa
sed 's/^X//' >./files/patch-aa << 'f89bda4adbafd14407c547254592b595'
X*** gram.y.orig	Mon Dec  5 07:35:28 1994
X--- gram.y	Mon Dec  5 07:36:42 1994
X***************
X*** 79,85 ****
X  extern int do_single_keyword(), do_string_keyword(), do_number_keyword();
X  extern name_list **do_colorlist_keyword();
X  extern int do_color_keyword(), do_string_savecolor();
X! extern int yylineno;
X  %}
X  
X  %union
X--- 79,85 ----
X  extern int do_single_keyword(), do_string_keyword(), do_number_keyword();
X  extern name_list **do_colorlist_keyword();
X  extern int do_color_keyword(), do_string_savecolor();
X! int yylineno;
X  %}
X  
X  %union
f89bda4adbafd14407c547254592b595
echo x - ./files/patch-ab
sed 's/^X//' >./files/patch-ab << 'e9c624f0152eed8f25e81dff936fdae0'
X*** lex.l.orig	Wed Mar 10 20:57:51 1993
X--- lex.l	Mon Dec  5 08:06:40 1994
X***************
X*** 43,48 ****
X--- 43,61 ----
X  
X  extern int ParseError;
X  
X+ #undef YY_INPUT
X+ #define YY_INPUT(buf,result,max_size) \
X+ 	{ \
X+ 		int res = (*twmInputFunc)(); \
X+ 		if (res == NULL) \
X+ 			result = YY_NULL; \
X+ 		else \
X+ 		{ \
X+ 			buf[0] = res; \
X+ 			result = 1; \
X+ 		} \
X+ 	}
X+ 
X  %}
X  
X  string				\"([^"]|\\.)*\"
X***************
X*** 98,107 ****
X  #endif
X  
X  #undef unput
X! #undef input
X  #undef output
X  #undef feof
X  #define unput(c)	twmUnput(c)
X! #define input()		(*twmInputFunc)()
X  #define output(c)	TwmOutput(c)
X  #define feof()		(1)
X--- 111,120 ----
X  #endif
X  
X  #undef unput
X! /*#undef input*/
X  #undef output
X  #undef feof
X  #define unput(c)	twmUnput(c)
X! /*#define input()		(*twmInputFunc)()*/
X  #define output(c)	TwmOutput(c)
X  #define feof()		(1)
e9c624f0152eed8f25e81dff936fdae0
echo x - ./files/patch-ac
sed 's/^X//' >./files/patch-ac << '357ea3768e19d258e013e16d2489e553'
X*** Imakefile.orig	Thu Feb  2 18:25:44 1995
X--- Imakefile	Sun May 30 11:42:08 1999
X***************
X*** 25,31 ****
X  XCOMM will define yylineno.  If you get an "Undefined symbol: _yylineno"
X  XCOMM when linking, adjust this to work on your system.
X  
X! #if defined(i386BsdArchitecture) || defined(LinuxArchitecture)
X  # ifdef LexCmd
X  LEX = LexCmd -l
X  # else
X--- 25,31 ----
X  XCOMM will define yylineno.  If you get an "Undefined symbol: _yylineno"
X  XCOMM when linking, adjust this to work on your system.
X  
X! #if defined(FreeBSDArchitecture) || defined(LinuxArchitecture)
X  # ifdef LexCmd
X  LEX = LexCmd -l
X  # else
X***************
X*** 100,106 ****
X  SpecialObjectRule(LocPixmap.o,NullParameter,'-DBITMAPDIR="$(INCDIR)/bitmaps"')
X  SpecialObjectRule(twm.o,NullParameter,$(TWM_DEFS))
X  
X! #if defined(UltrixArchitecture) || defined(AlphaArchitecture)
X  SpecialObjectRule(menus.o,NullParameter,-Olimit 700)
X  #endif
X  
X--- 100,106 ----
X  SpecialObjectRule(LocPixmap.o,NullParameter,'-DBITMAPDIR="$(INCDIR)/bitmaps"')
X  SpecialObjectRule(twm.o,NullParameter,$(TWM_DEFS))
X  
X! #if !defined(FreeBSDArchitecture) && (defined(UltrixArchitecture) || defined(AlphaArchitecture))
X  SpecialObjectRule(menus.o,NullParameter,-Olimit 700)
X  #endif
X  
X***************
X*** 120,129 ****
X  XCOMM	ln $(BINDIR)/tvtwm $(BINDIR)/twm
X  
X  #if (ProjectX < 5)
X! InstallNonExec(system.twmrc,$(TWMDIR))
X  /* InstallProgram(ssetroot,$(BINDIR)/xsetroot) */
X  #else
X! InstallNonExecFile(system.twmrc,$(TWMDIR))
X  /* InstallNamedProg(ssetroot,xsetroot,$(BINDIR)) */
X  #endif
X  
X--- 120,129 ----
X  XCOMM	ln $(BINDIR)/tvtwm $(BINDIR)/twm
X  
X  #if (ProjectX < 5)
X! /* InstallNonExec(system.twmrc,$(TWMDIR))*/
X  /* InstallProgram(ssetroot,$(BINDIR)/xsetroot) */
X  #else
X! /* InstallNonExecFile(system.twmrc,$(TWMDIR)) */
X  /* InstallNamedProg(ssetroot,xsetroot,$(BINDIR)) */
X  #endif
X  
357ea3768e19d258e013e16d2489e553
echo x - ./files/patch-parse.c
sed 's/^X//' >./files/patch-parse.c << 'ce3ca4abad2af543c855de5306c71ab5'
X--- parse.c.orig	2009-10-10 20:22:13.000000000 +0200
X+++ parse.c	2009-10-10 20:22:13.000000000 +0200
X@@ -646,6 +646,7 @@
X     { "f.deltastop",		FKEYWORD, F_DELTASTOP },
X     { "f.destroy",		FKEYWORD, F_DESTROY },
X     { "f.downiconmgr",		FKEYWORD, F_DOWNICONMGR },
X+    { "f.dumpstate",		FKEYWORD, F_DUMPSTATE },
X     { "f.exec",			FSKEYWORD, F_EXEC },
X     { "f.file",			FSKEYWORD, F_FILE },
X     { "f.focus",		FKEYWORD, F_FOCUS },
X@@ -1609,6 +1610,8 @@
X     }
X }
X 
X+static char *m4_defs();
X+
X static FILE *start_m4(fraw)
X FILE *fraw;
X {
X@@ -1627,7 +1630,6 @@
X 	if (fres == 0) {
X 		extern Display *dpy;
X 		extern char *display_name;
X-		static char *m4_defs();
X 		char *tmp_file;
X 
X 		/* Child */
ce3ca4abad2af543c855de5306c71ab5
echo x - ./files/patch-parse.h
sed 's/^X//' >./files/patch-parse.h << '4bdae740d5740d4c935c87ed5070d583'
X--- parse.h-orig	2009-10-10 20:22:14.000000000 +0200
X+++ parse.h	2009-10-10 20:22:13.000000000 +0200
X@@ -102,6 +102,7 @@
X #define F_CONSTRAINEDMOVE	55
X #define F_OPAQUEMOVE		56
X #define F_DELETEORDESTROY	57
X+#define F_DUMPSTATE		58
X 
X #define F_MENU			101	/* string */
X #define F_WARPTO		102	/* string */
4bdae740d5740d4c935c87ed5070d583
echo x - ./files/patch-icons.c
sed 's/^X//' >./files/patch-icons.c << '195da2bcd228eacb8f1c3f1a3ae89107'
X--- icons.c-orig	2009-10-10 20:22:14.000000000 +0200
X+++ icons.c	2009-10-10 20:22:13.000000000 +0200
X@@ -233,10 +233,12 @@
X 	*final_x = ie->x + (ie->w - iconWidth (tmp_win)) / 2;
X 	*final_y = ie->y + (ie->h - iconHeight (tmp_win)) / 2;
X     } else {
X+/*
X 	if (tmp_win->root == Scr->VirtualDesktop) {
X 	    def_x += Scr->vdtPositionX;
X 	    def_y += Scr->vdtPositionY;
X 	}
X+*/
X 	*final_x = def_x;
X 	*final_y = def_y;
X     }
X@@ -299,6 +301,7 @@
X 	if (!ir) return;		/* outside icon regions, leave alone */
X     }
X 
X+#ifdef NOTREACHED
X     defx = -100;
X     defy = -100;
X     PlaceIcon(tmp_win, defx, defy, &x, &y);
X@@ -310,6 +313,7 @@
X 	MoveIcon(tmp_win, x, y);
X 	tmp_win->icon_moved = FALSE;	/* since we've restored it */
X     }
X+#endif
X }
X 
X static IconEntry *
195da2bcd228eacb8f1c3f1a3ae89107
echo x - ./files/patch-menus.c
sed 's/^X//' >./files/patch-menus.c << '4d0dbfb948cc67c3ad537c768b615963'
X--- menus.c-orig	2009-10-10 20:22:14.000000000 +0200
X+++ menus.c	2009-10-10 20:22:13.000000000 +0200
X@@ -2674,14 +2674,20 @@
X 	if (DeferExecution(context, func, action, Scr->SelectCursor))
X 	    return TRUE;
X 
X-	if (tmp_win->isicon || !tmp_win->mapped )
X-	{
X+	if (tmp_win->isicon || !tmp_win->mapped ) {
X 	    DeIconify(tmp_win);
X 	}
X-        else if (func == F_ICONIFY)
X-	{
X-	    Iconify (tmp_win, eventp->xbutton.x_root - 5,
X-		     eventp->xbutton.y_root - 5);
X+        else if (func == F_ICONIFY) {
X+	    if ( tmp_win->root == Scr->VirtualDesktop ) {
X+		Iconify (tmp_win,
X+		    eventp->xbutton.x_root - 5 + Scr->vdtPositionX,
X+		    eventp->xbutton.y_root - 5 + Scr->vdtPositionY
X+		);
X+	    }
X+	    else {
X+		Iconify (tmp_win, eventp->xbutton.x_root - 5,
X+		    eventp->xbutton.y_root - 5);
X+	    }
X 	}
X 	break;
X 
X@@ -3091,6 +3097,50 @@
X 	    RelativeMove(tmp_win, action);
X 	break;
X 
X+    case F_DUMPSTATE:
X+	printf("doing dumpstate\n");
X+	{
X+	    Window RootW;
X+	    Window root, parent, *children;
X+	    unsigned int nchildren;
X+	    unsigned int numscr;
X+	    unsigned int i;
X+	    unsigned int scr;
X+
X+	    numscr = ScreenCount(dpy);
X+	    printf("# of screens: %d\n",numscr);
X+	    for(scr = 0; scr <= (numscr-1); scr++) {
X+		RootW = RootWindow(dpy, scr);
X+		printf("rootw: 0x%x\n",RootW);
X+		XGrabServer(dpy);
X+		XSync(dpy, 0);
X+		XQueryTree(dpy, RootW, &root, &parent, &children, &nchildren);
X+		for (i = 0; i < nchildren; i++) {
X+		    if (children[i]) {
X+			XWMHints *wmhintsp = XGetWMHints (dpy, children[i]);
X+			if (wmhintsp) {
X+			    if (wmhintsp->flags) {
X+				printf("i: %d wmhints w: 0x%x flags: %d ",
X+				    i,children[i], wmhintsp->flags
X+				);
X+			        if ( wmhintsp->flags & StateHint ) {
X+				    printf("state: %d ",
X+					wmhintsp->initial_state);
X+				}
X+				printf("\n");
X+			    }
X+			}
X+		    }
X+		    else {
X+			printf(" NOT DEFINED\n");
X+		    }
X+		}
X+	    }
X+	    XUngrabServer(dpy);
X+	    XFree(children);
X+	}
X+	break;
X+
X     case F_QUIT:
X 	Done();
X 	break;
X@@ -3188,6 +3238,7 @@
X 	case F_DESTROY:
X 	case F_DELETE:
X 	case F_DELETEORDESTROY:
X+	case F_DUMPSTATE:
X 	case F_WINREFRESH:
X 	case F_ZOOM:
X 	case F_FULLZOOM:
4d0dbfb948cc67c3ad537c768b615963
echo x - ./files/patch-twm.c
sed 's/^X//' >./files/patch-twm.c << '9c6b1ddbe89ca312ad89401f77c09bdd'
X--- twm.c-orig	2009-10-10 20:22:14.000000000 +0200
X+++ twm.c	2009-10-10 20:31:33.000000000 +0200
X@@ -185,6 +185,9 @@
X static int CatchRedirectError();	/* for settting RedirectError */
X static int TwmErrorHandler();	/* for everything else */
X static void SetRootProperties();	/* leave note on root window */
X+static void DisplayHints(XSizeHints *); /* PI-FIX */
X+static void calcgeo(Display *, Drawable, int *, int *, int *, int *);	/* PI-FIX */
X+
X char Info[INFO_LINES][INFO_SIZE];		/* info strings to print */
X int InfoLines;
X char *InitFile = NULL;
X@@ -248,6 +251,14 @@
X     int i, j, sync = FALSE;
X     unsigned long valuemask;	/* mask for create windows */
X     XSetWindowAttributes attributes;	/* attributes for create windows */
X+/* PI-FIX */
X+    XSizeHints mywmhints;
X+    long mylong;
X+    int res;
X+    int minx = 0, miny = 0;
X+    int *relx, *rely;
X+    int rx, ry;
X+/* PI-FIX */
X     int numManaged, firstscrn, lastscrn, scrnum;
X     extern ColormapWindow *CreateColormapWindow();
X     SIGNAL_T QueueRestartTwm();
X@@ -631,6 +640,67 @@
X 	    Scr->iconmgr.twm_win->isicon = TRUE;
X 
X 	/*
X+	 * allocate some space for relx, rely values
X+	 */
X+	relx = (int *) malloc(nchildren * sizeof(int));
X+	rely = (int *) malloc(nchildren * sizeof(int));
X+
X+	/*
X+	 * print a lot of information for each children
X+	 */
X+	for (i = 0; i < nchildren; i++) {
X+	    if (children[i]) {
X+		XWMHints *wmhintsp = XGetWMHints (dpy, children[i]);
X+
X+#ifdef DEBUG
X+		if (wmhintsp) {
X+		    if (wmhintsp->flags) {
X+			printf("  wmhints i: %d w: 0x%x flags: %d ",
X+			    i,children[i], wmhintsp->flags
X+			);
X+			if ( wmhintsp->flags & StateHint ) {
X+			    printf("state: %d ",wmhintsp->initial_state);
X+			}
X+			printf("\n");
X+		    }
X+		}
X+		res = XGetWMNormalHints(dpy, children[i], &mywmhints, &mylong);
X+		if (res != 0) {
X+		    DisplayHints(&mywmhints);
X+		}
X+		res = XGetWMSizeHints(dpy, children[i], &mywmhints, &mylong,
X+		    XA_WM_ZOOM_HINTS);
X+		if ( res != 0 ) {
X+		    DisplayHints(&mywmhints);
X+		}
X+		else {
X+		    printf("   no zoom hints\n");
X+		}
X+#endif
X+		calcgeo(dpy, children[i], &minx, &miny, &rx, &ry);
X+		relx[i] = rx;
X+		rely[i] = ry;
X+	    }
X+	}
X+
X+#ifdef DEBUG
X+	printf("minx: %d miny: %d\n", minx, miny);
X+#endif
X+
X+	/*
X+	 * move each children in the positive
X+	 */
X+	for (i = 0; i < nchildren; i++) {
X+	    if (children[i]) {
X+		if ( children[i] != Scr->Panner &&
X+		     children[i] != Scr->VirtualDesktop) {
X+		    /* HACK: only relx gets corrected */
X+		    res = XMoveWindow(dpy, children[i], relx[i]-minx, rely[i]);
X+		}
X+	    }
X+	}
X+
X+	/*
X 	 * weed out icon windows
X 	 */
X 	for (i = 0; i < nchildren; i++) {
X@@ -786,6 +856,7 @@
X {
X     XClientMessageEvent ev;
X     
X+printf("restart requested\n");
X     ev.type = ClientMessage;
X     ev.window = Scr->Root;
X     ev.message_type = _XA_TWM_RESTART;
X@@ -1248,3 +1319,125 @@
X     _XA_TWM_MACHINE = XInternAtom (dpy, "_TWM_MACHINE", False);
X }
X 
X+
X+/* stolen from xwininfo */
X+/*
X+ * Display a set of size hints
X+ */
X+static void
X+DisplayHints(XSizeHints *hints)
X+{
X+	long flags;
X+
X+	flags = hints->flags;
X+	
X+	if (flags & USPosition)
X+	  printf("      User supplied location: %d, %d\n",
X+		 hints->x, hints->y);
X+
X+	if (flags & PPosition)
X+	  printf("      Program supplied location: %d, %d\n",
X+		 hints->x, hints->y);
X+
X+	if (flags & USSize) {
X+	  printf("      User supplied size: %d by %d\n",
X+		 hints->width, hints->height);
X+	}
X+
X+	if (flags & PSize)
X+	  printf("      Program supplied size: %d by %d\n",
X+		 hints->width, hints->height);
X+
X+	if (flags & PMinSize)
X+	  printf("      Program supplied minimum size: %d by %d\n",
X+		 hints->min_width, hints->min_height);
X+
X+	if (flags & PMaxSize)
X+	  printf("      Program supplied maximum size: %d by %d\n",
X+		 hints->max_width, hints->max_height);
X+
X+	if (flags & PBaseSize) {
X+	  printf("      Program supplied base size: %d by %d\n",
X+		 hints->base_width, hints->base_height);
X+	}
X+
X+	if (flags & PResizeInc) {
X+	  printf("      Program supplied x resize increment: %d\n",
X+		 hints->width_inc);
X+	  printf("      Program supplied y resize increment: %d\n",
X+		 hints->height_inc);
X+	  if (hints->width_inc != 0 && hints->height_inc != 0) {
X+	      if (flags & USSize)
X+		  printf("      User supplied size in resize increments:  %d/%d by %d/%d\n",
X+			 hints->width, hints->width_inc, 
X+			 hints->height, hints->height_inc);
X+	      if (flags & PSize)
X+		  printf("      Program supplied size in resize increments:  %d/%d by %d/%d\n",
X+			 hints->width, hints->width_inc, 
X+			 hints->height, hints->height_inc);
X+	      if (flags & PMinSize)
X+		  printf("      Program supplied minimum size in resize increments: %d/%d by %d/%d\n",
X+			 hints->min_width, hints->width_inc,
X+			 hints->min_height, hints->height_inc);
X+	      if (flags & PBaseSize)
X+		  printf("      Program supplied base size in resize increments:  %d/%d by %d/%d\n",
X+			 hints->base_width, hints->width_inc, 
X+			 hints->base_height, hints->height_inc);
X+	  }
X+        }
X+
X+	if (flags & PAspect) {
X+	  printf("      Program supplied min aspect ratio: %d/%d\n",
X+		 hints->min_aspect.x, hints->min_aspect.y);
X+	  printf("      Program supplied max aspect ratio: %d/%d\n",
X+		 hints->max_aspect.x, hints->max_aspect.y);
X+        }
X+
X+	if (flags & PWinGravity) {
X+	  printf("      Program supplied window gravity: %d\n",
X+		hints->win_gravity);
X+	}
X+}
X+
X+/* stolen from xwininfo */
X+/*
X+ * print geometry
X+ */
X+static void
X+calcgeo(Display *dpy, Drawable d, int *minxp, int *minyp, int *rxp, int *ryp)
X+{
X+    int rel_x, rel_y, abs_x, abs_y;
X+    unsigned int width, height, border, depth;
X+    Window root;
X+    Window child;
X+
X+    if (XGetGeometry(dpy, d, &root,
X+                     &rel_x, &rel_y, &width, &height, &border, &depth)) {
X+
X+#ifdef DEBUG
X+        printf (" %ux%u+%d+%d", width, height, rel_x, rel_y);
X+#endif
X+	*rxp = rel_x;
X+	*ryp = rel_y;
X+#ifdef DEBUG
X+	printf(" vorher min: %d %d", *minxp, *minyp);
X+#endif
X+	if ( *minxp > rel_x ) {
X+		*minxp = rel_x;
X+	}
X+	if ( *minyp > rel_y ) {
X+		*minyp = rel_y;
X+	}
X+#ifdef DEBUG
X+	printf(" nachher min: %d %d\n", *minxp, *minyp);
X+#endif
X+        if (XTranslateCoordinates (dpy, d, root,
X+                                   0 ,0, &abs_x, &abs_y, &child)) {
X+#ifdef DEBUG
X+            printf ("  +%d+%d\n", abs_x - border, abs_y - border);
X+#endif
X+        }
X+    }
X+
X+}
X+
9c6b1ddbe89ca312ad89401f77c09bdd
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list