Luc Teirlinck writes: > After taking a closer look at your patch, I guess one would have to be > careful that there are no functions calling the functions you changed > that _already_ adjust for FRAME_INTERNAL_BORDER_WIDTH, in which case > they will double-adjust after the patch. I did not find any, but I > have not looked that carefully. I did a grep in the source tree, and it seems these macros are not used anywhere else in Emacs, except for one small reference in Fwindow_vscroll: FRAME_PIXEL_X_FROM_CANON_X: src/window.c:788: Fcoordinates_in_window_p src/window.c:943: Fwindow_at FRAME_PIXEL_Y_FROM_CANON_Y: src/window.c:789: Fcoordinates_in_window_p src/window.c:944: Fwindow_at FRAME_CANON_X_FROM_PIXEL_X: src/window.c:799: Fcoordinates_in_window_p FRAME_CANON_Y_FROM_PIXEL_Y: src/window.c:800: Fcoordinates_in_window_p src/window.c:6167: Fwindow_vscroll Unfortunately, `window-vscroll' doesn't like my patch: (set-frame-parameter nil 'internal-border-width 20) (set-window-vscroll nil 0.2) ==> -1.13, should be around 0.2 (window-vscroll) ==> -1.13, should be around 0.2 > I guess an alternative would be to make the adjustment inside > `window-at' and `coordinates-in-window-p'. I think it's easier to adjust the pixel coordinates right inside coordinates_in_window_p, which both functions use: