mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
apprt: plumb through scroll mods to core, don't handle them yet
This commit is contained in:
@ -1268,7 +1268,14 @@ pub fn refreshCallback(self: *Surface) !void {
|
||||
try self.queueRender();
|
||||
}
|
||||
|
||||
pub fn scrollCallback(self: *Surface, xoff: f64, yoff: f64) !void {
|
||||
pub fn scrollCallback(
|
||||
self: *Surface,
|
||||
xoff: f64,
|
||||
yoff: f64,
|
||||
scroll_mods: input.ScrollMods,
|
||||
) !void {
|
||||
_ = scroll_mods;
|
||||
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
|
@ -299,8 +299,13 @@ pub const Surface = struct {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn scrollCallback(self: *Surface, xoff: f64, yoff: f64) void {
|
||||
self.core_surface.scrollCallback(xoff, yoff) catch |err| {
|
||||
pub fn scrollCallback(
|
||||
self: *Surface,
|
||||
xoff: f64,
|
||||
yoff: f64,
|
||||
mods: input.ScrollMods,
|
||||
) void {
|
||||
self.core_surface.scrollCallback(xoff, yoff, mods) catch |err| {
|
||||
log.err("error in scroll callback err={}", .{err});
|
||||
return;
|
||||
};
|
||||
@ -508,8 +513,11 @@ pub const CAPI = struct {
|
||||
y: f64,
|
||||
scroll_mods: c_int,
|
||||
) void {
|
||||
_ = scroll_mods;
|
||||
surface.scrollCallback(x, y);
|
||||
surface.scrollCallback(
|
||||
x,
|
||||
y,
|
||||
@bitCast(input.ScrollMods, @truncate(u8, @bitCast(c_uint, scroll_mods))),
|
||||
);
|
||||
}
|
||||
|
||||
export fn ghostty_surface_ime_point(surface: *Surface, x: *f64, y: *f64) void {
|
||||
|
@ -731,8 +731,11 @@ pub const Surface = struct {
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
// Glfw doesn't support any of the scroll mods.
|
||||
const scroll_mods: input.ScrollMods = .{};
|
||||
|
||||
const core_win = window.getUserPointer(CoreSurface) orelse return;
|
||||
core_win.scrollCallback(xoff, yoff) catch |err| {
|
||||
core_win.scrollCallback(xoff, yoff, scroll_mods) catch |err| {
|
||||
log.err("error in scroll callback err={}", .{err});
|
||||
return;
|
||||
};
|
||||
|
@ -1049,7 +1049,11 @@ pub const Surface = struct {
|
||||
ud: ?*anyopaque,
|
||||
) callconv(.C) void {
|
||||
const self = userdataSelf(ud.?);
|
||||
self.core_surface.scrollCallback(x, y * -1) catch |err| {
|
||||
|
||||
// GTK doesn't support any of the scroll mods.
|
||||
const scroll_mods: input.ScrollMods = .{};
|
||||
|
||||
self.core_surface.scrollCallback(x, y * -1, scroll_mods) catch |err| {
|
||||
log.err("error in scroll callback err={}", .{err});
|
||||
return;
|
||||
};
|
||||
|
Reference in New Issue
Block a user