summaryrefslogtreecommitdiffstats
path: root/twin
diff options
context:
space:
mode:
Diffstat (limited to 'twin')
-rw-r--r--twin/compton-tde/CMakeLists.txt104
-rw-r--r--twin/compton-tde/common.h11
-rw-r--r--twin/compton-tde/compton.c45
-rw-r--r--twin/compton-tde/compton_config.h.cmake38
-rw-r--r--twin/kompmgr/CMakeLists.txt4
5 files changed, 145 insertions, 57 deletions
diff --git a/twin/compton-tde/CMakeLists.txt b/twin/compton-tde/CMakeLists.txt
index 7d4f9ace4..ebaf38f33 100644
--- a/twin/compton-tde/CMakeLists.txt
+++ b/twin/compton-tde/CMakeLists.txt
@@ -12,65 +12,85 @@
if( NOT WITH_XRENDER )
tde_message_fatal( "xrender support is needed to build compton-tde.\n Pass -DWITH_XRENDER=ON to cmake arguments." )
-elseif( NOT WITH_XRANDR )
- tde_message_fatal( "xrandr support is needed to build compton-tde.\n Pass -DWITH_XRANDR=ON to cmake arguments." )
elseif( NOT WITH_XFIXES )
tde_message_fatal( "xfixes support is needed to build compton-tde.\n Pass -DWITH_XFIXES=ON to cmake arguments." )
-elseif( NOT WITH_XDAMAGE )
- tde_message_fatal( "xdamage support is needed to build compton-tde.\n Pass -DWITH_XDAMAGE=ON to cmake arguments." )
-elseif( NOT WITH_XEXT )
- tde_message_fatal( "xext support is needed to build compton-tde.\n Pass -DWITH_XEXT=ON to cmake arguments." )
-elseif( NOT WITH_XINERAMA )
- tde_message_fatal( "xinerama support is needed to build compton-tde.\n Pass -DWITH_XINERAMA=ON to cmake arguments." )
-elseif( NOT WITH_LIBCONFIG )
- tde_message_fatal( "libconfig support is needed to build compton-tde.\n Pass -DWITH_LIBCONFIG=ON to cmake arguments." )
endif( )
-
include_directories(
${CMAKE_BINARY_DIR}
- ${TDE_INCLUDE_DIR}
- ${TQT_INCLUDE_DIRS}
-)
-
-link_directories(
- ${TQT_LIBRARY_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${DBUS_INCLUDE_DIRS}
)
##### compton-tde (executable) ###################
-add_definitions("-Wall" "-std=c99")
+# TDE to compton config option map
+# WITH_XINNERAMA -> CONFIG_XINERAMA
+# WITH_XRANDR -> CONFIG_XANDR
+# HAVE_XEXT_XSYNCFENCE -> CONFIG_XSYNC
+# WITH_OPENGL -> CONFIG_VSYNC_OPENGL
+# WITH_OPENGL -> CONFIG_VSYNC_OPENGL_GLSL
+# WITH_OPENGL -> CONFIG_VSYNC_OPENGL_FBO
+# WITH_PCRE -> CONFIG_REGEX_PCRE
+# WITH_PCRE -> CONFIG_REGEX_PCRE_JIT
+# WITH_LIBCONFIG -> CONFIG_LIBCONFIG
+#
+# HAVE_LIBCONFIG_OLD_API -> CONFIG_LIBCONFIG_LEGACY (set up in compton_config.h)
+# CONFIG_XSYNC -> CONFIG_GLX_SYNC
+#
+# CONFIG_DBUS - always ON
+# CONFIG_C2 - always ON
+
+# TODO: think about some configuration option for CONFIG_VSYNC_DRM
+# NOTE: HAVE__XEXT_XSYNCFENCE is an automatically detected feature that shows
+# that libXext provides coresponding feature.
+
+add_definitions("-std=c99")
+
+set( compton_SRCS compton.c )
-option(CONFIG_LIBCONFIG "Enable configuration file parsing using libconfig" ON)
-if (CONFIG_LIBCONFIG)
- add_definitions("-DCONFIG_LIBCONFIG")
-endif ()
+set( CONFIG_XSYNC ${HAVE_XEXT_XSYNCFENCE} )
-option(CONFIG_VSYNC_DRM "Enable DRM VSync support" ON)
-if (CONFIG_VSYNC_DRM)
- add_definitions("-DCONFIG_LIBCONFIG")
-endif ()
+if( WITH_OPENGL )
+ set( CONFIG_VSYNC_OPENGL ${WITH_OPENGL} )
+ set( CONFIG_VSYNC_OPENGL_GLSL ${WITH_OPENGL} )
+ set( CONFIG_VSYNC_OPENGL_FBO ${WITH_OPENGL} )
+ set( CONFIG_GLX_SYNC ${CONFIG_XSYNC} )
+ list( APPEND compton_LIBRARIES ${GL_LIBRARIES})
+ list( APPEND compton_SRCS opengl.c )
+endif( )
+
+if( WITH_LIBCONFIG )
+ set( CONFIG_LIBCONFIG ${WITH_LIBCONFIG} )
+ list( APPEND compton_LIBRARIES ${LIBCONFIG_LIBRARIES} )
+endif( )
+
+if( WITH_XINERAMA )
+ set( CONFIG_XINERAMA ${WITH_XINERAMA} )
+ list( APPEND compton_LIBRARIES ${XINERAMA_LIBRARIES} )
+endif( )
+
+if( WITH_XRANDR )
+ set( CONFIG_XRANDR ${WITH_XRANDR} )
+ list( APPEND compton_LIBRARIES ${XRANDR_LIBRARIES} )
+endif( )
-option(CONFIG_VSYNC_OPENGL "Enable OpenGL support" ON)
-if (CONFIG_VSYNC_OPENGL)
- add_definitions("-DCONFIG_VSYNC_OPENGL")
- list(APPEND compton_SRCS src/opengl.c)
-endif ()
+if( WITH_PCRE )
+ set( CONFIG_REGEX_PCRE ${WITH_PCRE} )
+ set( CONFIG_REGEX_PCRE_JIT ${WITH_PCRE} )
+ list( APPEND compton_LIBRARIES ${LIBPCRE_LIBRARIES} )
+endif( )
-option(CONFIG_XINERAMA "Enable additional Xinerama features" ON)
-if (CONFIG_XINERAMA)
- add_definitions("-DCONFIG_XINERAMA")
-endif ()
+configure_file( compton_config.h.cmake compton_config.h )
-option(CONFIG_C2 "Enable matching system" ON)
-if (CONFIG_C2)
- add_definitions("-DCONFIG_C2")
- list(APPEND compton_SRCS src/c2.c)
-endif ()
+# permanently turn on some optional features: dbus c2
+list( APPEND compton_SRCS dbus.c c2.c )
+list( APPEND compton_LIBRARIES ${DBUS_LIBRARIES} )
tde_add_executable( compton-tde
- SOURCES c2.c compton.c opengl.c
- LINK m GL Xinerama ${LIBCONFIG_LIBRARIES} ${XRENDER_LIBRARIES} ${XRANDR_LIBRARIES} ${XFIXES_LIBRARIES} ${XDAMAGE_LIBRARIES} ${XEXT_LIBRARIES} ${XCOMPOSITE_LIBRARIES}
+ SOURCES ${compton_SRCS}
+ LINK m ${compton_LIBRARIES} ${XRENDER_LIBRARIES} ${XFIXES_LIBRARIES}
+ ${XDAMAGE_LIBRARIES} ${XEXT_LIBRARIES} ${XCOMPOSITE_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h
index 5c6392f51..8a7bae6d5 100644
--- a/twin/compton-tde/common.h
+++ b/twin/compton-tde/common.h
@@ -12,7 +12,7 @@
#ifndef COMPTON_COMMON_H
#define COMPTON_COMMON_H
-#include "config.h"
+#include "compton_config.h"
// === Options ===
@@ -61,7 +61,7 @@
// Whether to enable X Sync support.
// #define CONFIG_XSYNC 1
// Whether to enable GLX Sync support.
-// #define CONFIG_GLX_XSYNC 1
+// #define CONFIG_GLX_SYNC 1
// TDE specific options
// #define USE_ENV_HOME 1
@@ -106,12 +106,15 @@
#include <X11/extensions/Xdamage.h>
#include <X11/extensions/Xrender.h>
#include <X11/extensions/shape.h>
-#include <X11/extensions/Xrandr.h>
#include <X11/extensions/Xdbe.h>
#ifdef CONFIG_XSYNC
#include <X11/extensions/sync.h>
#endif
+#ifdef CONFIG_XRANDR
+#include <X11/extensions/Xrandr.h>
+#endif
+
#ifdef CONFIG_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
@@ -921,12 +924,14 @@ typedef struct _session_t {
int shape_event;
/// Error base number for X Shape extension.
int shape_error;
+#ifdef CONFIG_XRANDR
/// Whether X RandR extension exists.
bool randr_exists;
/// Event base number for X RandR extension.
int randr_event;
/// Error base number for X RandR extension.
int randr_error;
+#endif // CONFIG_XRANDR
#ifdef CONFIG_VSYNC_OPENGL
/// Whether X GLX extension exists.
bool glx_exists;
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c
index 123703a19..2c467e2c4 100644
--- a/twin/compton-tde/compton.c
+++ b/twin/compton-tde/compton.c
@@ -4543,6 +4543,7 @@ ev_shape_notify(session_t *ps, XShapeEvent *ev) {
update_reg_ignore_expire(ps, w);
}
+#ifdef CONFIG_XRANDR
/**
* Handle ScreenChangeNotify events from X RandR extension.
*/
@@ -4561,6 +4562,7 @@ ev_screen_change_notify(session_t *ps,
}
}
}
+#endif // CONFIG_XRANDR
#if defined(DEBUG_EVENTS) || defined(DEBUG_RESTACK)
/**
@@ -4659,10 +4661,12 @@ ev_handle(session_t *ps, XEvent *ev) {
ev_shape_notify(ps, (XShapeEvent *) ev);
break;
}
+#ifdef CONFIG_XRANDR
if (ps->randr_exists && ev->type == (ps->randr_event + RRScreenChangeNotify)) {
ev_screen_change_notify(ps, (XRRScreenChangeNotifyEvent *) ev);
break;
}
+#endif // CONFIG_XRANDR
if (isdamagenotify(ps, ev)) {
ev_damage_notify(ps, (XDamageNotifyEvent *) ev);
break;
@@ -4762,9 +4766,14 @@ usage(int ret) {
" Detect _NET_WM_OPACITY on client windows, useful for window\n"
" managers not passing _NET_WM_OPACITY of client windows to frame\n"
" windows.\n"
+#ifndef CONFIG_XRANDR
+#define WARNING " (AUTODETECTION DISABLED AT COMPILE TIME)"
+#else
+#define WARNING
+#endif
"--refresh-rate val\n"
" Specify refresh rate of the screen. If not specified or 0, compton\n"
- " will try detecting this with X RandR extension.\n"
+ " will try detecting this with X RandR extension."WARNING"\n"
"--vsync vsync-method\n"
" Set VSync method. There are up to 4 VSync methods currently available.\n"
" none = No VSync\n"
@@ -6259,6 +6268,7 @@ init_atoms(session_t *ps) {
ps->atom_win_type_tde_transparent_to_desktop = get_atom(ps, "_TDE_TRANSPARENT_TO_DESKTOP");
}
+#ifdef CONFIG_XRANDR
/**
* Update refresh rate info with X Randr extension.
*/
@@ -6277,6 +6287,7 @@ update_refresh_rate(session_t *ps) {
else
ps->refresh_intv = 0;
}
+#endif // CONFIG_XRANDR
/**
* Initialize refresh-rated based software optimization.
@@ -6291,10 +6302,12 @@ swopti_init(session_t *ps) {
if (ps->refresh_rate)
ps->refresh_intv = US_PER_SEC / ps->refresh_rate;
+#ifdef CONFIG_XRANDR
// Auto-detect refresh rate otherwise
if (!ps->refresh_rate && ps->randr_exists) {
update_refresh_rate(ps);
}
+#endif // CONFIG_XRANDR
// Turn off vsync_sw if we can't get the refresh rate
if (!ps->refresh_rate)
@@ -7196,9 +7209,11 @@ session_init(session_t *ps_old, int argc, char **argv) {
.shape_exists = false,
.shape_event = 0,
.shape_error = 0,
+#ifdef CONFIG_XRANDR
.randr_exists = 0,
.randr_event = 0,
.randr_error = 0,
+#endif // CONFIG_XRANDR
#ifdef CONFIG_VSYNC_OPENGL
.glx_exists = false,
.glx_event = 0,
@@ -7371,11 +7386,15 @@ session_init(session_t *ps_old, int argc, char **argv) {
// Query X RandR
if ((ps->o.sw_opti && !ps->o.refresh_rate) || ps->o.xinerama_shadow_crop) {
- if (XRRQueryExtension(ps->dpy, &ps->randr_event, &ps->randr_error))
- ps->randr_exists = true;
- else
- printf_errf("(): No XRandR extension, automatic screen change "
- "detection impossible.");
+#ifdef CONFIG_XRANDR
+ if (XRRQueryExtension(ps->dpy, &ps->randr_event, &ps->randr_error))
+ ps->randr_exists = true;
+ else
+ printf_errf("(): No XRandR extension, automatic screen change "
+ "detection impossible.");
+#else // CONFIG_XRANDR
+ printf_errf("(): Xrandr support not compiled in.");
+#endif // CONFIG_XRANDR
}
// Query X DBE extension
@@ -7435,11 +7454,21 @@ session_init(session_t *ps_old, int argc, char **argv) {
if (ps->o.sw_opti)
ps->o.sw_opti = swopti_init(ps);
+#ifdef CONFIG_XRANDR
// Monitor screen changes if vsync_sw is enabled and we are using
// an auto-detected refresh rate, or when Xinerama features are enabled
if (ps->randr_exists && ((ps->o.sw_opti && !ps->o.refresh_rate)
- || ps->o.xinerama_shadow_crop))
- XRRSelectInput(ps->dpy, ps->root, RRScreenChangeNotifyMask);
+ || ps->o.xinerama_shadow_crop))
+ XRRSelectInput(ps->dpy, ps->root, RRScreenChangeNotifyMask);
+#else
+ if( (ps->o.sw_opti && !ps->o.refresh_rate) ) {
+ printf_errf("(): Xrandr support not compiled in. Plese specify --refrash-rate manually");
+ }
+ if (ps->o.xinerama_shadow_crop) {
+ printf_errf("(): due to Xrandr support not compiled in."
+ " Xinerama features may malfunction on changing screen size.");
+ }
+#endif // CONFIG_XRANDR
// Initialize VSync
if (!vsync_init(ps))
diff --git a/twin/compton-tde/compton_config.h.cmake b/twin/compton-tde/compton_config.h.cmake
new file mode 100644
index 000000000..bf3f22543
--- /dev/null
+++ b/twin/compton-tde/compton_config.h.cmake
@@ -0,0 +1,38 @@
+#include "config.h"
+
+// Whether to enable PCRE regular expression support in blacklists, enabled
+// by default
+#cmakedefine CONFIG_REGEX_PCRE 1
+// Whether to enable JIT support of libpcre. This may cause problems on PaX
+// kernels.
+#cmakedefine CONFIG_REGEX_PCRE_JIT 1
+
+// Whether to enable parsing of configuration files using libconfig.
+#cmakedefine CONFIG_LIBCONFIG 1
+// Whether we are using a legacy version of libconfig (1.3.x).
+#cmakedefine CONFIG_LIBCONFIG_LEGACY 1
+
+// Whether to enable DRM VSync support
+#cmakedefine CONFIG_VSYNC_DRM 1
+
+// Whether to enable DBus support with libdbus.
+#define CONFIG_DBUS 1
+// Whether to enable condition support.
+#define CONFIG_C2 1
+
+// Whether to enable X Sync support.
+#cmakedefine CONFIG_XSYNC 1
+
+// Whether to enable OpenGL support
+#cmakedefine CONFIG_VSYNC_OPENGL 1
+// Whether to enable GLX GLSL support
+#cmakedefine CONFIG_VSYNC_OPENGL_GLSL 1
+// Whether to enable GLX FBO support
+#cmakedefine CONFIG_VSYNC_OPENGL_FBO 1
+// Whether to enable GLX Sync support.
+#cmakedefine CONFIG_GLX_SYNC 1
+
+// Whether to enable Xranr support
+#cmakedefine CONFIG_XRANDR 1
+// Whether to enable Xinerama support
+#cmakedefine CONFIG_XINERAMA 1
diff --git a/twin/kompmgr/CMakeLists.txt b/twin/kompmgr/CMakeLists.txt
index 0cc2e5616..e2eb0c186 100644
--- a/twin/kompmgr/CMakeLists.txt
+++ b/twin/kompmgr/CMakeLists.txt
@@ -14,10 +14,6 @@ if( NOT WITH_XRENDER )
tde_message_fatal( "xrender support is needed to build kompmgr.\n Pass -DWITH_XRENDER=ON to cmake arguments." )
elseif( NOT WITH_XFIXES )
tde_message_fatal( "xfixes support is needed to build kompmgr.\n Pass -DWITH_XFIXES=ON to cmake arguments." )
-elseif( NOT WITH_XDAMAGE )
- tde_message_fatal( "xdamage support is needed to build kompmgr.\n Pass -DWITH_XDAMAGE=ON to cmake arguments." )
-elseif( NOT WITH_XEXT )
- tde_message_fatal( "xext support is needed to build kompmgr.\n Pass -DWITH_XEXT=ON to cmake arguments." )
endif( )