Browse Source

fix issues with imcompatible pointers

sisyphus
Dustin Falgout 8 years ago
parent
commit
36e3e198c4
  1. 12
      src/meson.build
  2. 13
      src/webkit2-extension.c

12
src/meson.build

@ -1,18 +1,18 @@
configure_file(output: 'config.h', configuration: conf)
gresource_sources = include_directories('gresource')
# ======================================= #
# ------->>> Webkit2 Extension <<<------- #
# ======================================= #
webext_sources = ['webkit2-extension.c']
webext_incdir = include_directories('.')
webext_sources = ['gresource/greeter-resources.c', 'webkit2-extension.c']
webext = shared_library(
'lightdm-webkit2-greeter-webext',
webext_sources,
dependencies: webext_deps,
include_directories : webext_incdir,
include_directories : gresource_sources,
install: true)
@ -20,8 +20,7 @@ webext = shared_library(
# ------->>> Greeter <<<------- #
# ============================= #
greeter_sources = ['greeter-resources.c', 'greeter.c']
gresource_sources = include_directories('gresource')
greeter_sources = ['gresource/greeter-resources.c', 'greeter.c']
extdir = '"@0@/@1@"'.format(get_option('libdir'), 'lightdm-webkit2-greeter')
@ -34,6 +33,7 @@ greeter = executable(
greeter_sources,
dependencies: deps,
c_args: greeter_cargs,
include_directories : gresource_sources,
install: true)

13
src/webkit2-extension.c

@ -1449,10 +1449,11 @@ static const JSClassDefinition greeter_util_definition = {
static void
inject_theme_heartbeat_script(JSGlobalContextRef *jsContext) {
inject_theme_heartbeat_script(JSGlobalContextRef jsContext) {
JSStringRef command;
GBytes *resource;
GError *err = NULL;
gsize *size = NULL;
greeter_resources = greeter_resources_get_resource();
resource = g_resource_lookup_data(
@ -1465,13 +1466,15 @@ inject_theme_heartbeat_script(JSGlobalContextRef *jsContext) {
if (NULL != err) {
fprintf(stderr, "Loading heartbeat.js from GResource failed: %s\n", err->message);
g_error_free(err);
return;
}
command = JSStringCreateWithUTF8CString(resource);
command = JSStringCreateWithCharacters(g_bytes_unref_to_data(resource, size), sizeof size);
JSEvaluateScript(jsContext, command, NULL, NULL, 0, NULL);
g_object_unref(resource)
g_object_unref(resource);
g_free(size);
}
@ -1542,13 +1545,13 @@ window_object_cleared_callback(WebKitScriptWorld *world,
JSEvaluateScript(jsContext, command, NULL, NULL, 0, NULL);
/* Inject GreeterThemeHeartbeat class */
inject_theme_heartbeat_class(jsContext);
inject_theme_heartbeat_script(jsContext);
/* Start the heartbeat */
heartbeat_command = JSStringCreateWithUTF8CString("new GreeterThemeHeartbeat();");
JSEvaluateScript(jsContext, heartbeat_command, NULL, NULL, 0, NULL);
/* If the greeter was started as a lock-screen, send message to our UI process. */
/* If the greeter was started as a lock-screen, notify our UI process. */
if (lightdm_greeter_get_lock_hint(greeter)) {
dom_document = webkit_web_page_get_dom_document(web_page);
dom_window = webkit_dom_document_get_default_view(dom_document);

Loading…
Cancel
Save