add a --indirect command line option that uses indirect rendering for compositing
authorDana Jansens <danakj@orodu.net>
Thu, 10 Jun 2010 15:42:35 +0000 (11:42 -0400)
committerDana Jansens <danakj@orodu.net>
Sat, 26 Jun 2010 23:30:47 +0000 (01:30 +0200)
openbox/composite.c
openbox/openbox.c
openbox/openbox.h

index 6bbd2467679c34207154ace18ebbe6b8532cec70..2f6ac2f536df1e89aefd2d4167e94b2758f062de 100644 (file)
@@ -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);
index 7ebbbbece8177b4cf8c8a48ebf30a72dafd61b73..0ea8cc42794408d20045ef83e761b24e651172bd 100644 (file)
@@ -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;
         }
index 94f49105879bb415e6a5e4e4e04a11fb5e2eb569..112c5ce09cb53e6e5c968564e7dd46bfb360a455 100644 (file)
@@ -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;