Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
Merge branches 'master' and 'stable' of github.com:antergos/lightdm-w…
Browse files Browse the repository at this point in the history
…ebkit2-greeter into stable

# Conflicts:
#	meson.build
  • Loading branch information
lots0logs committed Dec 26, 2016
2 parents 5be6d1a + 5ec6465 commit cd28fdb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Overview of changes in lightdm-webkit2-greeter 2.2.1

* Increased the timeout for the "theme loaded" check to ensure themes are given
enough time to load (when running on less powerful systems). (GH #98)
* Fixed issue where users' custom .face image failed to load. (GH #98)

Overview of changes in lightdm-webkit2-greeter 2.2

* Fixed issue where the ugly default X cursor was shown briefly after the greeter exits.
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('lightdm-webkit2-greeter', 'c', version: '2.2.0', license: 'GPL-3')
project('lightdm-webkit2-greeter', 'c', version: '2.2.1', license: 'GPL-3')


# ================================== #
Expand Down
4 changes: 2 additions & 2 deletions src/greeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ show_theme_recovery_modal() {
fallback_theme = "simple";
}

g_warning(log_msg);
g_warning("%s", log_msg);
gtk_widget_destroy(dialog);

webkit_web_view_load_uri(
Expand Down Expand Up @@ -478,7 +478,7 @@ main(int argc, char **argv) {
g_signal_connect(WEBKIT_WEB_VIEW(web_view), "context-menu", G_CALLBACK(context_menu_cb), NULL);

/* Register callback to check if theme loaded successfully */
g_timeout_add_seconds(5, (GSourceFunc) maybe_show_theme_fallback_dialog, NULL);
g_timeout_add_seconds(10, (GSourceFunc) maybe_show_theme_fallback_dialog, NULL);

/* There's no turning back now, let's go! */
gtk_container_add(GTK_CONTAINER(window), web_view);
Expand Down
37 changes: 23 additions & 14 deletions src/webkit2-extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,33 @@ get_user_image_cb(JSContextRef context,
JSObjectRef thisObject,
JSStringRef propertyName,
JSValueRef *exception) {
const gchar *image_uri = lightdm_user_get_image(USER);

const gchar *image = lightdm_user_get_image(USER);
gchar *image_path;
gint result;

image_path = g_filename_from_uri(image_uri, NULL, NULL);
if (image_path) {
result = g_access(image_path, R_OK);
g_free(image_path);
} else {
result = g_access(image_uri, R_OK);
// Determine if we already checked this path
for (iter = paths; iter; iter = iter->next) {
if (0 == g_strcmp0(image, iter->data)) {
// We've already checked this path, no need to continue further.
return string_or_null(context, image);
}
}

if (result) {
/* Couldn't access */
return JSValueMakeNull(context);
} else {
return string_or_null(context, image_uri);
image_path = g_strdup(image);
result = g_access(image_path, R_OK);

if (0 == result) {
// Path is accessible. Add it to our paths list.
paths = g_slist_prepend(paths, image_path);

return string_or_null(context, image);
}

// Path is not accessible.
g_free(image_path);

return JSValueMakeNull(context);
}


Expand Down Expand Up @@ -1812,7 +1821,7 @@ get_config_option_as_string(const gchar *section, const gchar *key) {
value = g_key_file_get_string(keyfile, section, key, &err);

if (NULL != err) {
g_error(err->message);
g_error("%s", err->message);
g_error_free(err);
g_free(value);
return "";
Expand All @@ -1835,7 +1844,7 @@ should_block_request(const char *file_path) {

if (NULL != canonical_path) {
for (iter = paths; iter; iter = iter->next) {
if (strcmp(canonical_path, iter->data) == 0 || g_str_has_prefix(canonical_path, iter->data)) {
if (0 == g_strcmp0(canonical_path, iter->data) || g_str_has_prefix(canonical_path, iter->data)) {
result = FALSE; /* Allowed */
break;
}
Expand Down

0 comments on commit cd28fdb

Please sign in to comment.