From b2e8b04d2638cba9558b09fa933383a581a379bc Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Sun, 26 Nov 2023 14:32:44 +0100 Subject: [PATCH] Fix GTK4 deprecations in main.c --- src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 9353603..4c26ce3 100644 --- a/src/main.c +++ b/src/main.c @@ -360,9 +360,9 @@ position_preview(float *offset_x, float *offset_y, float *size_x, float *size_y) int scale_factor = gtk_widget_get_scale_factor(preview); int top_height = - gtk_widget_get_allocated_height(preview_top_box) * scale_factor; + gtk_widget_get_height(preview_top_box) * scale_factor; int bottom_height = - gtk_widget_get_allocated_height(preview_bottom_box) * scale_factor; + gtk_widget_get_height(preview_bottom_box) * scale_factor; int inner_height = state.preview_height - top_height - bottom_height; float scale = (float)MIN(state.preview_width / (float)buffer_width, @@ -595,7 +595,7 @@ run_quit_action(GSimpleAction *action, GVariant *param, GApplication *app) } static bool -check_point_inside_bounds(int x, int y, int *bounds_x, int *bounds_y) +check_point_inside_bounds(int x, int y, const int *bounds_x, const int *bounds_y) { bool right = false, left = false, top = false, bottom = false; @@ -679,7 +679,7 @@ on_zbar_code_tapped(GtkWidget *widget, const MPZBarCode *code) g_signal_connect( dialog, "response", G_CALLBACK(on_zbar_dialog_response), data); - gtk_widget_show(GTK_WIDGET(dialog)); + gtk_widget_set_visible(GTK_WIDGET(dialog), true); } static void @@ -1322,7 +1322,7 @@ activate(GtkApplication *app, gpointer data) mp_io_pipeline_start(); gtk_application_add_window(app, GTK_WINDOW(window)); - gtk_widget_show(window); + gtk_widget_set_visible(window, true); } static void