summaryrefslogtreecommitdiff
path: root/rcm-client-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'rcm-client-main.c')
-rw-r--r--rcm-client-main.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/rcm-client-main.c b/rcm-client-main.c
index f6d8e70..1467f16 100644
--- a/rcm-client-main.c
+++ b/rcm-client-main.c
@@ -138,51 +138,38 @@ manager_ready_cb(GObject *source, GAsyncResult *res, gpointer user_data)
}
-int main (int argc, char *argv[])
+int main(int argc, char *argv[])
{
- GdkDisplay *display;
- GdkScreen *screen;
- GtkWidget *win;
- gint monitor;
- GdkRectangle rect;
GtkCssProvider *css;
+ GdkScreen *screen;
global = g_malloc(sizeof(*global));
gtk_init (&argc, &argv);
- display = gdk_display_get_default();
- screen = gdk_display_get_default_screen(display);
-
css = gtk_css_provider_new();
gtk_css_provider_load_from_path(css, "rcm.css", NULL);
+ screen = gdk_display_get_default_screen(gdk_display_get_default());
gtk_style_context_add_provider_for_screen(screen, GTK_STYLE_PROVIDER(css), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref(css);
global->builder = gtk_builder_new_from_file("rcm-client.ui");
- object_manager_client_new_for_bus(G_BUS_TYPE_SESSION,
- G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
- "org.gnome.RemoteControlManager",
- "/org/gnome/RemoteControlManager",
- NULL, manager_ready_cb, NULL);
-
- win = GTK_WIDGET(gtk_builder_get_object(global->builder, "main_window"));
- global->window = GTK_WINDOW(win);
- g_signal_connect(win, "destroy", G_CALLBACK (gtk_main_quit), NULL);
-
- monitor = gdk_screen_get_monitor_at_point(screen, 0, 0);
- gdk_screen_get_monitor_geometry(screen, monitor, &rect);
- gtk_window_set_default_size(global->window,
- rect.width * 4 / 5,
- rect.height * 1 / 2);
+ global->window = GTK_WINDOW(gtk_builder_get_object(global->builder, "main_window"));
+ g_signal_connect(global->window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
global->header = GTK_HEADER_BAR(gtk_builder_get_object(global->builder, "headerbar"));
gtk_header_bar_set_show_close_button(global->header, TRUE);
global->stack = GTK_STACK(gtk_builder_get_object(global->builder, "main_stack"));
- gtk_widget_show_all(win);
+ gtk_widget_show_all(GTK_WIDGET(global->window));
+
+ object_manager_client_new_for_bus(G_BUS_TYPE_SESSION,
+ G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
+ "org.gnome.RemoteControlManager",
+ "/org/gnome/RemoteControlManager",
+ NULL, manager_ready_cb, NULL);
gtk_main();