From aee47f1f025ed0a7321eaffc0e073439b4c0450f Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Fri, 15 Apr 2016 18:17:49 -0500 Subject: [PATCH] Fix screen blanking for lockscreen. Allow right-click access when debug_mode is enabled. Add additional debug messages. --- NEWS | 6 ++++++ configure.ac | 2 +- data/lightdm-webkit2-greeter.conf | 1 + src/lightdm-webkit2-greeter.c | 19 ++++++++++--------- themes/antergos/js/greeter.js | 10 ++++++++++ 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 85fb805..0623129 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +Overview of changes in lightdm-webkit2-greeter 2.1.2 + + * Allow access to right-click context menu when debug mode is enabled in lightdm-webkit2-greeter.conf. + * Add additional debug messages to the default theme to help identify points of failure. + * Fix issue with screen blanking functionality when greeter is used as a lockscreen. + Overview of changes in lightdm-webkit2-greeter 2.1.1 * Fix default theme initialization failure if config file values are missing. diff --git a/configure.ac b/configure.ac index 902cff5..43f1db5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(lightdm-webkit2-greeter, 2.1.1) +AC_INIT(lightdm-webkit2-greeter, 2.1.2) AC_SUBST(THEME_DIR) AC_CONFIG_HEADER(config.h) AC_PREREQ([2.59]) diff --git a/data/lightdm-webkit2-greeter.conf b/data/lightdm-webkit2-greeter.conf index 18d1284..5805f0a 100644 --- a/data/lightdm-webkit2-greeter.conf +++ b/data/lightdm-webkit2-greeter.conf @@ -7,6 +7,7 @@ [greeter] webkit-theme = antergos debug_mode = false +screensaver-timeout = 300 # # [branding] diff --git a/src/lightdm-webkit2-greeter.c b/src/lightdm-webkit2-greeter.c index be2af61..c18c7d2 100644 --- a/src/lightdm-webkit2-greeter.c +++ b/src/lightdm-webkit2-greeter.c @@ -58,6 +58,7 @@ static GdkDisplay *default_display; static int timeout, interval, prefer_blanking, allow_exposures; static gint config_timeout; +static gboolean debug_mode; static GdkFilterReturn wm_window_filter(GdkXEvent *gxevent, GdkEvent *event, gpointer data) { @@ -100,15 +101,9 @@ initialize_web_extensions_cb(WebKitWebContext *context, gpointer user_data) { static void create_new_webkit_settings_object(void) { webkit_settings = webkit_settings_new_with_settings( - "enable-developer-extras", FALSE, - "enable-fullscreen", TRUE, - "enable-site-specific-quirks", TRUE, - "enable-dns-prefetching", TRUE, + "enable-developer-extras", TRUE, "javascript-can-open-windows-automatically", TRUE, "allow-file-access-from-file-urls", TRUE, - "enable-accelerated-2d-canvas", TRUE, - "enable-smooth-scrolling", FALSE, - "enable-webgl", TRUE, "enable-write-console-messages-to-stdout", TRUE, NULL ); @@ -122,7 +117,11 @@ context_menu_cb(WebKitWebView *view, WebKitHitTestResult *hit_test_result, gpointer user_data) { - return TRUE; + /* Returning true without creating a custom context menu results in no context + * menu being shown. Thus, we are returning the opposite of debug_mode to get + * desired result (which is only show menu when debug_mode is enabled. + */ + return (! debug_mode); } @@ -135,10 +134,11 @@ context_menu_cb(WebKitWebView *view, static void lock_hint_enabled_handler(void) { Display *display = gdk_x11_display_get_xdisplay(default_display); + config_timeout = (0 != config_timeout) ? config_timeout : 300; XGetScreenSaver(display, &timeout, &interval, &prefer_blanking, &allow_exposures); XForceScreenSaver(display, ScreenSaverActive); - XSetScreenSaver(display, config_timeout, 0, ScreenSaverActive, DefaultExposures); + XSetScreenSaver(display, config_timeout, 0, PreferBlanking, DefaultExposures); } @@ -201,6 +201,7 @@ main(int argc, char **argv) { theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL); config_timeout = g_key_file_get_integer(keyfile, "greeter", "screensaver-timeout", NULL); + debug_mode = g_key_file_get_boolean(keyfile, "greeter", "debug_mode", NULL); /* Setup the main window */ window = gtk_window_new(GTK_WINDOW_TOPLEVEL); diff --git a/themes/antergos/js/greeter.js b/themes/antergos/js/greeter.js index 3d2ac23..869782c 100644 --- a/themes/antergos/js/greeter.js +++ b/themes/antergos/js/greeter.js @@ -393,15 +393,25 @@ class AntergosTheme { * Initialize the theme. */ initialize() { + _util.log('initialize() starting.'); this.prepare_translations(); + _util.log('initialize() 1.'); this.do_static_translations(); + _util.log('initialize() 2.'); this.initialize_clock(); + _util.log('initialize() 3.'); this.prepare_login_panel_header(); + _util.log('initialize() 4.'); this.prepare_user_list(); + _util.log('initialize() 5.'); this.prepare_session_list(); + _util.log('initialize() 6.'); this.prepare_system_action_buttons(); + _util.log('initialize() 7.'); this.register_callbacks(); + _util.log('initialize() 8.'); this.background_manager.setup_background_thumbnails(); + _util.log('initialize() finished.'); }