gtk: forward middle click to TUIs with mouse reporting

This commit is contained in:
AJ Khullar
2026-06-28 12:37:08 +08:00
parent fdbf9ff3a3
commit 488b7109bb
2 changed files with 14 additions and 2 deletions

View File

@@ -3642,6 +3642,12 @@ fn isMouseReporting(self: *const Surface) bool {
self.io.terminal.flags.mouse_event != .none;
}
pub fn mouseReportingActive(self: *Surface) bool {
self.renderer_state.mutex.lock();
defer self.renderer_state.mutex.unlock();
return self.isMouseReporting();
}
fn mouseReport(
self: *Surface,
button: ?input.MouseButton,

View File

@@ -2815,7 +2815,10 @@ pub const Surface = extern struct {
return;
}
if (button == .middle and !priv.gtk_enable_primary_paste) {
if (button == .middle and
!priv.gtk_enable_primary_paste and
!core_surface.mouseReportingActive())
{
return;
}
@@ -2875,7 +2878,10 @@ pub const Surface = extern struct {
return;
}
if (button == .middle and !priv.gtk_enable_primary_paste) {
if (button == .middle and
!priv.gtk_enable_primary_paste and
!surface.mouseReportingActive())
{
return;
}