emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: check_min_window_sizes]


From: martin rudalics
Subject: Re: address@hidden: check_min_window_sizes]
Date: Mon, 20 Feb 2006 11:11:53 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

 >  > That's to be expected, no?  Or do you think that turning on the fringe
 >  > is supposed to increase the size of the window (I don't)?
 >
 > I agree with you.  Unfortunately, Emacs doesn't.  When, in the sequel, I
 > try to drag the vertical divider between the two windows Emacs tells me
 > something like:
 >
 > Debugger entered--Lisp error: (error "Attempt to drag rightmost scrollbar")
 >   signal(error ("Attempt to drag rightmost scrollbar"))
 >   error("Attempt to drag rightmost scrollbar")
 >   mouse-drag-vertical-line((down-mouse-1 (#<window 10 on *scratch*>
 > vertical-line (1226 . 848) 3399399 nil 126 (0 . 3) nil (0 . 794) (1 .
 > 18))))
 >   call-interactively(mouse-drag-vertical-line)

That's a bug in `mouse-drag-vertical-line'.  It can be reproduced by
removing fringes and customizing window-min-width to 2.  If you now
split a window horizontally and drag the vertical divider such that the
right window shrinks to its minimum width you can't enlarge it anymore.

The bug occurs because `mouse-drag-vertical-line' compares coordinates
returned by `window-edges' with `frame-width'.  I believe that
`window-inside-edges' should be used here, see the attached patch.


        * mouse.el (mouse-drag-vertical-line): Use window-inside-edges instead
        of window-edges.  Remove start-nwindows since it's not needed.


*** mouse.el    Thu Jan  5 07:44:38 2006
--- mouse.el    Mon Feb 20 10:47:32 2006
***************
*** 551,569 ****
         (echo-keystrokes 0)
         (start-event-frame (window-frame (car (car (cdr start-event)))))
         (start-event-window (car (car (cdr start-event))))
-        (start-nwindows (count-windows t))
         event mouse x left right edges wconfig growth
         (which-side
          (or (cdr (assq 'vertical-scroll-bars (frame-parameters 
start-event-frame)))
              'right)))
!     (if (one-window-p t)
!       (error "Attempt to resize sole ordinary window"))
!     (if (eq which-side 'right)
!       (if (= (nth 2 (window-edges start-event-window))
!              (frame-width start-event-frame))
!           (error "Attempt to drag rightmost scrollbar"))
!       (if (= (nth 0 (window-edges start-event-window)) 0)
!         (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
        ;; enlarge-window only works on the selected window, so
--- 551,570 ----
         (echo-keystrokes 0)
         (start-event-frame (window-frame (car (car (cdr start-event)))))
         (start-event-window (car (car (cdr start-event))))
         event mouse x left right edges wconfig growth
         (which-side
          (or (cdr (assq 'vertical-scroll-bars (frame-parameters 
start-event-frame)))
              'right)))
!     (cond
!      ((one-window-p t)
!       (error "Attempt to resize sole ordinary window"))
!      ((and (eq which-side 'right)
!          (= (nth 2 (window-inside-edges start-event-window))
!             (frame-width start-event-frame)))
!       (error "Attempt to drag rightmost scrollbar"))
!      ((and (eq which-side 'left)
!          (= (nth 0 (window-inside-edges start-event-window)) 0))
!       (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
        ;; enlarge-window only works on the selected window, so
***************
*** 609,615 ****
                          (previous-window))))
                   (setq x (- (car (cdr mouse))
                              (if (eq which-side 'right) 0 2))
!                        edges (window-edges window)
                         left (nth 0 edges)
                         right (nth 2 edges))
                   ;; scale back a move that would make the
--- 610,616 ----
                          (previous-window))))
                   (setq x (- (car (cdr mouse))
                              (if (eq which-side 'right) 0 2))
!                        edges (window-inside-edges window)
                         left (nth 0 edges)
                         right (nth 2 edges))
                   ;; scale back a move that would make the

reply via email to

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