[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs 22.1 spit window mouse resize
From: |
martin rudalics |
Subject: |
Re: Emacs 22.1 spit window mouse resize |
Date: |
Sun, 17 Jun 2007 15:43:55 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> I think that dragging the mode line up or down
> should not change the selected window. If it does select a window,
> that's a bug.
>
> I tried to fix this bug, using mouse-drag-move-window-top
> to avoid the need to temporarily select a window inside
> mouse-drag-mode-line-1. Why does it select a window?
It selects the window above because in `mouse-drag-mode-line-1' the last
event before leaving the `track-mouse' form is a drag-mouse-1 event and
it's unread by the code. Its subsequent execution causes, according to
the binding
(global-set-key [mode-line drag-mouse-1] 'mouse-select-window)
the selection of the window above. Removing that binding still doesn't
work because this would cause the alternate binding
(global-set-key [mode-line mouse-1] 'mouse-select-window)
to become effective. The attached patch should take care of this and
the other problem. OK to install?
*** mouse.el.~1.315.~ Mon Apr 2 07:45:08 2007
--- mouse.el Sun Jun 17 14:53:46 2007
***************
*** 433,441 ****
;; - there is a scroll-bar-movement event
;; (same as mouse movement for our purposes)
;; quit if
! ;; - there is a keyboard event or some other unknown event
! ;; unknown event.
! (cond ((integerp event)
(setq done t))
((memq (car event) '(switch-frame select-window))
--- 433,440 ----
;; - there is a scroll-bar-movement event
;; (same as mouse movement for our purposes)
;; quit if
! ;; - there is a keyboard event or some other unknown event.
! (cond ((not (consp event))
(setq done t))
((memq (car event) '(switch-frame select-window))
***************
*** 443,449 ****
((not (memq (car event) '(mouse-movement scroll-bar-movement)))
(when (consp event)
! (push event unread-command-events))
(setq done t))
((not (eq (car mouse) start-event-frame))
--- 442,452 ----
((not (memq (car event) '(mouse-movement scroll-bar-movement)))
(when (consp event)
! ;; Do not unread a drag-mouse-1 event since it will cause the
! ;; selection of the window above when dragging the modeline
! ;; above the selected window.
! (unless (eq (car event) 'drag-mouse-1)
! (push event unread-command-events)))
(setq done t))
((not (eq (car mouse) start-event-frame))
***************
*** 498,504 ****
(and (not should-enlarge-minibuffer)
(> growth 0)
mode-line-p
! (/= top (nth 1 (window-edges)))))
(set-window-configuration wconfig)))))))))
(defun mouse-drag-mode-line (start-event)
--- 501,510 ----
(and (not should-enlarge-minibuffer)
(> growth 0)
mode-line-p
! (/= top
! (nth 1 (window-edges
! ;; Choose right window.
! start-event-window)))))
(set-window-configuration wconfig)))))))))
(defun mouse-drag-mode-line (start-event)