Fix: full-window overlay for title bar hover in Splits layout

This commit is contained in:
mcrmck
2026-03-20 01:16:59 -04:00
parent 2c81a69aad
commit 2bf4da9724

View File

@@ -1919,20 +1919,29 @@ class TabManager: # {{{
self._set_drag_target_tab(0) self._set_drag_target_tab(0)
dest_window = self._find_window_at(x, y) dest_window = self._find_window_at(x, y)
if dest_window and dest_window.id != window_id: if dest_window and dest_window.id != window_id:
quadrant = 5 from .fast_data_types import viewport_for_window as _vfw
active_tab = self.active_tab central = _vfw(self.os_window_id)[0]
if active_tab is not None and hasattr(active_tab.current_layout, 'insert_window_next_to'): rel_x = x - central.left
from .fast_data_types import viewport_for_window as _vfw rel_y = y - central.top
central = _vfw(self.os_window_id)[0] in_title_bar = False
rel_x = x - central.left if dest_window.show_title_bar:
rel_y = y - central.top from .fast_data_types import cell_size_for_window
_, ch = cell_size_for_window(self.os_window_id)
g = dest_window.geometry g = dest_window.geometry
dx = rel_x - (g.left + g.right) / 2 opts = get_options()
dy = rel_y - (g.top + g.bottom) / 2 tb_top = g.top if opts.window_title_bar == 'top' else g.bottom - ch
quad_map = {'left': 1, 'right': 2, 'top': 3, 'bottom': 4} in_title_bar = tb_top <= rel_y < tb_top + ch
direction = ('right' if dx > 0 else 'left') if abs(dx) >= abs(dy) else ('bottom' if dy > 0 else 'top') if not in_title_bar:
quadrant = quad_map[direction] active_tab = self.active_tab
self._set_drag_target_window(dest_window.id, quadrant) if active_tab is not None and hasattr(active_tab.current_layout, 'insert_window_next_to'):
g = dest_window.geometry
dx = rel_x - (g.left + g.right) / 2
dy = rel_y - (g.top + g.bottom) / 2
quad_map = {'left': 1, 'right': 2, 'top': 3, 'bottom': 4}
direction = ('right' if dx > 0 else 'left') if abs(dx) >= abs(dy) else ('bottom' if dy > 0 else 'top')
self._set_drag_target_window(dest_window.id, quad_map[direction])
return
self._set_drag_target_window(dest_window.id, 5)
else: else:
self._set_drag_target_window(0) self._set_drag_target_window(0)