Skip to content

Commit

Permalink
Bug 1433703 - Remove the libxss-based code from the screenshot tool. …
Browse files Browse the repository at this point in the history
…r=gps

It hasn't been used for a long while, and the screenshot tool is only
used for tests. So keeping the code essentially always disabled doesn't
have much value.
  • Loading branch information
glandium committed Jan 30, 2018
1 parent 943674d commit d7033a1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 80 deletions.
9 changes: 0 additions & 9 deletions old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1296,14 +1296,6 @@ if test -n "$MOZ_X11"; then
AC_CHECK_LIB(X11-xcb, XGetXCBConnection, [XLIBS="-lX11-xcb $XLIBS"],
[MISSING_X="$MISSING_X -lX11-xcb"], $XLIBS)

dnl ========================================================
dnl = Check for Xss
dnl ========================================================
MOZ_CHECK_HEADER(X11/extensions/scrnsaver.h,
AC_CHECK_LIB(Xss, XScreenSaverQueryInfo,
[XSS_LIBS="-lXss $XEXT_LIBS $XLIBS"
AC_DEFINE(HAVE_LIBXSS)],, $XEXT_LIBS $XLIBS))

LDFLAGS="$_SAVE_LDFLAGS"
LIBS="$_SAVE_LIBS"
fi # $MOZ_X11
Expand All @@ -1313,7 +1305,6 @@ AC_SUBST_LIST(XLDFLAGS)
AC_SUBST_LIST(XLIBS)
AC_SUBST_LIST(XEXT_LIBS)
AC_SUBST_LIST(XT_LIBS)
AC_SUBST_LIST(XSS_LIBS)

dnl ========================================================
dnl = pthread support
Expand Down
70 changes: 0 additions & 70 deletions testing/tools/screenshot/gdk-screenshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
*/
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#ifdef HAVE_LIBXSS
#include <X11/extensions/scrnsaver.h>
#endif

#include <errno.h>
#include <stdio.h>
Expand All @@ -60,73 +57,6 @@ int main(int argc, char** argv)
{
gdk_init(&argc, &argv);

#if defined(HAVE_LIBXSS) && defined(MOZ_WIDGET_GTK)
int event_base, error_base;
Bool have_xscreensaver =
XScreenSaverQueryExtension(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
&event_base, &error_base);

if (!have_xscreensaver) {
fprintf(stderr, "No XScreenSaver extension on display\n");
} else {
XScreenSaverInfo* info = XScreenSaverAllocInfo();
if (!info) {
fprintf(stderr, "%s: Out of memory\n", argv[0]);
return 1;
}
XScreenSaverQueryInfo(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
GDK_ROOT_WINDOW(), info);

const char* state;
const char* til_or_since = nullptr;
switch (info->state) {
case ScreenSaverOff:
state = "Off";
til_or_since = "XScreenSaver will activate after another %lu seconds idle time\n";
break;
case ScreenSaverOn:
state = "On";
if (info->til_or_since) {
til_or_since = "XScreenSaver idle timer activated %lu seconds ago\n";
} else {
til_or_since = "XScreenSaver idle activation is disabled\n";
}
break;
case ScreenSaverDisabled:
state = "Disabled";
break;
default:
state = "unknown";
}

const char* kind;
switch (info->kind) {
case ScreenSaverBlanked:
kind = "Blanked";
break;
case ScreenSaverInternal:
state = "Internal";
break;
case ScreenSaverExternal:
state = "External";
break;
default:
state = "unknown";
}

fprintf(stderr, "XScreenSaver state: %s\n", state);

if (til_or_since) {
fprintf(stderr, "XScreenSaver kind: %s\n", kind);
fprintf(stderr, til_or_since, info->til_or_since / 1000);
}

fprintf(stderr, "User input has been idle for %lu seconds\n", info->idle / 1000);

XFree(info);
}
#endif

GdkPixbuf* screenshot = nullptr;
GdkWindow* window = gdk_get_default_root_window();
screenshot = gdk_pixbuf_get_from_window(window, 0, 0,
Expand Down
1 change: 0 additions & 1 deletion testing/tools/screenshot/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] and CONFIG['MOZ_X11']:
CXXFLAGS += CONFIG['TK_CFLAGS']
LDFLAGS += CONFIG['XLDFLAGS']
OS_LIBS += CONFIG['TK_LIBS']
OS_LIBS += CONFIG['XSS_LIBS']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
Program('screenshot')
SOURCES += [
Expand Down

0 comments on commit d7033a1

Please sign in to comment.