mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
mouse: set mouse as text only when not reporting mouse events
The selection mode is only valid when mouse reporting events are on. If we have any mouse reporting events turned on, reset the mouse shape back to default (a pointer).
This commit is contained in:

committed by
Mitchell Hashimoto

parent
49fb5c8688
commit
c96cedcf22
@ -1698,10 +1698,42 @@ const StreamHandler = struct {
|
|||||||
self.messageWriter(.{ .linefeed_mode = enabled });
|
self.messageWriter(.{ .linefeed_mode = enabled });
|
||||||
},
|
},
|
||||||
|
|
||||||
.mouse_event_x10 => self.terminal.flags.mouse_event = if (enabled) .x10 else .none,
|
.mouse_event_x10 => {
|
||||||
.mouse_event_normal => self.terminal.flags.mouse_event = if (enabled) .normal else .none,
|
if (enabled) {
|
||||||
.mouse_event_button => self.terminal.flags.mouse_event = if (enabled) .button else .none,
|
self.terminal.flags.mouse_event = .x10;
|
||||||
.mouse_event_any => self.terminal.flags.mouse_event = if (enabled) .any else .none,
|
try self.setMouseShape(.default);
|
||||||
|
} else {
|
||||||
|
self.terminal.flags.mouse_event = .none;
|
||||||
|
try self.setMouseShape(.text);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.mouse_event_normal => {
|
||||||
|
if (enabled) {
|
||||||
|
self.terminal.flags.mouse_event = .normal;
|
||||||
|
try self.setMouseShape(.default);
|
||||||
|
} else {
|
||||||
|
self.terminal.flags.mouse_event = .none;
|
||||||
|
try self.setMouseShape(.text);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.mouse_event_button => {
|
||||||
|
if (enabled) {
|
||||||
|
self.terminal.flags.mouse_event = .button;
|
||||||
|
try self.setMouseShape(.default);
|
||||||
|
} else {
|
||||||
|
self.terminal.flags.mouse_event = .none;
|
||||||
|
try self.setMouseShape(.text);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.mouse_event_any => {
|
||||||
|
if (enabled) {
|
||||||
|
self.terminal.flags.mouse_event = .any;
|
||||||
|
try self.setMouseShape(.default);
|
||||||
|
} else {
|
||||||
|
self.terminal.flags.mouse_event = .none;
|
||||||
|
try self.setMouseShape(.text);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
.mouse_format_utf8 => self.terminal.flags.mouse_format = if (enabled) .utf8 else .x10,
|
.mouse_format_utf8 => self.terminal.flags.mouse_format = if (enabled) .utf8 else .x10,
|
||||||
.mouse_format_sgr => self.terminal.flags.mouse_format = if (enabled) .sgr else .x10,
|
.mouse_format_sgr => self.terminal.flags.mouse_format = if (enabled) .sgr else .x10,
|
||||||
|
Reference in New Issue
Block a user