Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!ux1.cso.uiuc.edu!sunc5.cs.uiuc.edu!carroll From: carroll@sunc5.cs.uiuc.edu (Alan M. Carroll) Newsgroups: comp.windows.x Subject: Re: twm - What is size of title bar? Keywords: twm title X Message-ID: <1990Oct13.184110.13150@ux1.cso.uiuc.edu> Date: 13 Oct 90 18:41:10 GMT References: <162@sdrc.UUCP> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: carroll@sunc5.cs.uiuc.edu (Alan M. Carroll) Distribution: usa Organization: University of Illinois at Urbana Lines: 22 What we've done for this is to trace back the X window tree until you get a window whose parent is the root window, and then retrieve the screen information for that window. This can be compared to the information for the actual client window to determine the size of the various WM borders. I don't have any C code for this, but here's some Epoch code that does it - (defun backing-screen-info (&optional win) (setq win (or win (current-screen))) (let ((parent nil) (root nil) (wlist nil)) (while (and (setq wlist (query-tree win)) (setq parent (cadr wlist)) (setq root (car wlist)) (not (equal root parent))) (setq win parent)) (and parent (screen-information win)))) This code is used for a modified version of Dan Pierson's minibuffer mover, so that the title bar of the minibuffer doesn't obscure the bottom of the edit screen, i.e. the code matches up the edges of the WM borders, not the client window borders, which is what I understood the original question to be.