If composite cannot be enabled, the config var is set back to FALSE.
openbox/client_list_combined_menu.h \
openbox/client_menu.c \
openbox/client_menu.h \
+ openbox/composite.c \
+ openbox/composite.h \
openbox/config.c \
openbox/config.h \
openbox/debug.c \
--- /dev/null
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+ composite.c for the Openbox window manager
+ Copyright (c) 2010 Dana Jansens
+ Copyright (c) 2010 Derek Foreman
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ See the COPYING file for a copy of the GNU General Public License.
+*/
+
+#include "composite.h"
+#include "config.h"
+#include "obt/display.h"
+
+#include <X11/Xlib.h>
+#include <glib.h>
+
+void composite_startup(gboolean reconfig)
+{
+ /* This function will try enable composite if config_comp is TRUE. At the
+ end of this process, config_comp will be set to TRUE only if composite
+ is enabled, and FALSE otherwise. */
+#ifdef USE_COMPOSITING
+ gboolean try;
+
+ if (reconfig) return;
+ if (!(try = config_comp)) return;
+
+ config_comp = FALSE;
+
+ /* XXX test GL things we need also */
+ if (!obt_display_extension_composite ||
+ !obt_display_extension_damage ||
+ !obt_display_extension_fixes)
+ {
+ try = FALSE;
+ }
+
+ config_comp = try;
+ if (!config_comp)
+ g_message("Failed to enable composite. A better explanation why would be nice");
+#endif
+}
+
+void composite_shutdown(gboolean reconfig)
+{
+#ifdef USE_COMPOSITING
+ if (reconfig) return;
+#endif
+}
--- /dev/null
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+ composite.h for the Openbox window manager
+ Copyright (c) 2010 Dana Jansens
+ Copyright (c) 2010 Derek Foreman
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ See the COPYING file for a copy of the GNU General Public License.
+*/
+
+#ifndef __composite_h
+#define __composite_h
+
+#include <glib.h>
+
+void composite_startup(gboolean reconfig);
+void composite_shutdown(gboolean reconfig);
+
+#endif
#include "openbox.h"
#include "gettext.h"
#include "obt/paths.h"
+#include "obt/display.h"
gboolean config_focus_new;
gboolean config_focus_follow;
gboolean config_theme_keepborder;
guint config_theme_window_list_icon_size;
+gboolean config_comp;
+
gchar *config_title_layout;
gboolean config_animate_iconify;
config_theme = NULL;
+ config_comp = TRUE;
+
config_animate_iconify = TRUE;
config_title_layout = g_strdup("NLIMC");
config_theme_keepborder = TRUE;
/*! The name of the theme */
extern gchar *config_theme;
+/*! Whether to act as a compositing manager or not */
+extern gboolean config_comp;
/*! Show the one-pixel border after toggleDecor */
extern gboolean config_theme_keepborder;
menu_frame_startup(reconfigure);
menu_startup(reconfigure);
prompt_startup(reconfigure);
+ composite_startup(reconfigure);
/* do this after everything is started so no events will get
missed */
if (!reconfigure)
window_unmanage_all();
+ composite_shutdown(reconfigure);
prompt_shutdown(reconfigure);
menu_shutdown(reconfigure);
menu_frame_shutdown(reconfigure);