mirror of
https://github.com/jtheoof/swappy.git
synced 2024-10-26 15:44:47 +03:00
refactor(application): remove scaling logic
This commit is contained in:
parent
ad564ebc33
commit
7a9be5d2a6
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user