Browse Source

Call gtk_init as early as possible to avoid drawing failures under certain circumstances. Closes #11

sisyphus
Dustin Falgout 9 years ago
parent
commit
a09e5cc319
  1. 13
      src/lightdm-webkit2-greeter.c

13
src/lightdm-webkit2-greeter.c

@ -108,17 +108,16 @@ main(int argc, char **argv) {
gchar *theme; gchar *theme;
GdkRGBA bg_color; GdkRGBA bg_color;
gtk_init(&argc, &argv);
signal(SIGTERM, sigterm_cb);
WebKitWebContext *context = webkit_web_context_get_default(); WebKitWebContext *context = webkit_web_context_get_default();
g_signal_connect(context, g_signal_connect(context,
"initialize-web-extensions", "initialize-web-extensions",
G_CALLBACK(initialize_web_extensions_cb), G_CALLBACK(initialize_web_extensions_cb),
NULL); NULL);
signal(SIGTERM, sigterm_cb);
gtk_init(&argc, &argv);
gdk_window_set_cursor(gdk_get_default_root_window(), gdk_window_set_cursor(gdk_get_default_root_window(),
gdk_cursor_new_for_display(gdk_display_get_default(), GDK_LEFT_PTR)); gdk_cursor_new_for_display(gdk_display_get_default(), GDK_LEFT_PTR));
@ -133,8 +132,6 @@ main(int argc, char **argv) {
gtk_window_set_decorated(GTK_WINDOW(window), FALSE); gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
gdk_screen_get_monitor_geometry(screen, gdk_screen_get_primary_monitor(screen), &geometry); gdk_screen_get_monitor_geometry(screen, gdk_screen_get_primary_monitor(screen), &geometry);
gtk_window_set_default_size(GTK_WINDOW(window), geometry.width, geometry.height); gtk_window_set_default_size(GTK_WINDOW(window), geometry.width, geometry.height);
gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y); gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y);
@ -142,10 +139,8 @@ main(int argc, char **argv) {
web_view = webkit_web_view_new_with_settings(webkit_settings); web_view = webkit_web_view_new_with_settings(webkit_settings);
gdk_rgba_parse(&bg_color, "#000000"); gdk_rgba_parse(&bg_color, "#000000");
webkit_web_view_set_background_color(WEBKIT_WEB_VIEW(web_view), gdk_rgba_copy(&bg_color)); webkit_web_view_set_background_color(WEBKIT_WEB_VIEW(web_view), gdk_rgba_copy(&bg_color));
gtk_container_add(GTK_CONTAINER(window), web_view); gtk_container_add(GTK_CONTAINER(window), web_view);
webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view), g_strdup_printf("file://%s/%s/index.html", THEME_DIR, theme)); webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view), g_strdup_printf("file://%s/%s/index.html", THEME_DIR, theme));

Loading…
Cancel
Save