From 6d5b1e7d3e61e688ae8f5c0c3176cd05e5da70ed Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Fri, 30 Sep 2016 01:45:52 -0500 Subject: [PATCH] .. --- src/greeter.c | 9 ++++++++- src/webkit2-extension.c | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/greeter.c b/src/greeter.c index 42fa77a..cd2f881 100644 --- a/src/greeter.c +++ b/src/greeter.c @@ -178,6 +178,7 @@ theme_heartbeat_script_loaded_cb(GObject *object, GAsyncResult *result, gpointer user_data) { + g_message("UI PROCESS - theme heartbeat loaded fired!"); WebKitJavascriptResult *js_result; JSValueRef value; JSGlobalContextRef context; @@ -223,6 +224,7 @@ lock_hint_enabled_handler(void) { static void load_theme_heartbeat_script(void) { + g_message("UI PROCESS - load theme heartbeat fired!"); webkit_web_view_run_javascript_from_gresource( WEBKIT_WEB_VIEW(web_view), "/com/antergos/lightdm-webkit2-greeter/js/heartbeat.js", @@ -236,6 +238,7 @@ load_theme_heartbeat_script(void) { static void page_loaded_handler(void) { + g_message("UI PROCESS - page loaded handler fired!"); load_theme_heartbeat_script(); } @@ -259,16 +262,18 @@ message_received_cb(WebKitUserContentManager *manager, JSValueRef message_val; JSStringRef js_str_val; gsize message_str_length; + g_message("UI PROCESS - message received fired!"); context = webkit_javascript_result_get_global_context(message); message_val = webkit_javascript_result_get_value(message); - if (JSValueIsString(context, message_val)) { + if (TRUE) { js_str_val = JSValueToStringCopy(context, message_val, NULL); message_str_length = JSStringGetMaximumUTF8CStringSize(js_str_val); message_str = (gchar *)g_malloc (message_str_length); JSStringGetUTF8CString(js_str_val, message_str, message_str_length); JSStringRelease(js_str_val); + g_message("UI PROCESS - message is: %s", message_str); } else { message_str = ""; @@ -286,6 +291,8 @@ message_received_cb(WebKitUserContentManager *manager, } else if (strcmp(message_str, "Heartbeat::Exit") == 0) { theme_heartbeat_exit_handler(); + } else { + g_message("UI PROCESS - message received no match!"); } g_free(message_str); diff --git a/src/webkit2-extension.c b/src/webkit2-extension.c index 1ac9da5..c2cb50c 100644 --- a/src/webkit2-extension.c +++ b/src/webkit2-extension.c @@ -1451,6 +1451,8 @@ window_object_cleared_callback(WebKitScriptWorld *world, WebKitFrame *frame, LightDMGreeter *greeter) { + g_message("web extension window object cleared fired!"); + JSGlobalContextRef jsContext; WebKitDOMDOMWindow *dom_window; WebKitDOMDocument *dom_document; @@ -1516,6 +1518,7 @@ window_object_cleared_callback(WebKitScriptWorld *world, dom_window = webkit_dom_document_get_default_view(dom_document); if (dom_window) { + g_message("notifying UI process that page loaded!"); /* Notify the UI process that the page is loaded */ webkit_dom_dom_window_webkit_message_handlers_post_message( dom_window, "GreeterBridge", page_loaded_message @@ -1655,6 +1658,7 @@ autologin_timer_expired_cb(LightDMGreeter *greeter, WebKitWebExtension *extensio G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension) { + g_message("web extension initialize fired!"); LightDMGreeter *greeter = lightdm_greeter_new(); g_signal_connect(G_OBJECT(greeter),