comparison lisp/mouse.el @ 78067:b24147eb76bb

(mouse-drag-mode-line-1): Quit mouse tracking when event is not a cons cell. Do not unread drag-mouse-1 events. Select right window in check whether space was stolen from window above.
author Martin Rudalics <rudalics@gmx.at>
date Mon, 02 Jul 2007 05:40:12 +0000
parents e3994020ab84
children c30936b69ac7
comparison
equal deleted inserted replaced
78066:18c85566528f 78067:b24147eb76bb
431 ;; drag if 431 ;; drag if
432 ;; - there is a mouse-movement event 432 ;; - there is a mouse-movement event
433 ;; - there is a scroll-bar-movement event 433 ;; - there is a scroll-bar-movement event
434 ;; (same as mouse movement for our purposes) 434 ;; (same as mouse movement for our purposes)
435 ;; quit if 435 ;; quit if
436 ;; - there is a keyboard event or some other unknown event 436 ;; - there is a keyboard event or some other unknown event.
437 ;; unknown event. 437 (cond ((not (consp event))
438 (cond ((integerp event)
439 (setq done t)) 438 (setq done t))
440 439
441 ((memq (car event) '(switch-frame select-window)) 440 ((memq (car event) '(switch-frame select-window))
442 nil) 441 nil)
443 442
444 ((not (memq (car event) '(mouse-movement scroll-bar-movement))) 443 ((not (memq (car event) '(mouse-movement scroll-bar-movement)))
445 (when (consp event) 444 (when (consp event)
446 (push event unread-command-events)) 445 ;; Do not unread a drag-mouse-1 event since it will cause the
446 ;; selection of the window above when dragging the modeline
447 ;; above the selected window.
448 (unless (eq (car event) 'drag-mouse-1)
449 (push event unread-command-events)))
447 (setq done t)) 450 (setq done t))
448 451
449 ((not (eq (car mouse) start-event-frame)) 452 ((not (eq (car mouse) start-event-frame))
450 nil) 453 nil)
451 454
496 ;; around it. 499 ;; around it.
497 (when (or (/= start-nwindows (count-windows t)) 500 (when (or (/= start-nwindows (count-windows t))
498 (and (not should-enlarge-minibuffer) 501 (and (not should-enlarge-minibuffer)
499 (> growth 0) 502 (> growth 0)
500 mode-line-p 503 mode-line-p
501 (/= top (nth 1 (window-edges))))) 504 (/= top
505 (nth 1 (window-edges
506 ;; Choose right window.
507 start-event-window)))))
502 (set-window-configuration wconfig))))))))) 508 (set-window-configuration wconfig)))))))))
503 509
504 (defun mouse-drag-mode-line (start-event) 510 (defun mouse-drag-mode-line (start-event)
505 "Change the height of a window by dragging on the mode line." 511 "Change the height of a window by dragging on the mode line."
506 (interactive "e") 512 (interactive "e")