From 7a9be5d2a6a3a996f8e3738d3a8b1081dece843e Mon Sep 17 00:00:00 2001 From: Jeremy Attali Date: Tue, 16 Jun 2020 22:35:25 -0400 Subject: [PATCH] refactor(application): remove scaling logic --- include/swappy.h | 2 -- src/application.c | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/swappy.h b/include/swappy.h index 91a20a5..df69171 100644 --- a/include/swappy.h +++ b/include/swappy.h @@ -214,8 +214,6 @@ struct swappy_state { cairo_rectangle_int_t *drawing_area_rect; - gint scaling_factor; - GList *paints; GList *redo_paints; struct swappy_paint *temp_paint; diff --git a/src/application.c b/src/application.c index e7b7a37..bcdaf2e 100644 --- a/src/application.c +++ b/src/application.c @@ -545,14 +545,11 @@ static void compute_window_size(struct swappy_state *state) { GdkDisplay *display = gdk_display_get_default(); GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(state->ui->window)); GdkMonitor *monitor = gdk_display_get_monitor_at_window(display, window); - gint scaling_factor = gdk_window_get_scale_factor(window); gdk_monitor_get_workarea(monitor, &workarea); - g_info("scale_factor: %d", scaling_factor); - g_info("size of monitor at window: %ux%u", workarea.width, workarea.height); + g_assert(workarea.width > 0); g_assert(workarea.height > 0); - state->scaling_factor = scaling_factor; state->window = g_new(struct swappy_box, 1); state->window->x = workarea.x; state->window->y = workarea.y; @@ -569,6 +566,7 @@ static void compute_window_size(struct swappy_state *state) { state->window->width = state->geometry->width * scaling; state->window->height = state->geometry->height * scaling; + g_info("size of monitor at window: %ux%u", workarea.width, workarea.height); g_info("size of window to render: %ux%u", state->window->width, state->window->height); }