[gnome-screensaver] Remove GL helper
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screensaver] Remove GL helper
- Date: Sun, 6 Mar 2011 05:59:51 +0000 (UTC)
commit 4b9181fad6f74b1c098a998f11523266aaf1caa7
Author: William Jon McCann <jmccann redhat com>
Date: Sat Mar 5 23:02:54 2011 -0500
Remove GL helper
We don't need to set the best visual for GL if we aren't
running screensavers anymore.
configure.ac | 28 ---------
src/Makefile.am | 12 ----
src/gnome-screensaver-gl-helper.c | 76 -------------------------
src/gs-visual-gl.c | 111 -------------------------------------
src/gs-visual-gl.h | 32 -----------
src/gs-window-x11.c | 102 ----------------------------------
6 files changed, 0 insertions(+), 361 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0b8ca15..d6a8cfc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -522,31 +522,6 @@ else
fi
dnl ---------------------------------------------------------------------------
-dnl - Check for GL
-dnl ---------------------------------------------------------------------------
-
-AC_ARG_WITH(gl, [ --with-libgl build with GL support])
-have_libgl=no
-GL_LIBS=""
-
-if test x$with_libgl != xno; then
- AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
- if test "$have_gl" = yes ; then
- AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no,
- [#include <GL/gl.h>])
- fi
-
- if test "$have_gl" = yes ; then
- AC_CHECK_X_LIB(GL, glXChooseVisual, have_libgl=yes, have_libgl=no, -lm)
- fi
-fi
-
-if test "x$have_libgl" = "xyes"; then
- AC_DEFINE(HAVE_LIBGL, 1, [Define if libgl is available])
- GL_LIBS="-lGL $GL_LIBS"
-fi
-
-dnl ---------------------------------------------------------------------------
dnl - Check for PAM
dnl ---------------------------------------------------------------------------
@@ -653,7 +628,6 @@ dnl ---------------------------------------------------------------------------
AC_SUBST(AUTH_LIBS)
AC_SUBST(SAVER_LIBS)
-AC_SUBST(GL_LIBS)
REAL_PREFIX=
@@ -809,8 +783,6 @@ echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
Docs enabled: ${enable_docbook_docs}
- GL: ${have_libgl}
-
Screen locking enabled: ${enable_locking}
User switching enabled: ${enable_user_switching}
Show keyboard indicator: ${with_kbd_layout_indicator}
diff --git a/src/Makefile.am b/src/Makefile.am
index 2355d4d..5029566 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,7 +40,6 @@ bin_PROGRAMS = \
libexec_PROGRAMS = \
gnome-screensaver-dialog \
- gnome-screensaver-gl-helper \
$(NULL)
noinst_PROGRAMS = \
@@ -189,17 +188,6 @@ gnome_screensaver_SOURCES = \
$(BUILT_SOURCES) \
$(NULL)
-gnome_screensaver_gl_helper_LDADD = \
- $(GNOME_SCREENSAVER_LIBS) \
- $(GL_LIBS) \
- $(NULL)
-
-gnome_screensaver_gl_helper_SOURCES = \
- gnome-screensaver-gl-helper.c \
- gs-visual-gl.c \
- gs-visual-gl.h \
- $(NULL)
-
gnome_screensaver_LDADD = \
$(GNOME_SCREENSAVER_LIBS) \
$(SAVER_LIBS) \
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 708d3c1..93086d1 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -434,111 +434,9 @@ spawn_make_environment_for_screen (GdkScreen *screen,
return retval;
}
-static gboolean
-spawn_command_line_on_screen_sync (GdkScreen *screen,
- const gchar *command_line,
- char **standard_output,
- char **standard_error,
- int *exit_status,
- GError **error)
-{
- char **argv = NULL;
- char **envp = NULL;
- gboolean retval;
-
- g_return_val_if_fail (command_line != NULL, FALSE);
-
- if (! g_shell_parse_argv (command_line, NULL, &argv, error)) {
- return FALSE;
- }
-
- envp = spawn_make_environment_for_screen (screen, NULL);
-
- retval = g_spawn_sync (NULL,
- argv,
- envp,
- G_SPAWN_SEARCH_PATH,
- NULL,
- NULL,
- standard_output,
- standard_error,
- exit_status,
- error);
-
- g_strfreev (argv);
- g_strfreev (envp);
-
- return retval;
-}
-
-static GdkVisual *
-get_best_visual_for_screen (GdkScreen *screen)
-{
- char *command;
- char *std_output;
- int exit_status;
- GError *error;
- unsigned long v;
- char c;
- GdkVisual *visual;
- gboolean res;
-
- visual = NULL;
-
- command = g_build_filename (LIBEXECDIR, "gnome-screensaver-gl-helper", NULL);
-
- error = NULL;
- std_output = NULL;
- res = spawn_command_line_on_screen_sync (screen,
- command,
- &std_output,
- NULL,
- &exit_status,
- &error);
- if (! res) {
- gs_debug ("Could not run command '%s': %s", command, error->message);
- g_error_free (error);
- goto out;
- }
-
- if (1 == sscanf (std_output, "0x%lx %c", &v, &c)) {
- if (v != 0) {
- VisualID visual_id;
-
- visual_id = (VisualID) v;
- visual = gdk_x11_screen_lookup_visual (screen, visual_id);
-
- gs_debug ("Found best GL visual for screen %d: 0x%x",
- gdk_screen_get_number (screen),
- (unsigned int) visual_id);
- }
- }
- out:
- g_free (std_output);
- g_free (command);
-
- return g_object_ref (visual);
-}
-
-static void
-widget_set_best_visual (GtkWidget *widget)
-{
- GdkVisual *visual;
-
- g_return_if_fail (widget != NULL);
-
- visual = get_best_visual_for_screen (gtk_widget_get_screen (widget));
- if (visual != NULL) {
- gtk_widget_set_visual (widget, visual);
- g_object_unref (visual);
- }
-}
-
static void
gs_window_real_realize (GtkWidget *widget)
{
- widget_set_best_visual (widget);
-
if (GTK_WIDGET_CLASS (gs_window_parent_class)->realize) {
GTK_WIDGET_CLASS (gs_window_parent_class)->realize (widget);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]