summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-09-14 17:20:21 -0700
committerGlenn Morris <rgm@gnu.org>2014-09-14 17:20:21 -0700
commit11af46027d22daa11d0df7d5032e6925c990dad1 (patch)
tree4d0d528afaf7449dba3cb73af0745980306c57d0 /lisp/mouse.el
parent5ce52d05c93e0c006bbd145b938aa9fab7dfcb8d (diff)
parentd4dc0e1691a15efd1ea0a8793cf889e683a37933 (diff)
downloademacs-11af46027d22daa11d0df7d5032e6925c990dad1.tar.gz
Merge from emacs-24; up to 2014-07-09T02:04:12Z!rgm@gnu.org
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index a10f4d67593..93bd6283158 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -396,7 +396,16 @@ must be one of the symbols `header', `mode', or `vertical'."
;; Check whether header-line can be dragged at all.
(if (window-at-side-p window 'top)
(setq draggable nil)
- (setq height (/ (window-header-line-height window) 2))
+ ;; window-pixel-edges includes the header and mode lines, so
+ ;; we need to account for that when calculating window growth.
+ ;; On GUI frames, assume the mouse is approximately in the
+ ;; middle of the header/mode line, so we need only half the
+ ;; height in pixels.
+ (setq height
+ (cond
+ ((display-graphic-p frame)
+ (/ (window-header-line-height window) 2))
+ (t (window-header-line-height window))))
(setq window (window-in-direction 'above window t))))
((eq line 'mode)
;; Check whether mode-line can be dragged at all.
@@ -411,7 +420,11 @@ must be one of the symbols `header', `mode', or `vertical'."
(eq minibuffer-window
(active-minibuffer-window))))))
(setq draggable nil)
- (setq height (/ (window-mode-line-height window) 2))))
+ (setq height
+ (cond
+ ((display-graphic-p frame)
+ (/ (window-mode-line-height window) 2))
+ (t (window-mode-line-height window))))))
((eq line 'vertical)
;; Get the window to adjust for the vertical case. If the scroll
;; bar is on the window's right or we drag a vertical divider,