This three-line patch fixes all problems with `window-at' and `coordinates-in-window-p', and as far as I can see it does not affect any other part of Emacs. Yet another way to fix the problem would be to change the window-edges family of functions to return ugly floats instead of nice round integers, but on the Lisp level I think it's better to have the frame's origin inside the frame's border. I like the above patch the most. > A patch that Richard sent me and that does this for `window-at' > strangely enough seems to fail by making `window-at' return nil > everywhere: This is strange, as the two patches look to be equivalent. > *** window.c 20 Jul 2004 16:52:30 -0400 1.471 > --- window.c 23 Jul 2004 20:05:29 -0400 > *************** > *** 937,944 **** > CHECK_NUMBER_OR_FLOAT (y); > > return window_from_coordinates (f, > ! FRAME_PIXEL_X_FROM_CANON_X (f, x), > ! FRAME_PIXEL_Y_FROM_CANON_Y (f, y), > 0, 0, 0, 0); > } > > --- 937,946 ---- > CHECK_NUMBER_OR_FLOAT (y); > > return window_from_coordinates (f, > ! (FRAME_PIXEL_X_FROM_CANON_X (f, x) > ! + FRAME_INTERNAL_BORDER_WIDTH (f)), > ! (FRAME_PIXEL_Y_FROM_CANON_Y (f, y) > ! + FRAME_INTERNAL_BORDER_WIDTH (f)), > 0, 0, 0, 0); > } -- Károly