summaryrefslogtreecommitdiff
path: root/lisp/xt-mouse.el
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2005-01-14 07:36:50 +0000
committerNick Roberts <nickrob@snap.net.nz>2005-01-14 07:36:50 +0000
commitfcd9df1bf09a63ee2c7b39966f360e37d557fb71 (patch)
treea3a32e30228544b6929236f201239b9e1711b1b2 /lisp/xt-mouse.el
parent5ca75c83ef58d012acef2a4bea01281cc5c0fa89 (diff)
downloademacs-fcd9df1bf09a63ee2c7b39966f360e37d557fb71.tar.gz
(xterm-mouse-event): Compute window co-ordinates
more carefully.
Diffstat (limited to 'lisp/xt-mouse.el')
-rw-r--r--lisp/xt-mouse.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index de93456ad5a..5709834ab91 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -138,15 +138,17 @@
(t
(setq xterm-mouse-last type)
(format "down-mouse-%d" (+ 1 type))))))
- (w (window-at x y)))
+ (w (window-at x y))
+ (ltrb (window-edges w))
+ (left (nth 0 ltrb))
+ (top (nth 1 ltrb)))
+
(setq xterm-mouse-x x
xterm-mouse-y y)
(if w
- (list mouse (posn-at-x-y x (if menu-bar-mode (- y 1) y) w))
+ (list mouse (posn-at-x-y (- x left) (- y top) w))
(list mouse
- (append (list nil 'menu-bar)
- (nthcdr 2 (posn-at-x-y
- x (if menu-bar-mode (- y 1) y) w)))))))
+ (append (list nil 'menu-bar) (nthcdr 2 (posn-at-x-y x y w)))))))
;;;###autoload
(define-minor-mode xterm-mouse-mode