зеркало из https://github.com/mozilla/gecko-dev.git
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. --HG-- extra : rebase_source : 6bf696d6543cbdd3ef66e19d4dc110134b761b63
This commit is contained in:
Родитель
64dc538bff
Коммит
e7723da605
|
@ -1296,14 +1296,6 @@ if test -n "$MOZ_X11"; then
|
||||||
AC_CHECK_LIB(X11-xcb, XGetXCBConnection, [XLIBS="-lX11-xcb $XLIBS"],
|
AC_CHECK_LIB(X11-xcb, XGetXCBConnection, [XLIBS="-lX11-xcb $XLIBS"],
|
||||||
[MISSING_X="$MISSING_X -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"
|
LDFLAGS="$_SAVE_LDFLAGS"
|
||||||
LIBS="$_SAVE_LIBS"
|
LIBS="$_SAVE_LIBS"
|
||||||
fi # $MOZ_X11
|
fi # $MOZ_X11
|
||||||
|
@ -1313,7 +1305,6 @@ AC_SUBST_LIST(XLDFLAGS)
|
||||||
AC_SUBST_LIST(XLIBS)
|
AC_SUBST_LIST(XLIBS)
|
||||||
AC_SUBST_LIST(XEXT_LIBS)
|
AC_SUBST_LIST(XEXT_LIBS)
|
||||||
AC_SUBST_LIST(XT_LIBS)
|
AC_SUBST_LIST(XT_LIBS)
|
||||||
AC_SUBST_LIST(XSS_LIBS)
|
|
||||||
|
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
dnl = pthread support
|
dnl = pthread support
|
||||||
|
|
|
@ -36,9 +36,6 @@
|
||||||
*/
|
*/
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#ifdef HAVE_LIBXSS
|
|
||||||
#include <X11/extensions/scrnsaver.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -60,73 +57,6 @@ int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
gdk_init(&argc, &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;
|
GdkPixbuf* screenshot = nullptr;
|
||||||
GdkWindow* window = gdk_get_default_root_window();
|
GdkWindow* window = gdk_get_default_root_window();
|
||||||
screenshot = gdk_pixbuf_get_from_window(window, 0, 0,
|
screenshot = gdk_pixbuf_get_from_window(window, 0, 0,
|
||||||
|
|
|
@ -12,7 +12,6 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] and CONFIG['MOZ_X11']:
|
||||||
CXXFLAGS += CONFIG['TK_CFLAGS']
|
CXXFLAGS += CONFIG['TK_CFLAGS']
|
||||||
LDFLAGS += CONFIG['XLDFLAGS']
|
LDFLAGS += CONFIG['XLDFLAGS']
|
||||||
OS_LIBS += CONFIG['TK_LIBS']
|
OS_LIBS += CONFIG['TK_LIBS']
|
||||||
OS_LIBS += CONFIG['XSS_LIBS']
|
|
||||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||||
Program('screenshot')
|
Program('screenshot')
|
||||||
SOURCES += [
|
SOURCES += [
|
||||||
|
|
Загрузка…
Ссылка в новой задаче