mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-05 15:18:40 +00:00
gtk: forward middle click to TUIs with mouse reporting
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user