diff --git a/src/greeter.c b/src/greeter.c index 50adcfb..60b3305 100644 --- a/src/greeter.c +++ b/src/greeter.c @@ -177,8 +177,6 @@ theme_heartbeat_script_loaded_cb(GObject *object, gpointer user_data) { WebKitJavascriptResult *js_result; - JSValueRef value; - JSGlobalContextRef context; GError *error = NULL; js_result = webkit_web_view_run_javascript_from_gresource_finish( diff --git a/src/webkit2-extension.c b/src/webkit2-extension.c index ad3bdd0..4ac87ad 100644 --- a/src/webkit2-extension.c +++ b/src/webkit2-extension.c @@ -1649,6 +1649,15 @@ autologin_timer_expired_cb(LightDMGreeter *greeter, WebKitWebExtension *extensio } +void +page_created_cb(WebKitWebExtension *extension, + WebKitWebPage *web_page, + gpointer user_data) { + + page_id = webkit_web_page_get_id(web_page); +} + + G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension) { LightDMGreeter *greeter = lightdm_greeter_new(); @@ -1663,6 +1672,11 @@ webkit_web_extension_initialize(WebKitWebExtension *extension) { G_CALLBACK(autologin_timer_expired_cb), extension); + g_signal_connect(G_OBJECT(extension), + "page-created", + G_CALLBACK(page_created_cb), + NULL); + g_signal_connect(webkit_script_world_get_default(), "window-object-cleared", G_CALLBACK(window_object_cleared_callback), diff --git a/themes/antergos/js/greeter.js b/themes/antergos/js/greeter.js index 019dc9b..90795b4 100644 --- a/themes/antergos/js/greeter.js +++ b/themes/antergos/js/greeter.js @@ -213,6 +213,11 @@ class AntergosThemeUtils { this.background_images_dir = background_images_dir; } + is_not_empty( value ) { + empty_values = [null, 'null', undefined, 'undefined']; + return empty_values.findIndex(v => v === value) === -1; + } + find_images( dirlist ) { var images = [], @@ -661,7 +666,7 @@ class AntergosTheme { var user_id = $( this ).attr( 'id' ), selector = `.${user_id}`, user_session_cached = _util.cache_get( 'user', user_id, 'session' ), - user_session = (null !== user_session_cached) ? user_session_cached : lightdm.default_session; + user_session = (_util.is_not_empty( user_session_cached )) ? user_session_cached : lightdm.default_session; if ( _self.auth_pending || null !== _self.selected_user ) { lightdm.cancel_authentication();