mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
apprt/gtk: add more debug logs about scale factors
This commit is contained in:
@ -739,10 +739,29 @@ pub const Surface = struct {
|
||||
|
||||
/// render singal
|
||||
fn gtkResize(area: *c.GtkGLArea, width: c.gint, height: c.gint, ud: ?*anyopaque) callconv(.C) void {
|
||||
_ = area;
|
||||
log.debug("gl resize {} {}", .{ width, height });
|
||||
|
||||
const self = userdataSelf(ud.?);
|
||||
|
||||
// Some debug output to help understand what GTK is telling us.
|
||||
{
|
||||
const scale_factor = scale: {
|
||||
const widget = @ptrCast(*c.GtkWidget, area);
|
||||
break :scale c.gtk_widget_get_scale_factor(widget);
|
||||
};
|
||||
|
||||
const window_scale_factor = scale: {
|
||||
const window = @ptrCast(*c.GtkNative, self.window.window);
|
||||
const gdk_surface = c.gtk_native_get_surface(window);
|
||||
break :scale c.gdk_surface_get_scale_factor(gdk_surface);
|
||||
};
|
||||
|
||||
log.debug("gl resize width={} height={} scale={} window_scale={}", .{
|
||||
width,
|
||||
height,
|
||||
scale_factor,
|
||||
window_scale_factor,
|
||||
});
|
||||
}
|
||||
|
||||
self.size = .{
|
||||
.width = @intCast(u32, width),
|
||||
.height = @intCast(u32, height),
|
||||
|
Reference in New Issue
Block a user