Agreed. Though, unless I am mistaken, it appears to me that the
virtual-glyph calculations performed during mouse moves over the
tab-bar, do indirectly affect the calculations during a mouse click.
I copied below a little sketch of how the situation appeared to me
while I was debugging the issue. During a mouse move, the A.1.1
predicate is referencing the virtual-glyph, fixed glyph size, calculation
from FRAME_DISPLAY_INFO's `last_mouse_glyph' done in A.1.1.2.1
and as thus it might not trigger A.1.1.1.1.1 to update MOUSE_HL_INFO when
the mouse moves to a different variable-sized glyph. The MOUSE_HL_INFO
value is later used during a mouse click in B.1.1.1 which, as a
consequence, might miss the tab activation (i.e. B.1.1.1.1 compares
the column returned from src/xdisp.c:x_y_to_hpos_vpos against a
potentially stale MOUSE_HL_INFO's mouse face beg/end col range):
A. src/w32term.c:w32_read_socket / (`WM_MOUSEMOVE' event)
1. src/w32term.c:w32_note_mouse_movement
1. Determine whether "Has the mouse moved off the glyph it was
on at the last sighting?" by checking if the MOUSE_X and
MOUSE_Y position fall outside the `RECT' of
src/frame.h:FRAME_DISPLAY_INFO's `last_mouse_glyph'. If so
1. src/xdisp.c:note_mouse_highlight
1. src/xdisp.c:note_tab_bar_highlight
1. sets src/frame.h:MOUSE_HL_INFO's
1. `mouse_face_beg_col' to the glyph column under the mouse
2. `mouse_face_end_col' to the next glyph column under the mouse
2. Set src/w32term.h:FRAME_DISPLAY_INFO's `last_mouse_glyph'
to the `RECT' that the glyph under the cursor occupies, by
calling src/xdisp.c:remember_mouse_glyph:
1. When it is over the tab-bar, it currently uses the
`virtual_glyph' method to set RECT, which assumes all
glyphs on the tab-bar row have a fixed width (sourced
from src/frame.h:FRAME_SMALLEST_CHAR_WIDTH).
B. src/w32term.c:w32_read_socket / WM_*BUTTON* event
1. src/w32term.c:w32_handle_tab_bar_click
1. src/xdispl.c:handle_tab_bar_click
1. src/xdispl.c:get_tab_bar_item
1. Returns whether the mouse's X/Y is on the same item that
was highlighted before. It does that by comparing, among
other things, whether the column position HPOS returned by
src/xdisp.c:x_y_to_hpos_vpos falls in the
src/frame.h:MOUSE_HL_INFO's mouse face beg and end col range.
2. if the above function indicates that the mouse cursor is
on the same item that was highlighted before, then it
activates the tab.