@@ -58,6 +58,7 @@ static GdkDisplay *default_display;
58
58
static int timeout , interval , prefer_blanking , allow_exposures ;
59
59
static gint config_timeout ;
60
60
61
+ static gboolean debug_mode ;
61
62
62
63
static GdkFilterReturn
63
64
wm_window_filter (GdkXEvent * gxevent , GdkEvent * event , gpointer data ) {
@@ -100,15 +101,9 @@ initialize_web_extensions_cb(WebKitWebContext *context, gpointer user_data) {
100
101
static void
101
102
create_new_webkit_settings_object (void ) {
102
103
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,
107
105
"javascript-can-open-windows-automatically" , TRUE,
108
106
"allow-file-access-from-file-urls" , TRUE,
109
- "enable-accelerated-2d-canvas" , TRUE,
110
- "enable-smooth-scrolling" , FALSE,
111
- "enable-webgl" , TRUE,
112
107
"enable-write-console-messages-to-stdout" , TRUE,
113
108
NULL
114
109
);
@@ -122,7 +117,11 @@ context_menu_cb(WebKitWebView *view,
122
117
WebKitHitTestResult * hit_test_result ,
123
118
gpointer user_data ) {
124
119
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 );
126
125
}
127
126
128
127
@@ -135,10 +134,11 @@ context_menu_cb(WebKitWebView *view,
135
134
static void
136
135
lock_hint_enabled_handler (void ) {
137
136
Display * display = gdk_x11_display_get_xdisplay (default_display );
137
+ config_timeout = (0 != config_timeout ) ? config_timeout : 300 ;
138
138
139
139
XGetScreenSaver (display , & timeout , & interval , & prefer_blanking , & allow_exposures );
140
140
XForceScreenSaver (display , ScreenSaverActive );
141
- XSetScreenSaver (display , config_timeout , 0 , ScreenSaverActive , DefaultExposures );
141
+ XSetScreenSaver (display , config_timeout , 0 , PreferBlanking , DefaultExposures );
142
142
}
143
143
144
144
@@ -201,6 +201,7 @@ main(int argc, char **argv) {
201
201
202
202
theme = g_key_file_get_string (keyfile , "greeter" , "webkit-theme" , NULL );
203
203
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 );
204
205
205
206
/* Setup the main window */
206
207
window = gtk_window_new (GTK_WINDOW_TOPLEVEL );
0 commit comments