I finally got back to looking at the redisplay issue that I found around
New Year's. I'm still seeing weird behavior if I have multiple windows
in a frame and I try to drag a modeline--the modeline doesn't track the
mouse location like I expect.
I added some instrumentation to mouse-drag-modeline, and it appeared
that the Y pixel coordinate for the events was always larger than I
expected. So I wrote this function, which confirmed that the Y pixel
coordinate was roughly 20 pixels (a little more than one row) larger
than I expected.
(defun mdk-event-test ()
"Manual test for reporting events.
To use, invoke this function, then click and hold. Events will be
reported until the button is released."
(interactive)
(let (event run report type x y xcol yrow)
(setq run t)
(setq report nil)
(while run
(setq event (next-event event))
(if (button-release-event-p event)
(setq run nil))
(if (button-press-event-p event)
(setq report t))
(when report
(setq type (event-type event))
(cond ((eq type 'magic)
(message "magic"))
((mouse-event-p event)
(setq x (event-x-pixel event))
(setq y (event-y-pixel event))
(setq xcol (event-x event))
(setq yrow (event-y event))
(message "%s %d %d (%d %d)"
type x y xcol yrow))
(t (message "unknown")))))))
Further investigation showed that this depended on whether the buffer
tabs were being displayed at the top of the frame. If they were, the Y
value was larger than expected. If the buffer tab wasn't visible, the Y
value was what I'd expect.
This is not something I introduced: I get the same behavior on a binary
that doesn't include my redisplay hacks.
The mouse-drag-modeline function compares the mouse's Y location--as
reported by event-y-pixel--with the bottom of the window--as reported by
window-pixel-edges. window-pixel-edges excludes the top gutter (as
documented), while event-y-pixel includes the top gutter.
So... what's the right fix here? Does mouse-drag-modeline need to
account for whether there's a top gutter visible? (If yes, how?)
Should event-y-pixel be changed to exclude gutters, for a better
impedance match to window-pixel-edges? Or should there be a new set of
event functions that return pixel locations, excluding gutters?
mike
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta