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

Commit aee47f1

Browse files
committed
Fix screen blanking for lockscreen. Allow right-click access when debug_mode is enabled. Add additional debug messages.
1 parent a0384a4 commit aee47f1

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

NEWS

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Overview of changes in lightdm-webkit2-greeter 2.1.2
2+
3+
* Allow access to right-click context menu when debug mode is enabled in lightdm-webkit2-greeter.conf.
4+
* Add additional debug messages to the default theme to help identify points of failure.
5+
* Fix issue with screen blanking functionality when greeter is used as a lockscreen.
6+
17
Overview of changes in lightdm-webkit2-greeter 2.1.1
28

39
* Fix default theme initialization failure if config file values are missing.

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl Process this file with autoconf to produce a configure script.
22

3-
AC_INIT(lightdm-webkit2-greeter, 2.1.1)
3+
AC_INIT(lightdm-webkit2-greeter, 2.1.2)
44
AC_SUBST(THEME_DIR)
55
AC_CONFIG_HEADER(config.h)
66
AC_PREREQ([2.59])

data/lightdm-webkit2-greeter.conf

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[greeter]
88
webkit-theme = antergos
99
debug_mode = false
10+
screensaver-timeout = 300
1011

1112
#
1213
# [branding]

src/lightdm-webkit2-greeter.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static GdkDisplay *default_display;
5858
static int timeout, interval, prefer_blanking, allow_exposures;
5959
static gint config_timeout;
6060

61+
static gboolean debug_mode;
6162

6263
static GdkFilterReturn
6364
wm_window_filter(GdkXEvent *gxevent, GdkEvent *event, gpointer data) {
@@ -100,15 +101,9 @@ initialize_web_extensions_cb(WebKitWebContext *context, gpointer user_data) {
100101
static void
101102
create_new_webkit_settings_object(void) {
102103
webkit_settings = webkit_settings_new_with_settings(
103-
"enable-developer-extras", FALSE,
104-
"enable-fullscreen", TRUE,
105-
"enable-site-specific-quirks", TRUE,
106-
"enable-dns-prefetching", TRUE,
104+
"enable-developer-extras", TRUE,
107105
"javascript-can-open-windows-automatically", TRUE,
108106
"allow-file-access-from-file-urls", TRUE,
109-
"enable-accelerated-2d-canvas", TRUE,
110-
"enable-smooth-scrolling", FALSE,
111-
"enable-webgl", TRUE,
112107
"enable-write-console-messages-to-stdout", TRUE,
113108
NULL
114109
);
@@ -122,7 +117,11 @@ context_menu_cb(WebKitWebView *view,
122117
WebKitHitTestResult *hit_test_result,
123118
gpointer user_data) {
124119

125-
return TRUE;
120+
/* Returning true without creating a custom context menu results in no context
121+
* menu being shown. Thus, we are returning the opposite of debug_mode to get
122+
* desired result (which is only show menu when debug_mode is enabled.
123+
*/
124+
return (! debug_mode);
126125
}
127126

128127

@@ -135,10 +134,11 @@ context_menu_cb(WebKitWebView *view,
135134
static void
136135
lock_hint_enabled_handler(void) {
137136
Display *display = gdk_x11_display_get_xdisplay(default_display);
137+
config_timeout = (0 != config_timeout) ? config_timeout : 300;
138138

139139
XGetScreenSaver(display, &timeout, &interval, &prefer_blanking, &allow_exposures);
140140
XForceScreenSaver(display, ScreenSaverActive);
141-
XSetScreenSaver(display, config_timeout, 0, ScreenSaverActive, DefaultExposures);
141+
XSetScreenSaver(display, config_timeout, 0, PreferBlanking, DefaultExposures);
142142
}
143143

144144

@@ -201,6 +201,7 @@ main(int argc, char **argv) {
201201

202202
theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL);
203203
config_timeout = g_key_file_get_integer(keyfile, "greeter", "screensaver-timeout", NULL);
204+
debug_mode = g_key_file_get_boolean(keyfile, "greeter", "debug_mode", NULL);
204205

205206
/* Setup the main window */
206207
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

themes/antergos/js/greeter.js

+10
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,25 @@ class AntergosTheme {
393393
* Initialize the theme.
394394
*/
395395
initialize() {
396+
_util.log('initialize() starting.');
396397
this.prepare_translations();
398+
_util.log('initialize() 1.');
397399
this.do_static_translations();
400+
_util.log('initialize() 2.');
398401
this.initialize_clock();
402+
_util.log('initialize() 3.');
399403
this.prepare_login_panel_header();
404+
_util.log('initialize() 4.');
400405
this.prepare_user_list();
406+
_util.log('initialize() 5.');
401407
this.prepare_session_list();
408+
_util.log('initialize() 6.');
402409
this.prepare_system_action_buttons();
410+
_util.log('initialize() 7.');
403411
this.register_callbacks();
412+
_util.log('initialize() 8.');
404413
this.background_manager.setup_background_thumbnails();
414+
_util.log('initialize() finished.');
405415
}
406416

407417

0 commit comments

Comments
 (0)