File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
frontends/rioterm/src/layout Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1094,7 +1094,18 @@ impl<T: rio_backend::event::EventListener> ContextGrid<T> {
10941094 }
10951095
10961096 if let Some ( current_item) = self . inner . get ( & self . current ) {
1097- ( & current_item. val , self . scaled_margin )
1097+ // For multi-panel layouts, the margin must include the panel's
1098+ // absolute offset so that mouse coordinates (which are relative
1099+ // to the window) are correctly translated to panel-local grid
1100+ // positions.
1101+ let [ abs_x, abs_y, _, _] = current_item. layout_rect ;
1102+ let margin = Margin {
1103+ left : self . scaled_margin . left + abs_x,
1104+ top : self . scaled_margin . top + abs_y,
1105+ right : self . scaled_margin . right ,
1106+ bottom : self . scaled_margin . bottom ,
1107+ } ;
1108+ ( & current_item. val , margin)
10981109 } else {
10991110 tracing:: error!( "Current key {:?} not found in grid" , self . current) ;
11001111 if let Some ( root) = self . root {
You can’t perform that action at this time.
0 commit comments