]> code.delx.au - gnu-emacs/blobdiff - lisp/mouse.el
* term.el (term-default-fg-color, term-default-bg-color): Fix custom type.
[gnu-emacs] / lisp / mouse.el
index 61d70404bd6159b3983b1d0204ffe2447f38c43c..538e6a500bb74cf29f9278bca43c31f6ac9a6a2c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mouse.el --- window system-independent mouse support  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993-1995, 1999-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1999-2013 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: hardware, mouse
@@ -425,7 +425,7 @@ must be one of the symbols `header', `mode', or `vertical'."
                                   (frame-parameters frame)))
                        'right)))
         (draggable t)
-        event position growth dragged)
+        finished event position growth dragged)
     (cond
      ((eq line 'header)
       ;; Check whether header-line can be dragged at all.
@@ -457,7 +457,7 @@ must be one of the symbols `header', `mode', or `vertical'."
     ;; Start tracking.
     (track-mouse
       ;; Loop reading events and sampling the position of the mouse.
-      (while draggable
+      (while (not finished)
        (setq event (read-event))
        (setq position (mouse-position))
        ;; Do nothing if
@@ -472,7 +472,7 @@ must be one of the symbols `header', `mode', or `vertical'."
        ;;   - there is a keyboard event or some other unknown event.
        (cond
         ((not (consp event))
-         (setq draggable nil))
+         (setq finished t))
         ((memq (car event) '(switch-frame select-window))
          nil)
         ((not (memq (car event) '(mouse-movement scroll-bar-movement)))
@@ -480,15 +480,15 @@ must be one of the symbols `header', `mode', or `vertical'."
            ;; Do not unread a drag-mouse-1 event to avoid selecting
            ;; some other window.  For vertical line dragging do not
            ;; unread mouse-1 events either (but only if we dragged at
-           ;; least once to allow mouse-1 clicks get through.
+           ;; least once to allow mouse-1 clicks get through).
            (unless (and dragged
                         (if (eq line 'vertical)
                             (memq (car event) '(drag-mouse-1 mouse-1))
                           (eq (car event) 'drag-mouse-1)))
              (push event unread-command-events)))
-         (setq draggable nil))
-        ((or (not (eq (car position) frame))
-             (null (car (cdr position))))
+         (setq finished t))
+        ((not (and (eq (car position) frame)
+                   (cadr position)))
          nil)
         ((eq line 'vertical)
          ;; Drag vertical divider.