Subject: bug#23690: 25.0.94; Window resizing regression

From: martin rudalics <[email-masked]>
Date: Fri, 03 Jun 2016 15:54:11 +0200

> 0. emacs -Q
 > 1. Type `C-x 3' to split the selected window into two side-by-side
 >     windows.
 > 2. Sanity check: click mouse-1 on the divider between the mode lines,
 >     and observe that by dragging the mouse you can move the vertical
 >     boundary between the windows to the left or right.
 > 3. In the menu Options->Show/Hide->Scroll-bar click the "On the Left"
 >     button to make the scroll bars appear on the left side of the
 >     windows.
 > 4. Repeat step 2.
 > => The vertical boundary between the windows does not change, but
 >     instead the echo area displays the message "No window on the right of
 >     this one" (although the selected window is the one on the left).
 >
 > This is a regression from Emacs 24.5, where step 4 works just like step
 > 2.  Git bisect identifies the following as the responsible commit:
 >
 > commit 3110159d1fb6b6071803355951d9ae314095df36
 > Author: Martin Rudalics <[email-masked]>
 > Date:   Fri Oct 24 11:58:43 2014 +0200
 >
 >      Improve mouse dragging of frame edges.
 >
 >      * keyboard.c (make_lispy_position): Return coordinates also when
 >      on scroll bars, fringes, margins or not in a window.
 >      * xdisp.c (show_mouse_face): Don't change cursor face during
 >      mouse tracking.
 >      * mouse.el (mouse-drag-line): Don't use mouse-pixel-position.
 >      Calculate increment from last position instead of window edge.
 >      Add right- and bottom-divider bindings to transient map.

Would the attached patch fix it for you?

Thanks, martin
diff --git a/lisp/mouse.el b/lisp/mouse.el
index fa355ff..592338a 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -406,7 +406,15 @@ mouse-drag-line
 			   (or (not resize-mini-windows)
 			       (eq minibuffer-window
 				   (active-minibuffer-window)))))))
-	  (setq draggable nil))))
+	  (setq draggable nil)))
+     ((eq line 'vertical)
+      (let ((divider-width (frame-right-divider-width frame)))
+        (when (and (or (not (numberp divider-width))
+                       (zerop divider-width))
+                   (eq (cdr (assq 'vertical-scroll-bars
+                                  (frame-parameters frame)))
+                       'left))
+	(setq window (window-in-direction 'left window t))))))

     (let* ((exitfun nil)
            (move