Browse Source

make sure we save the page_id for the page when its created so we can use it later. fix user session sometimes having value of 'null' in default theme.

sisyphus
Dustin Falgout 8 years ago
parent
commit
22c8acef59
  1. 2
      src/greeter.c
  2. 14
      src/webkit2-extension.c
  3. 7
      themes/antergos/js/greeter.js

2
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(

14
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),

7
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();

Loading…
Cancel
Save