[Xquartz-dev] geometry regression in 2.3.2-beta3

robert delius royar x11 at frinabulax.org
Tue Nov 18 07:54:42 PST 2008


Tue, 18 Nov 2008 (10:28 -0500 UTC) Tom Lane wrote:

> Jeremy Huddleston <jeremyhu at freedesktop.org> writes:
>> Could you guys give this one a try:
>> http://people.freedesktop.org/~jeremyhu/quartz-wm-debug-20081117.2.bz2
>> It fixes gravity handling in the ConfigureRequestEvent handler.
>
> Not an improvement, I'm afraid :-(
>
> I still see emacs appearing at the right (where it's supposed to) and
> then getting repositioned to the left.  The only change is that it's
> now offset down from top left, by about the height of a window title
> bar.

I have a elisp-based work around for the original problem.  I have for 
some time saved the upper-left corner position on exit like this:

(add-hook 'kill-emacs-hook
   '(lambda ()
      (call-process "/usr/bin/defaults" nil nil nil "write"  "org.royar.xemacs" "x" (format "%d" (frame-property nil 'left)))
      (call-process "/usr/bin/defaults" nil nil nil "write"  "org.royar.xemacs" "y" (format "%d" (+ 22 (frame-property nil 'top))))
    )
)

The shell script that starts XEmacs from within a Platypus wrapper would 
then create the geometry setting to pass to the command line.

I just added this function to XEmacs which can be called early on to 
move the frame back to where it was when the program last exited:

(defun position-default-frame ()
   (set-buffer (get-buffer-create " *Default Framer*"))
   (delete-region (point-min) (point-max))
   (let ((Xaxis 0)
 	(Yaxis 0))
 	(call-process "/usr/bin/defaults" nil t nil "read" "org.royar.xemacs" "x")
 	(goto-char (point-min))
 	(setq Xaxis (buffer-substring (point-min) (1- (point-max))))
 	(delete-region (point-min) (point-max))
 	(call-process "/usr/bin/defaults" nil t nil "read" "org.royar.xemacs" "y")
 	(goto-char (point-min))
 	(setq Yaxis (buffer-substring (point-min) (1- (point-max))))
 	(set-buffer-modified-p nil)
 	(kill-buffer (current-buffer))
 	(set-frame-position (display-frame nil) (string-to-int Xaxis) (string-to-int Yaxis))
 	)
   )

Not pretty, but it accomplishes the goal.  I call the function 
immediately after setting the default font specifier values.  This works 
for 21.5.x (currently x=beta28).

-- 
Dr. Robert Delius Royar                   Associate Professor of English
Morehead State University                             Morehead, Kentucky


More information about the Xquartz-dev mailing list