From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David PONCE Newsgroups: gmane.emacs.devel Subject: Can't enlarge a window by dragging the header line Date: Wed, 13 Oct 2004 12:33:22 +0200 (CEST) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <22989075.1097663602331.JavaMail.www@wwinf0402> Reply-To: david.ponce@wanadoo.fr NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1097663695 23690 80.91.229.6 (13 Oct 2004 10:34:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Oct 2004 10:34:55 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 13 12:34:44 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CHgSy-0003TH-00 for ; Wed, 13 Oct 2004 12:34:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CHga0-0000OW-69 for ged-emacs-devel@m.gmane.org; Wed, 13 Oct 2004 06:42:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CHgZk-0000Mp-O5 for emacs-devel@gnu.org; Wed, 13 Oct 2004 06:41:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CHgZi-0000LG-BU for emacs-devel@gnu.org; Wed, 13 Oct 2004 06:41:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CHgZi-0000LB-8S for emacs-devel@gnu.org; Wed, 13 Oct 2004 06:41:42 -0400 Original-Received: from [193.252.22.27] (helo=mwinf0408.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CHgRf-0000tT-Mc for emacs-devel@gnu.org; Wed, 13 Oct 2004 06:33:24 -0400 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0408.wanadoo.fr (SMTP Server) with SMTP id 56BE11800173 for ; Wed, 13 Oct 2004 12:33:22 +0200 (CEST) Original-Received: from wwinf0402 (wwinf0402 [172.22.135.29]) by mwinf0408.wanadoo.fr (SMTP Server) with ESMTP id 523301800115 for ; Wed, 13 Oct 2004 12:33:22 +0200 (CEST) Original-To: emacs-devel@gnu.org X-Originating-IP: [194.2.245.141] X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28346 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28346 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 * 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