Maximizing Frames

xyblor xyblor at gmail.com
Wed Feb 20 18:12:47 EST 2008


This is a hack to enable "maximizing" frames on the left or right display 
in Win32. It didn't work in Linux since device-system-metric only knows 
about 'size-device, and not 'size-workspace.

Yes I know how horrible my code is, but kehoea asked for it on #xemacs, 
and I'm really just posting to let people know that it's desirable and 
possible feature. Maybe someone's interested enough to do it right?


(defun fake-maximize (&optional frame monitor)
   "e.g. (fake-maximize terminal-frame 'right)"
   (unless frame (setf frame terminal-frame))
   (let* ((screen-size (device-system-metric
                        (frame-device terminal-frame)
                        'size-workspace))
          (screen-width (- (car screen-size) 4))
          (screen-height (- (cdr screen-size) 14)))
     (cond ((equal monitor 'left)  (set-frame-position
                                    frame
                                    (- -8 screen-width) -4))
           ((equal monitor 'right) (set-frame-position
                                    frame
                                    (+ screen-width 4) -4))
           (t (set-frame-position frame 0 -4)
              (decf screen-height 28)
              (decf screen-width 4)))
     (set-frame-pixel-size frame screen-width screen-height)))




More information about the XEmacs-Beta mailing list