Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
Call gtk_init as early as possible to avoid drawing failures under ce…
Browse files Browse the repository at this point in the history
…rtain circumstances. Closes #11
  • Loading branch information
lots0logs committed Oct 19, 2015
1 parent 8a227b6 commit a09e5cc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/lightdm-webkit2-greeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,16 @@ main(int argc, char **argv) {
gchar *theme;
GdkRGBA bg_color;

gtk_init(&argc, &argv);

signal(SIGTERM, sigterm_cb);

WebKitWebContext *context = webkit_web_context_get_default();
g_signal_connect(context,
"initialize-web-extensions",
G_CALLBACK(initialize_web_extensions_cb),
NULL);


signal(SIGTERM, sigterm_cb);

gtk_init(&argc, &argv);

gdk_window_set_cursor(gdk_get_default_root_window(),
gdk_cursor_new_for_display(gdk_display_get_default(), GDK_LEFT_PTR));

Expand All @@ -133,19 +132,15 @@ main(int argc, char **argv) {

gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
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_move(GTK_WINDOW(window), geometry.x, geometry.y);

create_new_webkit_settings_object();
web_view = webkit_web_view_new_with_settings(webkit_settings);

gdk_rgba_parse(&bg_color, "#000000");

webkit_web_view_set_background_color(WEBKIT_WEB_VIEW(web_view), gdk_rgba_copy(&bg_color));


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));
Expand Down

0 comments on commit a09e5cc

Please sign in to comment.