Skip to content

Commit

Permalink
Report errors when setting screensaver attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
khorben committed Dec 29, 2018
1 parent 2e94744 commit 0ffc98d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/locker.c
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,7 @@ static void _locker_on_realize(GtkWidget * widget, gpointer data)
int height;
int depth;
GdkVisual * visual;
int i;

#if GTK_CHECK_VERSION(2, 14, 0)
window = gtk_widget_get_window(widget);
Expand All @@ -2501,8 +2502,15 @@ static void _locker_on_realize(GtkWidget * widget, gpointer data)
gdk_window_get_geometry(window, &x, &y, &width, &height,
&depth);
#endif
gdk_x11_display_error_trap_push(locker->display);
XScreenSaverSetAttributes(GDK_DISPLAY_XDISPLAY(locker->display),
GDK_WINDOW_XID(window), x, y, width, height, 0,
depth, 0, GDK_VISUAL_XVISUAL(visual), 0, NULL);
if((i = gdk_x11_display_error_trap_pop(locker->display)) != 0)
{
error_set_code(i, "%s",
"Could not set screensaver attributes");
_locker_error(NULL, error_get(NULL), i);
}
}
}

0 comments on commit 0ffc98d

Please sign in to comment.