all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David PONCE <david.ponce@wanadoo.fr>
Subject: Can't enlarge a window by dragging the header line
Date: Wed, 13 Oct 2004 12:33:22 +0200 (CEST)	[thread overview]
Message-ID: <22989075.1097663602331.JavaMail.www@wwinf0402> (raw)

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  <david@dponce.com>

	* 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	other threads:[~2004-10-13 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13 10:33 David PONCE [this message]
2004-10-15  0:25 ` Can't enlarge a window by dragging the header line Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22989075.1097663602331.JavaMail.www@wwinf0402 \
    --to=david.ponce@wanadoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.