From 59ce16686fcc1a1a951d352666047f2140c21877 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 10 Jun 2010 11:42:35 -0400 Subject: [PATCH] add a --indirect command line option that uses indirect rendering for compositing --- openbox/composite.c | 5 ++++- openbox/openbox.c | 5 +++++ openbox/openbox.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/openbox/composite.c b/openbox/composite.c index 6bbd2467..2f6ac2f5 100644 --- a/openbox/composite.c +++ b/openbox/composite.c @@ -145,6 +145,9 @@ void composite_startup(gboolean reconfig) if (reconfig) return; if (!config_comp) return; + if (ob_comp_indirect) + setenv("LIBGL_ALWAYS_INDIRECT", "1", True); + config_comp = FALSE; root = RootWindow(obt_display, ob_screen); @@ -253,7 +256,7 @@ void composite_startup(gboolean reconfig) return; } - obcomp.ctx = glXCreateContext(obt_display, vi, NULL, True); + obcomp.ctx = glXCreateContext(obt_display, vi, NULL, !ob_comp_indirect); XFree(vi); fbcs = obcomp.GetFBConfigs(obt_display, ob_screen, &count); diff --git a/openbox/openbox.c b/openbox/openbox.c index 7ebbbbec..0ea8cc42 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -93,6 +93,7 @@ gchar *ob_sm_id = NULL; gchar *ob_sm_save_file = NULL; gboolean ob_sm_restore = TRUE; gboolean ob_debug_xinerama = FALSE; +gboolean ob_comp_indirect = FALSE; const gchar *ob_locale_msg = NULL; static ObState state; @@ -532,6 +533,7 @@ static void print_help(void) fine to leave it as FILE though. */ g_print(_(" --config-file FILE Specify the path to the config file to use\n")); g_print(_(" --sm-disable Disable connection to the session manager\n")); + g_print(_(" --indirect Use indirect rendering for composite\n")); g_print(_("\nPassing messages to a running Openbox instance:\n")); g_print(_(" --reconfigure Reload Openbox's configuration\n")); g_print(_(" --restart Restart Openbox\n")); @@ -649,6 +651,9 @@ static void parse_args(gint *argc, gchar **argv) else if (!strcmp(argv[i], "--debug-xinerama")) { ob_debug_xinerama = TRUE; } + else if (!strcmp(argv[i], "--indirect")) { + ob_comp_indirect = TRUE; + } else if (!strcmp(argv[i], "--reconfigure")) { remote_control = 1; } diff --git a/openbox/openbox.h b/openbox/openbox.h index 94f49105..112c5ce0 100644 --- a/openbox/openbox.h +++ b/openbox/openbox.h @@ -44,6 +44,7 @@ extern gchar *ob_sm_save_file; extern gboolean ob_sm_restore; extern gboolean ob_replace_wm; extern gboolean ob_debug_xinerama; +extern gboolean ob_comp_indirect; /*! The current locale for the LC_MESSAGES category */ extern const gchar *ob_locale_msg; -- 2.34.1