Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 8 additions & 2 deletions src/apprt/gtk/class/surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
Loading