From ab157df65dce2b075b0119db3e3d490a6ca9a44f Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 9 May 2023 18:58:16 +0000 Subject: [PATCH] tools/mks: Cosmetic changes - Prefer dark style: per the HIG recommendations - Sets a slightly bigger default size --- tools/mks.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/mks.c b/tools/mks.c index feda9b4..4b30fb6 100644 --- a/tools/mks.c +++ b/tools/mks.c @@ -33,7 +33,7 @@ create_connection (int argc, if (argc < 2) return g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error); else - return g_dbus_connection_new_for_address_sync (argv[1], 0, NULL, NULL, error); + return g_dbus_connection_new_for_address_sync (argv[1], G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, NULL, NULL, error); } static gboolean @@ -65,6 +65,7 @@ main (int argc, g_autoptr(GError) error = NULL; GtkWindow *window; GtkWidget *display; + GtkSettings *settings; GdkSurface *surface; gtk_init (); @@ -79,10 +80,15 @@ main (int argc, main_loop = g_main_loop_new (NULL, FALSE); window = g_object_new (GTK_TYPE_WINDOW, - "default-width", 640, - "default-height", 480, + "default-width", 1280, + "default-height", 768, "title", "Mouse, Keyboard, Screen", NULL); + + settings = gtk_settings_get_default (); + g_object_set (settings, "gtk-application-prefer-dark-theme", TRUE, NULL); + gtk_widget_add_css_class (GTK_WIDGET (window), "dark"); + display = mks_display_new (); gtk_window_set_child (window, display); g_signal_connect_swapped (window,