From d7033a1aae339b9d87956d850587afafec26b58d Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 30 Jan 2018 13:49:26 +0900 Subject: [PATCH] Bug 1433703 - Remove the libxss-based code from the screenshot tool. 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. --- old-configure.in | 9 --- testing/tools/screenshot/gdk-screenshot.cpp | 70 --------------------- testing/tools/screenshot/moz.build | 1 - 3 files changed, 80 deletions(-) diff --git a/old-configure.in b/old-configure.in index 5ad6e327a0feb..70bef3ee1f74b 100644 --- a/old-configure.in +++ b/old-configure.in @@ -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 @@ -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 diff --git a/testing/tools/screenshot/gdk-screenshot.cpp b/testing/tools/screenshot/gdk-screenshot.cpp index e136d95391461..aa01010cbf299 100644 --- a/testing/tools/screenshot/gdk-screenshot.cpp +++ b/testing/tools/screenshot/gdk-screenshot.cpp @@ -36,9 +36,6 @@ */ #include #include -#ifdef HAVE_LIBXSS -#include -#endif #include #include @@ -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, diff --git a/testing/tools/screenshot/moz.build b/testing/tools/screenshot/moz.build index 12263272db10d..508ac4768d898 100644 --- a/testing/tools/screenshot/moz.build +++ b/testing/tools/screenshot/moz.build @@ -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 += [