Skip to content

Commit

Permalink
Debug: disable scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
ziulev committed Nov 16, 2022
1 parent ac79069 commit da03f94
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,20 @@ static void my_application_activate(GApplication* application) {
// gtk_window_set_title(window, "spotter");
// }

int dpiValue;
GtkSettings *settings;
settings = gtk_settings_get_default();
g_object_get(settings, "gtk-xft-dpi", &dpiValue, NULL);
int dpi = dpiValue / 1024;
float scale = static_cast<float>(dpi) / 100;
// HIDPI scaling
// int dpiValue;
// GtkSettings *settings;
// settings = gtk_settings_get_default();
// g_object_get(settings, "gtk-xft-dpi", &dpiValue, NULL);
// int dpi = dpiValue / 1024;
// float scale = static_cast<float>(dpi) / 100;

g_print("Scale is %f\n", scale);
// g_print("Scale is %f\n", scale);

gtk_window_set_default_size(window, 800 * scale, 450 * scale);
gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
// gtk_window_set_default_size(window, 800 * scale, 450 * scale);
// gtk_window_set_resizable(GTK_WINDOW(window), FALSE);

gtk_window_set_default_size(window, 800, 450);

// Move to center
gtk_window_set_modal(window, TRUE);
Expand Down

0 comments on commit da03f94

Please sign in to comment.