Make xinerama mandatory
Fixes #116 Also tweaks the usage message a bit. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
b2750b26e0
commit
2a41847aa6
|
@ -1,5 +1,4 @@
|
||||||
option('sanitize', type: 'boolean', value: false, description: 'Compile compton with sanitizers')
|
option('sanitize', type: 'boolean', value: false, description: 'Compile compton with sanitizers')
|
||||||
option('xinerama', type: 'boolean', value: true, description: 'Enable XINERAMA support')
|
|
||||||
option('config_file', type: 'boolean', value: true, description: 'Enable config file support')
|
option('config_file', type: 'boolean', value: true, description: 'Enable config file support')
|
||||||
option('regex', type: 'boolean', value: true, description: 'Enable regex support in window conditions')
|
option('regex', type: 'boolean', value: true, description: 'Enable regex support in window conditions')
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,6 @@ static void compose(void *backend_data, session_t *ps, win *w, void *win_data, i
|
||||||
// content, and destroying it.
|
// content, and destroying it.
|
||||||
pixman_region32_intersect(®_tmp, ®_tmp, (region_t *)reg_paint);
|
pixman_region32_intersect(®_tmp, ®_tmp, (region_t *)reg_paint);
|
||||||
|
|
||||||
#ifdef CONFIG_XINERAMA
|
|
||||||
if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 && w->xinerama_scr < ps->xinerama_nscrs)
|
if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 && w->xinerama_scr < ps->xinerama_nscrs)
|
||||||
// There can be a window where number of screens is updated,
|
// There can be a window where number of screens is updated,
|
||||||
// but the screen number attached to the windows have not.
|
// but the screen number attached to the windows have not.
|
||||||
|
@ -127,7 +126,6 @@ static void compose(void *backend_data, session_t *ps, win *w, void *win_data, i
|
||||||
// just check to make sure we don't access out of bounds.
|
// just check to make sure we don't access out of bounds.
|
||||||
pixman_region32_intersect(
|
pixman_region32_intersect(
|
||||||
®_tmp, ®_tmp, &ps->xinerama_scr_regs[w->xinerama_scr]);
|
®_tmp, ®_tmp, &ps->xinerama_scr_regs[w->xinerama_scr]);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Mask out the body of the window from the shadow
|
// Mask out the body of the window from the shadow
|
||||||
// Doing it here instead of in make_shadow() for saving GPU
|
// Doing it here instead of in make_shadow() for saving GPU
|
||||||
|
|
|
@ -45,10 +45,7 @@
|
||||||
#include <xcb/randr.h>
|
#include <xcb/randr.h>
|
||||||
#include <xcb/shape.h>
|
#include <xcb/shape.h>
|
||||||
#include <xcb/sync.h>
|
#include <xcb/sync.h>
|
||||||
|
|
||||||
#ifdef CONFIG_XINERAMA
|
|
||||||
#include <xcb/xinerama.h>
|
#include <xcb/xinerama.h>
|
||||||
#endif
|
|
||||||
#include <ev.h>
|
#include <ev.h>
|
||||||
#include <pixman.h>
|
#include <pixman.h>
|
||||||
|
|
||||||
|
@ -489,7 +486,6 @@ typedef struct session {
|
||||||
/// Error base number for X GLX extension.
|
/// Error base number for X GLX extension.
|
||||||
int glx_error;
|
int glx_error;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_XINERAMA
|
|
||||||
/// Whether X Xinerama extension exists.
|
/// Whether X Xinerama extension exists.
|
||||||
bool xinerama_exists;
|
bool xinerama_exists;
|
||||||
/// Xinerama screen info.
|
/// Xinerama screen info.
|
||||||
|
@ -498,7 +494,6 @@ typedef struct session {
|
||||||
region_t *xinerama_scr_regs;
|
region_t *xinerama_scr_regs;
|
||||||
/// Number of Xinerama screens.
|
/// Number of Xinerama screens.
|
||||||
int xinerama_nscrs;
|
int xinerama_nscrs;
|
||||||
#endif
|
|
||||||
/// Whether X Sync extension exists.
|
/// Whether X Sync extension exists.
|
||||||
bool xsync_exists;
|
bool xsync_exists;
|
||||||
/// Event base number for X Sync extension.
|
/// Event base number for X Sync extension.
|
||||||
|
|
|
@ -15,7 +15,7 @@ cflags = []
|
||||||
required_package = [
|
required_package = [
|
||||||
'x11', 'x11-xcb', 'xcb-renderutil',
|
'x11', 'x11-xcb', 'xcb-renderutil',
|
||||||
'xcb-render', 'xcb-damage', 'xcb-randr', 'xcb-sync',
|
'xcb-render', 'xcb-damage', 'xcb-randr', 'xcb-sync',
|
||||||
'xcb-composite', 'xcb-shape', 'xcb-image',
|
'xcb-composite', 'xcb-shape', 'xcb-image', 'xcb-xinerama',
|
||||||
'xcb-xfixes', 'xcb-present', 'xext', 'pixman-1'
|
'xcb-xfixes', 'xcb-present', 'xext', 'pixman-1'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -25,11 +25,6 @@ endforeach
|
||||||
|
|
||||||
deps = []
|
deps = []
|
||||||
|
|
||||||
if get_option('xinerama')
|
|
||||||
deps += [dependency('xcb-xinerama', required: true)]
|
|
||||||
cflags += ['-DCONFIG_XINERAMA']
|
|
||||||
endif
|
|
||||||
|
|
||||||
if get_option('config_file')
|
if get_option('config_file')
|
||||||
deps += [dependency('libconfig', version: '>=1.4', required: true),
|
deps += [dependency('libconfig', version: '>=1.4', required: true),
|
||||||
dependency('libxdg-basedir', required: true)]
|
dependency('libxdg-basedir', required: true)]
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
*/
|
*/
|
||||||
static void usage(int ret) {
|
static void usage(int ret) {
|
||||||
#define WARNING_DISABLED " (DISABLED AT COMPILE TIME)"
|
#define WARNING_DISABLED " (DISABLED AT COMPILE TIME)"
|
||||||
#define WARNING
|
|
||||||
static const char *usage_text =
|
static const char *usage_text =
|
||||||
"compton (" COMPTON_VERSION ")\n"
|
"compton (" COMPTON_VERSION ")\n"
|
||||||
"This is the maintenance fork of compton, please report\n"
|
"This is the maintenance fork of compton, please report\n"
|
||||||
|
@ -87,16 +86,13 @@ static void usage(int ret) {
|
||||||
"--show-all-xerrors\n"
|
"--show-all-xerrors\n"
|
||||||
" Show all X errors (for debugging).\n"
|
" Show all X errors (for debugging).\n"
|
||||||
"\n"
|
"\n"
|
||||||
#undef WARNING
|
|
||||||
#ifndef CONFIG_LIBCONFIG
|
|
||||||
#define WARNING WARNING_DISABLED
|
|
||||||
#else
|
|
||||||
#define WARNING
|
|
||||||
#endif
|
|
||||||
"--config path\n"
|
"--config path\n"
|
||||||
" Look for configuration file at the path. Use /dev/null to avoid\n"
|
" Look for configuration file at the path. Use /dev/null to avoid\n"
|
||||||
" loading configuration file." WARNING "\n"
|
" loading configuration file."
|
||||||
"\n"
|
#ifndef CONFIG_LIBCONFIG
|
||||||
|
WARNING_DISABLED
|
||||||
|
#endif
|
||||||
|
"\n\n"
|
||||||
"--write-pid-path path\n"
|
"--write-pid-path path\n"
|
||||||
" Write process ID to a file.\n"
|
" Write process ID to a file.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -162,15 +158,12 @@ static void usage(int ret) {
|
||||||
" Set VSync method. There are (up to) 5 VSync methods currently\n"
|
" Set VSync method. There are (up to) 5 VSync methods currently\n"
|
||||||
" available:\n"
|
" available:\n"
|
||||||
" none = No VSync\n"
|
" none = No VSync\n"
|
||||||
#undef WARNING
|
|
||||||
#ifndef CONFIG_VSYNC_DRM
|
|
||||||
#define WARNING WARNING_DISABLED
|
|
||||||
#else
|
|
||||||
#define WARNING
|
|
||||||
#endif
|
|
||||||
" drm = VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some\n"
|
" drm = VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some\n"
|
||||||
" (DRI-based) drivers." WARNING "\n"
|
" (DRI-based) drivers."
|
||||||
#undef WARNING
|
#ifndef CONFIG_VSYNC_DRM
|
||||||
|
WARNING_DISABLED
|
||||||
|
#endif
|
||||||
|
"\n\n"
|
||||||
#ifndef CONFIG_OPENGL
|
#ifndef CONFIG_OPENGL
|
||||||
#define WARNING WARNING_DISABLED
|
#define WARNING WARNING_DISABLED
|
||||||
#else
|
#else
|
||||||
|
@ -182,7 +175,7 @@ static void usage(int ret) {
|
||||||
" Only work on some drivers." WARNING "\n"
|
" Only work on some drivers." WARNING "\n"
|
||||||
" opengl-swc = Enable driver-level VSync. Works only with GLX "
|
" opengl-swc = Enable driver-level VSync. Works only with GLX "
|
||||||
"backend." WARNING "\n"
|
"backend." WARNING "\n"
|
||||||
" opengl-mswc = Deprecated, use opengl-swc instead." WARNING "\n"
|
#undef WARNING
|
||||||
"\n"
|
"\n"
|
||||||
"--vsync-aggressive\n"
|
"--vsync-aggressive\n"
|
||||||
" Attempt to send painting request before VBlank and do XFlush()\n"
|
" Attempt to send painting request before VBlank and do XFlush()\n"
|
||||||
|
@ -291,27 +284,18 @@ static void usage(int ret) {
|
||||||
" should not be painted in, such as a dock window region.\n"
|
" should not be painted in, such as a dock window region.\n"
|
||||||
" Use --shadow-exclude-reg \'x10+0-0\', for example, if the 10 pixels\n"
|
" Use --shadow-exclude-reg \'x10+0-0\', for example, if the 10 pixels\n"
|
||||||
" on the bottom of the screen should not have shadows painted on.\n"
|
" on the bottom of the screen should not have shadows painted on.\n"
|
||||||
#undef WARNING
|
|
||||||
#ifndef CONFIG_XINERAMA
|
|
||||||
#define WARNING WARNING_DISABLED
|
|
||||||
#else
|
|
||||||
#define WARNING
|
|
||||||
#endif
|
|
||||||
"\n"
|
"\n"
|
||||||
"--xinerama-shadow-crop\n"
|
"--xinerama-shadow-crop\n"
|
||||||
" Crop shadow of a window fully on a particular Xinerama screen to the\n"
|
" Crop shadow of a window fully on a particular Xinerama screen to the\n"
|
||||||
" screen." WARNING "\n"
|
" screen.\n"
|
||||||
"\n"
|
"\n"
|
||||||
#undef WARNING
|
|
||||||
#ifndef CONFIG_OPENGL
|
|
||||||
#define WARNING "(GLX BACKENDS DISABLED AT COMPILE TIME)"
|
|
||||||
#else
|
|
||||||
#define WARNING
|
|
||||||
#endif
|
|
||||||
"--backend backend\n"
|
"--backend backend\n"
|
||||||
" Choose backend. Possible choices are xrender, glx, and\n"
|
" Choose backend. Possible choices are xrender, glx, and\n"
|
||||||
" xr_glx_hybrid" WARNING ".\n"
|
" xr_glx_hybrid."
|
||||||
"\n"
|
#ifndef CONFIG_OPENGL
|
||||||
|
" (GLX BACKENDS DISABLED AT COMPILE TIME)"
|
||||||
|
#endif
|
||||||
|
"\n\n"
|
||||||
"--glx-no-stencil\n"
|
"--glx-no-stencil\n"
|
||||||
" GLX backend: Avoid using stencil buffer. Might cause issues\n"
|
" GLX backend: Avoid using stencil buffer. Might cause issues\n"
|
||||||
" when rendering transparent content. My tests show a 15% performance\n"
|
" when rendering transparent content. My tests show a 15% performance\n"
|
||||||
|
@ -338,27 +322,22 @@ static void usage(int ret) {
|
||||||
"--xrender-sync\n"
|
"--xrender-sync\n"
|
||||||
" Attempt to synchronize client applications' draw calls with XSync(),\n"
|
" Attempt to synchronize client applications' draw calls with XSync(),\n"
|
||||||
" used on GLX backend to ensure up-to-date window content is painted.\n"
|
" used on GLX backend to ensure up-to-date window content is painted.\n"
|
||||||
#undef WARNING
|
|
||||||
#define WARNING
|
|
||||||
"\n"
|
"\n"
|
||||||
"--xrender-sync-fence\n"
|
"--xrender-sync-fence\n"
|
||||||
" Additionally use X Sync fence to sync clients' draw calls. Needed\n"
|
" Additionally use X Sync fence to sync clients' draw calls. Needed\n"
|
||||||
" on nvidia-drivers with GLX backend for some users." WARNING "\n"
|
" on nvidia-drivers with GLX backend for some users.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"--force-win-blend\n"
|
"--force-win-blend\n"
|
||||||
" Force all windows to be painted with blending. Useful if you have a\n"
|
" Force all windows to be painted with blending. Useful if you have a\n"
|
||||||
" --glx-fshader-win that could turn opaque pixels transparent.\n"
|
" --glx-fshader-win that could turn opaque pixels transparent.\n"
|
||||||
"\n"
|
"\n"
|
||||||
#undef WARNING
|
|
||||||
#ifndef CONFIG_DBUS
|
|
||||||
#define WARNING WARNING_DISABLED
|
|
||||||
#else
|
|
||||||
#define WARNING
|
|
||||||
#endif
|
|
||||||
"--dbus\n"
|
"--dbus\n"
|
||||||
" Enable remote control via D-Bus. See the D-BUS API section in the\n"
|
" Enable remote control via D-Bus. See the D-BUS API section in the\n"
|
||||||
" man page for more details." WARNING "\n"
|
" man page for more details."
|
||||||
"\n"
|
#ifndef CONFIG_DBUS
|
||||||
|
WARNING_DISABLED
|
||||||
|
#endif
|
||||||
|
"\n\n"
|
||||||
"--benchmark cycles\n"
|
"--benchmark cycles\n"
|
||||||
" Benchmark mode. Repeatedly paint until reaching the specified cycles.\n"
|
" Benchmark mode. Repeatedly paint until reaching the specified cycles.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -370,7 +349,6 @@ static void usage(int ret) {
|
||||||
" backend only.\n";
|
" backend only.\n";
|
||||||
FILE *f = (ret ? stderr : stdout);
|
FILE *f = (ret ? stderr : stdout);
|
||||||
fputs(usage_text, f);
|
fputs(usage_text, f);
|
||||||
#undef WARNING
|
|
||||||
#undef WARNING_DISABLED
|
#undef WARNING_DISABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -897,7 +897,6 @@ void paint_all(session_t *ps, win *const t, bool ignore_damage) {
|
||||||
if (!ps->o.wintype_option[w->window_type].full_shadow)
|
if (!ps->o.wintype_option[w->window_type].full_shadow)
|
||||||
pixman_region32_subtract(®_tmp, ®_tmp, &bshape);
|
pixman_region32_subtract(®_tmp, ®_tmp, &bshape);
|
||||||
|
|
||||||
#ifdef CONFIG_XINERAMA
|
|
||||||
if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 &&
|
if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 &&
|
||||||
w->xinerama_scr < ps->xinerama_nscrs)
|
w->xinerama_scr < ps->xinerama_nscrs)
|
||||||
// There can be a window where number of screens
|
// There can be a window where number of screens
|
||||||
|
@ -910,7 +909,6 @@ void paint_all(session_t *ps, win *const t, bool ignore_damage) {
|
||||||
pixman_region32_intersect(
|
pixman_region32_intersect(
|
||||||
®_tmp, ®_tmp,
|
®_tmp, ®_tmp,
|
||||||
&ps->xinerama_scr_regs[w->xinerama_scr]);
|
&ps->xinerama_scr_regs[w->xinerama_scr]);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Detect if the region is empty before painting
|
// Detect if the region is empty before painting
|
||||||
if (pixman_region32_not_empty(®_tmp)) {
|
if (pixman_region32_not_empty(®_tmp)) {
|
||||||
|
|
|
@ -778,9 +778,7 @@ bool add_win(session_t *ps, xcb_window_t id, xcb_window_t prev) {
|
||||||
|
|
||||||
.id = XCB_NONE,
|
.id = XCB_NONE,
|
||||||
.a = {},
|
.a = {},
|
||||||
#ifdef CONFIG_XINERAMA
|
|
||||||
.xinerama_scr = -1,
|
.xinerama_scr = -1,
|
||||||
#endif
|
|
||||||
.pictfmt = NULL,
|
.pictfmt = NULL,
|
||||||
.mode = WMODE_TRANS,
|
.mode = WMODE_TRANS,
|
||||||
.ever_damaged = false,
|
.ever_damaged = false,
|
||||||
|
@ -1464,10 +1462,10 @@ win_check_fade_finished(session_t *ps, win **_w) {
|
||||||
*
|
*
|
||||||
* Return an index >= 0, or -1 if not found.
|
* Return an index >= 0, or -1 if not found.
|
||||||
*
|
*
|
||||||
* XXX move to x.c
|
* TODO move to x.c
|
||||||
|
* TODO use xrandr
|
||||||
*/
|
*/
|
||||||
void win_update_screen(session_t *ps, win *w) {
|
void win_update_screen(session_t *ps, win *w) {
|
||||||
#ifdef CONFIG_XINERAMA
|
|
||||||
w->xinerama_scr = -1;
|
w->xinerama_scr = -1;
|
||||||
|
|
||||||
if (!ps->xinerama_scrs)
|
if (!ps->xinerama_scrs)
|
||||||
|
@ -1484,7 +1482,6 @@ void win_update_screen(session_t *ps, win *w) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO remove this
|
// TODO remove this
|
||||||
|
|
|
@ -134,10 +134,8 @@ struct win {
|
||||||
/// Window attributes.
|
/// Window attributes.
|
||||||
xcb_get_window_attributes_reply_t a;
|
xcb_get_window_attributes_reply_t a;
|
||||||
xcb_get_geometry_reply_t g;
|
xcb_get_geometry_reply_t g;
|
||||||
#ifdef CONFIG_XINERAMA
|
|
||||||
/// Xinerama screen this window is on.
|
/// Xinerama screen this window is on.
|
||||||
int xinerama_scr;
|
int xinerama_scr;
|
||||||
#endif
|
|
||||||
/// Window visual pict format;
|
/// Window visual pict format;
|
||||||
const xcb_render_pictforminfo_t *pictfmt;
|
const xcb_render_pictforminfo_t *pictfmt;
|
||||||
/// Window painting mode.
|
/// Window painting mode.
|
||||||
|
|
Loading…
Reference in New Issue