mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-06 18:06:33 +00:00
Use Surface.hasSelection()
This commit is contained in:
@@ -2152,13 +2152,7 @@ pub fn mouseButtonCallback(
|
|||||||
// Checking for selection requires the renderer state mutex which
|
// Checking for selection requires the renderer state mutex which
|
||||||
// sucks but this should be pretty rare of an event so it won't
|
// sucks but this should be pretty rare of an event so it won't
|
||||||
// cause a ton of contention.
|
// cause a ton of contention.
|
||||||
const selection = selection: {
|
if (self.hasSelection()) {
|
||||||
self.renderer_state.mutex.lock();
|
|
||||||
defer self.renderer_state.mutex.unlock();
|
|
||||||
break :selection self.io.terminal.screen.selection != null;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (selection) {
|
|
||||||
const pos = try self.rt_surface.getCursorPos();
|
const pos = try self.rt_surface.getCursorPos();
|
||||||
try self.cursorPosCallback(pos);
|
try self.cursorPosCallback(pos);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user