emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't enlarge a window by dragging the header line


From: David PONCE
Subject: Can't enlarge a window by dragging the header line
Date: Wed, 13 Oct 2004 12:33:22 +0200 (CEST)

Hi,

In GNU Emacs 21.3.50.7 (i686-pc-linux-gnu, GTK+ Version 2.4.7)
 of 2004-10-13 on localhost
configured using `configure '--with-gtk'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

I noticed that dragging the header line of a window not at top of
frame, does not permit to enlarge the window.  To reproduce:

emacs -q -no-site-file
C-h i
C-x 2

Dragging the header line of the bottom window down works, dragging it
up does nothing.  To enlarge the window again it is necessary to
drag the mode line of the window above.

IMHO, it looks like a bug.  Following is a patch to lisp/mouse.el
which fixes it.  What do you think?

Regards.
David

2004-10-13  David Ponce  <address@hidden>

        * mouse.el (mouse-drag-move-window-top): New function.
        (mouse-drag-mode-line-1): Use it.

Index: lisp/mouse.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mouse.el,v
retrieving revision 1.249
diff -c -r1.249 mouse.el
*** lisp/mouse.el       9 Jul 2004 16:54:04 -0000       1.249
--- lisp/mouse.el       13 Oct 2004 10:04:28 -0000
***************
*** 338,343 ****
--- 338,354 ----
      (select-window window)
      (enlarge-window growth nil (> growth 0))))
  
+ (defsubst mouse-drag-move-window-top (window growth)
+   "Move the top of WINDOW up or down by GROWTH lines.
+ Move it down if GROWTH is positive, or up if GROWTH is negative.
+ If this would make WINDOW too short, shrink the window or windows
+ above it to make room."
+   ;; Moving the top of WINDOW is actually moving the bottom of the
+   ;; window above.
+   (let ((window-above (mouse-drag-window-above window)))
+     (and window-above
+        (mouse-drag-move-window-bottom window-above (- growth)))))
+ 
  (defun mouse-drag-mode-line-1 (start-event mode-line-p)
    "Change the height of a window by dragging on the mode or header line.
  START-EVENT is the starting mouse-event of the drag action.
***************
*** 444,450 ****
                       (select-window start-event-window))
                   ;; no.  grow/shrink the selected window
                   ;(message "growth = %d" growth)
!                  (mouse-drag-move-window-bottom start-event-window growth))
  
                 ;; if this window's growth caused another
                 ;; window to be deleted because it was too
--- 455,463 ----
                       (select-window start-event-window))
                   ;; no.  grow/shrink the selected window
                   ;(message "growth = %d" growth)
!                  (if mode-line-p
!                      (mouse-drag-move-window-bottom start-event-window growth)
!                    (mouse-drag-move-window-top start-event-window growth)))
  
                 ;; if this window's growth caused another
                 ;; window to be deleted because it was too








reply via email to

[Prev in Thread] Current Thread [Next in Thread]