# HG changeset patch # User Nick Roberts # Date 1105688210 0 # Node ID 0b4694a3c513104556061f7cbe5fb0f5f5fb2956 # Parent b086012fa08769c2efaacd973a9e94e79f54d83b (xterm-mouse-event): Compute window co-ordinates more carefully. diff -r b086012fa087 -r 0b4694a3c513 lisp/xt-mouse.el --- a/lisp/xt-mouse.el Fri Jan 14 07:35:58 2005 +0000 +++ b/lisp/xt-mouse.el Fri Jan 14 07:36:50 2005 +0000 @@ -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