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

Commit cd28fdb

Browse files
committed
Merge branches 'master' and 'stable' of github.com:antergos/lightdm-webkit2-greeter into stable
# Conflicts: # meson.build
2 parents 5be6d1a + 5ec6465 commit cd28fdb

File tree

4 files changed

+32
-17
lines changed

4 files changed

+32
-17
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Overview of changes in lightdm-webkit2-greeter 2.2.1
2+
3+
* Increased the timeout for the "theme loaded" check to ensure themes are given
4+
enough time to load (when running on less powerful systems). (GH #98)
5+
* Fixed issue where users' custom .face image failed to load. (GH #98)
6+
17
Overview of changes in lightdm-webkit2-greeter 2.2
28

39
* Fixed issue where the ugly default X cursor was shown briefly after the greeter exits.

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project('lightdm-webkit2-greeter', 'c', version: '2.2.0', license: 'GPL-3')
1+
project('lightdm-webkit2-greeter', 'c', version: '2.2.1', license: 'GPL-3')
22

33

44
# ================================== #

src/greeter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ show_theme_recovery_modal() {
172172
fallback_theme = "simple";
173173
}
174174

175-
g_warning(log_msg);
175+
g_warning("%s", log_msg);
176176
gtk_widget_destroy(dialog);
177177

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

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

483483
/* There's no turning back now, let's go! */
484484
gtk_container_add(GTK_CONTAINER(window), web_view);

src/webkit2-extension.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -276,24 +276,33 @@ get_user_image_cb(JSContextRef context,
276276
JSObjectRef thisObject,
277277
JSStringRef propertyName,
278278
JSValueRef *exception) {
279-
const gchar *image_uri = lightdm_user_get_image(USER);
279+
280+
const gchar *image = lightdm_user_get_image(USER);
280281
gchar *image_path;
281282
gint result;
282283

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

291-
if (result) {
292-
/* Couldn't access */
293-
return JSValueMakeNull(context);
294-
} else {
295-
return string_or_null(context, image_uri);
292+
image_path = g_strdup(image);
293+
result = g_access(image_path, R_OK);
294+
295+
if (0 == result) {
296+
// Path is accessible. Add it to our paths list.
297+
paths = g_slist_prepend(paths, image_path);
298+
299+
return string_or_null(context, image);
296300
}
301+
302+
// Path is not accessible.
303+
g_free(image_path);
304+
305+
return JSValueMakeNull(context);
297306
}
298307

299308

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

18141823
if (NULL != err) {
1815-
g_error(err->message);
1824+
g_error("%s", err->message);
18161825
g_error_free(err);
18171826
g_free(value);
18181827
return "";
@@ -1835,7 +1844,7 @@ should_block_request(const char *file_path) {
18351844

18361845
if (NULL != canonical_path) {
18371846
for (iter = paths; iter; iter = iter->next) {
1838-
if (strcmp(canonical_path, iter->data) == 0 || g_str_has_prefix(canonical_path, iter->data)) {
1847+
if (0 == g_strcmp0(canonical_path, iter->data) || g_str_has_prefix(canonical_path, iter->data)) {
18391848
result = FALSE; /* Allowed */
18401849
break;
18411850
}

0 commit comments

Comments
 (0)