Browse Source

still fighting to get the webkit extension to work again

sisyphus
Dustin Falgout 8 years ago
parent
commit
8163b44495
  1. 4
      meson.build
  2. 28
      meson_options.txt
  3. 8
      src/greeter.c
  4. 8
      src/meson.build
  5. 3
      src/webkit2-extension.c

4
meson.build

@ -47,7 +47,7 @@ conf.set('AS_MICRO_VERSION', as_micro_version)
conf.set('GETTEXT_PACKAGE', '"lightdm-webkit2-greeter"') conf.set('GETTEXT_PACKAGE', '"lightdm-webkit2-greeter"')
conf.set('LOCALE_DIR', '"@0@/@1@"'.format(get_option('datadir'), 'locale')) conf.set('LOCALE_DIR', '"@0@"'.format(get_option('with-locale-dir')))
conf.set('THEME_DIR', '"@0@"'.format(get_option('with-theme-dir'))) conf.set('THEME_DIR', '"@0@"'.format(get_option('with-theme-dir')))
@ -55,6 +55,8 @@ conf.set('CONFIG_DIR', '"@0@"'.format(get_option('with-config-dir')))
conf.set('DESKTOP_DIR', '"@0@"'.format(get_option('with-desktop-dir'))) conf.set('DESKTOP_DIR', '"@0@"'.format(get_option('with-desktop-dir')))
conf.set('WEBEXT_DIR', '"@0@"'.format(get_option('with-webext-dir')))
# ===================================== # # ===================================== #
# ------->>> Sub Directories <<<------- # # ------->>> Sub Directories <<<------- #

28
meson_options.txt

@ -1,14 +1,24 @@
option('with-theme-dir', option('with-theme-dir',
type : 'string', type: 'string',
value : '/usr/share/lightdm-webkit/themes', value: '/usr/share/lightdm-webkit/themes/',
description : 'Directory to use for greeter themes') description: 'Directory to use for greeter themes')
option('with-config-dir', option('with-config-dir',
type : 'string', type: 'string',
value : '/etc/lightdm/', value: '/etc/lightdm/',
description : 'LightDM configuration directory') description: 'LightDM configuration directory')
option('with-desktop-dir', option('with-desktop-dir',
type : 'string', type: 'string',
value : '/usr/share/xgreeters/', value: '/usr/share/xgreeters/',
description : 'LightDM greeters directory') description: 'LightDM greeters directory')
option('with-webext-dir',
type: 'string',
value: '/usr/lib/lightdm-webkit2-greeter/',
description: 'Directory for the greeter webkit extension')
option('with-locale-dir',
type: 'string',
value: '/usr/share/locale/',
description: 'Locale directory')

8
src/greeter.c

@ -94,7 +94,7 @@ wm_window_filter(GdkXEvent *gxevent, GdkEvent *event, gpointer data) {
static void static void
initialize_web_extensions_cb(WebKitWebContext *context, gpointer user_data) { initialize_web_extensions_cb(WebKitWebContext *context, gpointer user_data) {
webkit_web_context_set_web_extensions_directory(context, LIGHTDM_WEBKIT2_GREETER_EXTENSIONS_DIR); webkit_web_context_set_web_extensions_directory(context, WEBEXT_DIR);
} }
@ -137,7 +137,7 @@ check_theme_heartbeat(void) {
g_warning("[ERROR] :: A problem was detected with the current theme. Falling back to simple theme..."); g_warning("[ERROR] :: A problem was detected with the current theme. Falling back to simple theme...");
webkit_web_view_load_uri( webkit_web_view_load_uri(
WEBKIT_WEB_VIEW(web_view), WEBKIT_WEB_VIEW(web_view),
g_strdup_printf("file://%s/simple/index.html", THEME_DIR) g_strdup_printf("file://%ssimple/index.html", THEME_DIR)
); );
} }
@ -347,7 +347,7 @@ main(int argc, char **argv) {
keyfile = g_key_file_new(); keyfile = g_key_file_new();
g_key_file_load_from_file(keyfile, g_key_file_load_from_file(keyfile,
CONFIG_DIR "/lightdm-webkit2-greeter.conf", CONFIG_DIR "lightdm-webkit2-greeter.conf",
G_KEY_FILE_NONE, NULL); G_KEY_FILE_NONE, NULL);
theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL); theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL);
@ -426,7 +426,7 @@ main(int argc, char **argv) {
/* There's no turning back now, let's go! */ /* There's no turning back now, let's go! */
gtk_container_add(GTK_CONTAINER(window), web_view); gtk_container_add(GTK_CONTAINER(window), web_view);
webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view), webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view),
g_strdup_printf("file://%s/%s/index.html", THEME_DIR, theme)); g_strdup_printf("file://%s%s/index.html", THEME_DIR, theme));
gtk_widget_show_all(window); gtk_widget_show_all(window);

8
src/meson.build

@ -1,7 +1,8 @@
configure_file(output: 'config.h', configuration: conf) configure_file(output: 'config.h', configuration: conf)
gresource_sources = include_directories('gresource') gresource_sources = include_directories('gresource')
extdir = '@0@/@1@'.format(get_option('libdir'), 'lightdm-webkit2-greeter') _ = get_option('with-webext-dir').split('"')
extdir = _[0]
# ======================================= # # ======================================= #
# ------->>> Webkit2 Extension <<<------- # # ------->>> Webkit2 Extension <<<------- #
@ -24,15 +25,10 @@ webext = library(
greeter_sources = ['gresource/greeter-resources.c', 'greeter.c'] greeter_sources = ['gresource/greeter-resources.c', 'greeter.c']
greeter_cargs = [
'-DLIGHTDM_WEBKIT2_GREETER_EXTENSIONS_DIR="@0@"'.format(extdir)
]
greeter = executable( greeter = executable(
'lightdm-webkit2-greeter', 'lightdm-webkit2-greeter',
greeter_sources, greeter_sources,
dependencies: greeter_deps, dependencies: greeter_deps,
c_args: greeter_cargs,
include_directories : gresource_sources, include_directories : gresource_sources,
install: true install: true
) )

3
src/webkit2-extension.c

@ -1460,7 +1460,6 @@ window_object_cleared_callback(WebKitScriptWorld *world,
greeter_util_object, greeter_util_object,
globalObject; globalObject;
JSStringRef command; JSStringRef command;
JSStringRef heartbeat_command;
gchar *lock_hint_message = "LockHint"; gchar *lock_hint_message = "LockHint";
gchar *page_loaded_message = "PageLoaded"; gchar *page_loaded_message = "PageLoaded";
@ -1687,7 +1686,7 @@ webkit_web_extension_initialize(WebKitWebExtension *extension) {
keyfile = g_key_file_new(); keyfile = g_key_file_new();
g_key_file_load_from_file(keyfile, g_key_file_load_from_file(keyfile,
CONFIG_DIR "/lightdm-webkit2-greeter.conf", CONFIG_DIR "lightdm-webkit2-greeter.conf",
G_KEY_FILE_NONE, NULL); G_KEY_FILE_NONE, NULL);
} }

Loading…
Cancel
Save