mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
fix miscompilation around sgr mode
This commit is contained in:
@ -907,6 +907,9 @@ fn mouseReport(
|
|||||||
},
|
},
|
||||||
|
|
||||||
.sgr => {
|
.sgr => {
|
||||||
|
// Final character to send in the CSI
|
||||||
|
const final: u8 = if (action == .release) 'm' else 'M';
|
||||||
|
|
||||||
// Response always is at least 4 chars, so this leaves the
|
// Response always is at least 4 chars, so this leaves the
|
||||||
// remainder for numbers which are very large...
|
// remainder for numbers which are very large...
|
||||||
var buf: [32]u8 = undefined;
|
var buf: [32]u8 = undefined;
|
||||||
@ -914,7 +917,7 @@ fn mouseReport(
|
|||||||
button_code,
|
button_code,
|
||||||
viewport_point.x + 1,
|
viewport_point.x + 1,
|
||||||
viewport_point.y + 1,
|
viewport_point.y + 1,
|
||||||
@as(u8, if (action == .release) 'm' else 'M'),
|
final,
|
||||||
});
|
});
|
||||||
|
|
||||||
try self.queueWrite(resp);
|
try self.queueWrite(resp);
|
||||||
@ -934,6 +937,9 @@ fn mouseReport(
|
|||||||
},
|
},
|
||||||
|
|
||||||
.sgr_pixels => {
|
.sgr_pixels => {
|
||||||
|
// Final character to send in the CSI
|
||||||
|
const final: u8 = if (action == .release) 'm' else 'M';
|
||||||
|
|
||||||
// Response always is at least 4 chars, so this leaves the
|
// Response always is at least 4 chars, so this leaves the
|
||||||
// remainder for numbers which are very large...
|
// remainder for numbers which are very large...
|
||||||
var buf: [32]u8 = undefined;
|
var buf: [32]u8 = undefined;
|
||||||
@ -941,7 +947,7 @@ fn mouseReport(
|
|||||||
button_code,
|
button_code,
|
||||||
pos.xpos,
|
pos.xpos,
|
||||||
pos.ypos,
|
pos.ypos,
|
||||||
@as(u8, if (action == .release) 'm' else 'M'),
|
final,
|
||||||
});
|
});
|
||||||
|
|
||||||
try self.queueWrite(resp);
|
try self.queueWrite(resp);
|
||||||
@ -1040,9 +1046,7 @@ fn cursorPosCallback(
|
|||||||
const win = window.getUserPointer(Window) orelse return;
|
const win = window.getUserPointer(Window) orelse return;
|
||||||
|
|
||||||
// Do a mouse report
|
// Do a mouse report
|
||||||
if (win.terminal.modes.mouse_event == .button or
|
if (win.terminal.modes.mouse_event != .none) {
|
||||||
win.terminal.modes.mouse_event == .any)
|
|
||||||
{
|
|
||||||
// We use the first mouse button we find pressed in order to report
|
// We use the first mouse button we find pressed in order to report
|
||||||
// since the spec (afaict) does not say...
|
// since the spec (afaict) does not say...
|
||||||
const button: ?input.MouseButton = button: for (win.mouse.click_state) |state, i| {
|
const button: ?input.MouseButton = button: for (win.mouse.click_state) |state, i| {
|
||||||
|
Reference in New Issue
Block a user