mirror of
https://github.com/yshui/picom.git
synced 2024-11-25 14:06:08 -05:00
revert to c7ca345
This commit is contained in:
parent
b0766e09b6
commit
7ace6ca68d
9 changed files with 244 additions and 1302 deletions
25
.gitignore
vendored
25
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
# Build files
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.h
|
||||
|
@ -13,26 +14,14 @@ missing
|
|||
stamp-h1
|
||||
compton
|
||||
*.o
|
||||
build/
|
||||
|
||||
# CMake files
|
||||
compton-*.deb
|
||||
compton-*.rpm
|
||||
compton-*.tar.bz2
|
||||
release/
|
||||
_CPack_Packages/
|
||||
CMakeCache.txt
|
||||
CMakeFiles/
|
||||
*.cmake
|
||||
install_manifest.txt
|
||||
|
||||
*~
|
||||
core
|
||||
|
||||
# Vim files
|
||||
.*.sw[a-z]
|
||||
*~
|
||||
|
||||
# Misc files
|
||||
core
|
||||
# oprofile files
|
||||
oprofile_data
|
||||
|
||||
# clang files
|
||||
compton.plist
|
||||
callgrind.out.*
|
||||
|
|
160
CMakeLists.txt
160
CMakeLists.txt
|
@ -1,160 +0,0 @@
|
|||
project(compton)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "0")
|
||||
|
||||
set(compton_SRCS src/compton.c)
|
||||
add_executable(compton ${compton_SRCS})
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-ggdb")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -march=native")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -march=native -ggdb")
|
||||
|
||||
add_definitions("-Wall" "-std=c99")
|
||||
|
||||
# == Options ==
|
||||
|
||||
option(CONFIG_REGEX_PCRE "Enable PCRE regular expression support for blacklist entries (requires libpcre)" ON)
|
||||
if (CONFIG_REGEX_PCRE)
|
||||
add_definitions("-DCONFIG_REGEX_PCRE")
|
||||
endif ()
|
||||
|
||||
option(CONFIG_REGEX_PCRE_JIT "Use JIT support of libpcre)" ON)
|
||||
if (CONFIG_REGEX_PCRE_JIT)
|
||||
add_definitions("-DCONFIG_REGEX_PCRE_JIT")
|
||||
endif ()
|
||||
|
||||
option(CONFIG_LIBCONFIG "Enable configuration file parsing using libconfig" ON)
|
||||
if (CONFIG_LIBCONFIG)
|
||||
add_definitions("-DCONFIG_LIBCONFIG")
|
||||
endif ()
|
||||
|
||||
option(CONFIG_VSYNC_DRM "Enable DRM VSync support" ON)
|
||||
if (CONFIG_VSYNC_DRM)
|
||||
add_definitions("-DCONFIG_VSYNC_DRM")
|
||||
endif ()
|
||||
|
||||
option(CONFIG_VSYNC_OPENGL "Enable OpenGL VSync support" ON)
|
||||
if (CONFIG_VSYNC_OPENGL)
|
||||
add_definitions("-DCONFIG_VSYNC_OPENGL")
|
||||
endif ()
|
||||
|
||||
# == Find libraries ==
|
||||
|
||||
target_link_libraries(compton "-lm" "-lrt")
|
||||
|
||||
if (CONFIG_VSYNC_OPENGL)
|
||||
target_link_libraries(compton "-lGL")
|
||||
endif ()
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
# --- Find X11 libs ---
|
||||
set(X11_FIND_REQUIRED 1)
|
||||
include(FindX11)
|
||||
|
||||
macro(X11LIB_CHK lib)
|
||||
if (NOT X11_${lib}_FOUND)
|
||||
message(FATAL_ERROR "Could not find lib${lib}.")
|
||||
endif ()
|
||||
target_link_libraries(compton "${X11_${lib}_LIB}")
|
||||
endmacro ()
|
||||
|
||||
X11LIB_CHK(Xcomposite)
|
||||
X11LIB_CHK(Xdamage)
|
||||
X11LIB_CHK(Xext)
|
||||
X11LIB_CHK(Xfixes)
|
||||
X11LIB_CHK(Xrender)
|
||||
X11LIB_CHK(Xrandr)
|
||||
|
||||
# --- Find libpcre ---
|
||||
if (CONFIG_REGEX_PCRE)
|
||||
pkg_check_modules(LIBPCRE REQUIRED libpcre>=8.12)
|
||||
target_link_libraries(compton "${LIBPCRE_LDFLAGS}")
|
||||
endif ()
|
||||
|
||||
# --- Find libconfig ---
|
||||
if (CONFIG_LIBCONFIG)
|
||||
pkg_check_modules(LIBCONFIG REQUIRED libconfig>=1.3.2)
|
||||
target_link_libraries(compton "${LIBCONFIG_LDFLAGS}")
|
||||
if (LIBCONFIG_VERSION VERSION_LESS 1.4)
|
||||
add_definitions("-DCONFIG_LIBCONFIG_LEGACY")
|
||||
message(STATUS "libconfig-1.3* detected. Enable legacy mode.")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# == Install ==
|
||||
include(GNUInstallDirs)
|
||||
|
||||
install(TARGETS compton
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT prog)
|
||||
install(FILES "${PROJECT_SOURCE_DIR}/bin/compton-trans"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT prog)
|
||||
install(FILES
|
||||
"${PROJECT_SOURCE_DIR}/man/compton.1"
|
||||
"${PROJECT_SOURCE_DIR}/man/compton-trans.1"
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}" COMPONENT doc)
|
||||
install(FILES
|
||||
"${PROJECT_SOURCE_DIR}/README.md"
|
||||
"${PROJECT_SOURCE_DIR}/LICENSE"
|
||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
|
||||
|
||||
# == CPack ==
|
||||
|
||||
if (NOT CPACK_SYSTEM_NAME)
|
||||
set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif ()
|
||||
|
||||
set(CPACK_PACKAGE_DESCRIPTION "A lightweight X compositing window manager, fork of xcompmgr-dana.")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A lightweight X compositing window manager")
|
||||
set(CPACK_PACKAGE_CONTACT "nobody <devnull@example.com>")
|
||||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_SOURCE_DIR}/release")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/desc.txt")
|
||||
|
||||
# --- Package config ---
|
||||
set(CPACK_GENERATOR "TBZ2" "DEB" "RPM")
|
||||
set(CPACK_MONOLITHIC_INSTALL 1)
|
||||
set(CPACK_STRIP_FILES 1)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "LICENSE")
|
||||
set(CPACK_RESOURCE_FILE_README "README.md")
|
||||
|
||||
# --- Source package config ---
|
||||
set(CPACK_SOURCE_GENERATOR "TBZ2" "DEB" "RPM")
|
||||
set(CPACK_SOURCE_IGNORE_FILES
|
||||
"/\\\\."
|
||||
"\\\\.bak$"
|
||||
"\\\\.o$"
|
||||
"\\\\~$"
|
||||
"\\\\.plist$"
|
||||
"/compton$"
|
||||
# Generated package files
|
||||
"\\\\.tar\\\\.gz$"
|
||||
"\\\\.tar\\\\.bz2$"
|
||||
"\\\\.deb$"
|
||||
"\\\\.rpm$"
|
||||
"compton-.*\\\\.sh$"
|
||||
# CMake files
|
||||
"/Makefile$"
|
||||
"/CMakeFiles/"
|
||||
"\\\\.cmake$"
|
||||
"CMakeCache\\\\.txt$"
|
||||
"/build/"
|
||||
"/release/"
|
||||
"\\\\.diff$"
|
||||
"/oprofile_data/"
|
||||
"/install_manifest\\\\.txt$"
|
||||
)
|
||||
|
||||
# --- DEB package config ---
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "x11")
|
||||
# The dependencies are unreliable, just an example here
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libx11-6, libxext6, libxcomposite1, libxrender1, libxdamage1, libxfixes3, libpcre3, libconfig8")
|
||||
|
||||
# --- RPM package config ---
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "unknown")
|
||||
# The dependencies are unreliable, just an example here
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "libx11, libxext, libxcomposite, libxrender, libxdamage, libxfixes, libpcre, libconfig")
|
||||
|
||||
include(CPack)
|
|
@ -1,40 +0,0 @@
|
|||
# == Environment ==
|
||||
if (NOT CPACK_SYSTEM_NAME)
|
||||
set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
if (CPACK_SYSTEM_NAME STREQUAL "x86_64")
|
||||
set(CPACK_SYSTEM_NAME "amd64")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# == Basic information ==
|
||||
set(CPACK_PACKAGE_NAME "compton")
|
||||
set(CPACK_PACKAGE_VENDOR "chjj")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "0")
|
||||
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "A lightweight X compositing window manager, fork of xcompmgr-dana.")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A lightweight X compositing window manager")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
|
||||
set(CPACK_PACKAGE_CONTACT "nobody <devnull@example.com>")
|
||||
set(CPACK_INSTALL_COMMANDS "env PREFIX=build make install")
|
||||
|
||||
# == Package config ==
|
||||
set(CPACK_INSTALLED_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/build" "usr")
|
||||
set(CPACK_GENERATOR "TBZ2" "DEB" "RPM")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "LICENSE")
|
||||
set(CPACK_RESOURCE_FILE_README "README.md")
|
||||
set(CPACK_STRIP_FILES 1)
|
||||
|
||||
# == DEB package config ==
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CPACK_SYSTEM_NAME}")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "x11")
|
||||
# The dependencies are unreliable, just an example here
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libx11-6, libxext6, libxcomposite1, libxrender1, libxdamage1, libxfixes3, libpcre3, libconfig8")
|
||||
|
||||
# == RPM package config ==
|
||||
# The dependencies are unreliable, just an example here
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "libx11, libxext, libxcomposite, libxrender, libxdamage, libxfixes, libpcre, libconfig")
|
||||
|
||||
# == Source package config ==
|
||||
set(CPACK_SOURCE_GENERATOR "TBZ2 DEB RPM")
|
50
Makefile
50
Makefile
|
@ -4,48 +4,20 @@ PREFIX ?= /usr
|
|||
BINDIR ?= $(PREFIX)/bin
|
||||
MANDIR ?= $(PREFIX)/share/man/man1
|
||||
|
||||
PACKAGES = x11 xcomposite xfixes xdamage xrender xext xrandr
|
||||
LIBS = -lm -lrt
|
||||
INCS =
|
||||
|
||||
# Parse configuration flags
|
||||
CFG =
|
||||
|
||||
ifeq "$(NO_LIBCONFIG)" ""
|
||||
CFG += -DCONFIG_LIBCONFIG
|
||||
PACKAGES += libconfig
|
||||
|
||||
# libconfig-1.3* does not define LIBCONFIG_VER* macros, so we use
|
||||
# pkg-config to determine its version here
|
||||
CFG += $(shell pkg-config --atleast-version=1.4 libconfig || echo '-DCONFIG_LIBCONFIG_LEGACY')
|
||||
endif
|
||||
|
||||
ifeq "$(NO_REGEX_PCRE)" ""
|
||||
CFG += -DCONFIG_REGEX_PCRE
|
||||
LIBS += $(shell pcre-config --libs)
|
||||
INCS += $(shell pcre-config --cflags)
|
||||
ifeq "$(NO_REGEX_PCRE_JIT)" ""
|
||||
CFG += -DCONFIG_REGEX_PCRE_JIT
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq "$(NO_VSYNC_DRM)" ""
|
||||
CFG += -DCONFIG_VSYNC_DRM
|
||||
endif
|
||||
|
||||
ifeq "$(NO_VSYNC_OPENGL)" ""
|
||||
CFG += -DCONFIG_VSYNC_OPENGL
|
||||
LIBS += -lGL
|
||||
endif
|
||||
|
||||
CFLAGS ?= -DNDEBUG
|
||||
CFLAGS += $(CFG)
|
||||
|
||||
LIBS += $(shell pkg-config --libs $(PACKAGES))
|
||||
INCS += $(shell pkg-config --cflags $(PACKAGES))
|
||||
PACKAGES = x11 xcomposite xfixes xdamage xrender xext libconfig
|
||||
LIBS = $(shell pkg-config --libs $(PACKAGES)) -lm
|
||||
LIBS += $(shell pcre-config --libs)
|
||||
INCS = $(shell pkg-config --cflags $(PACKAGES))
|
||||
INCS += $(shell pcre-config --cflags)
|
||||
CFLAGS += -Wall -std=c99
|
||||
OBJS = compton.o
|
||||
|
||||
CFG ?= -DCONFIG_LIBCONFIG -DCONFIG_REGEX_PCRE -DCONFIG_REGEX_PCRE_JIT
|
||||
# libconfig-1.3* does not define LIBCONFIG_VER* macros, so we use pkg-config
|
||||
# to determine its version here
|
||||
CFG += $(shell pkg-config --atleast-version=1.4 libconfig || echo '-DCONFIG_LIBCONFIG_LEGACY')
|
||||
CFLAGS += $(CFG)
|
||||
|
||||
%.o: src/%.c src/%.h
|
||||
$(CC) $(CFLAGS) $(INCS) -c src/$*.c
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ __R__ for runtime
|
|||
* libxfixes (B,R)
|
||||
* libXext (B,R)
|
||||
* libxrender (B,R)
|
||||
* libXrandr (B,R)
|
||||
* pkg-config (B)
|
||||
* make (B)
|
||||
* xproto / x11proto (B)
|
||||
|
@ -53,8 +52,6 @@ __R__ for runtime
|
|||
* xprop,xwininfo / x11-utils (R)
|
||||
* libpcre (B,R) (Will probably be made optional soon)
|
||||
* libconfig (B,R) (Will probably be made optional soon)
|
||||
* libdrm (B) (Will probably be made optional soon)
|
||||
* libGL (B,R) (Will probably be made optional soon)
|
||||
|
||||
To build, make sure you have the above dependencies:
|
||||
|
||||
|
|
|
@ -18,8 +18,7 @@ shadow-ignore-shaped = true;
|
|||
menu-opacity = 0.8;
|
||||
inactive-opacity = 0.8;
|
||||
frame-opacity = 0.7;
|
||||
inactive-opacity-override = false;
|
||||
alpha-step = 0.06;
|
||||
inactive-opacity-override = true;
|
||||
|
||||
# Fading
|
||||
fading = true;
|
||||
|
@ -32,8 +31,6 @@ fade-out-step = 0.03;
|
|||
mark-wmwin-focused = true;
|
||||
mark-ovredir-focused = true;
|
||||
detect-rounded-corners = true;
|
||||
detect-client-opacity = false;
|
||||
refresh-rate = 0;
|
||||
|
||||
# Window type settings
|
||||
wintypes:
|
||||
|
|
1
desc.txt
1
desc.txt
|
@ -1 +0,0 @@
|
|||
Compton is a X compositing window manager, fork of xcompmgr-dana.
|
1064
src/compton.c
Executable file → Normal file
1064
src/compton.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
198
src/compton.h
198
src/compton.h
|
@ -26,10 +26,6 @@
|
|||
// #define CONFIG_REGEX_PCRE_JIT 1
|
||||
// Whether to enable parsing of configuration files using libconfig
|
||||
// #define CONFIG_LIBCONFIG 1
|
||||
// Whether to enable DRM VSync support
|
||||
// #define CONFIG_VSYNC_DRM 1
|
||||
// Whether to enable OpenGL VSync support
|
||||
// #define CONFIG_VSYNC_OPENGL 1
|
||||
|
||||
// === Includes ===
|
||||
|
||||
|
@ -48,7 +44,6 @@
|
|||
#include <getopt.h>
|
||||
#include <stdbool.h>
|
||||
#include <locale.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <fnmatch.h>
|
||||
|
||||
|
@ -74,25 +69,10 @@
|
|||
#include <X11/extensions/Xdamage.h>
|
||||
#include <X11/extensions/Xrender.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
|
||||
#ifdef CONFIG_VSYNC_DRM
|
||||
#include <fcntl.h>
|
||||
// We references some definitions in drm.h, which could also be found in
|
||||
// /usr/src/linux/include/drm/drm.h, but that path is probably even less
|
||||
// reliable than libdrm
|
||||
#include <libdrm/drm.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_VSYNC_OPENGL
|
||||
#include <GL/glx.h>
|
||||
#endif
|
||||
|
||||
// === Constants ===
|
||||
#if !(COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2)
|
||||
#error libXcomposite version unsupported
|
||||
#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2
|
||||
#define HAS_NAME_WINDOW_PIXMAP 1
|
||||
#endif
|
||||
|
||||
#define ROUNDED_PERCENT 0.05
|
||||
|
@ -109,13 +89,6 @@ extern struct timeval time_start;
|
|||
#define WINDOW_TRANS 1
|
||||
#define WINDOW_ARGB 2
|
||||
|
||||
#define FADE_DELTA_TOLERANCE 0.2
|
||||
#define VSYNC_SW_TOLERANCE 1000
|
||||
|
||||
#define NS_PER_SEC 1000000000L
|
||||
#define US_PER_SEC 1000000L
|
||||
#define MS_PER_SEC 1000
|
||||
|
||||
// Window flags
|
||||
|
||||
// Window size is changed
|
||||
|
@ -183,7 +156,9 @@ typedef struct _win {
|
|||
struct _win *next;
|
||||
Window id;
|
||||
Window client_win;
|
||||
#if HAS_NAME_WINDOW_PIXMAP
|
||||
Pixmap pixmap;
|
||||
#endif
|
||||
XWindowAttributes a;
|
||||
#if CAN_DO_USABLE
|
||||
Bool usable; /* mapped and all damaged at one point */
|
||||
|
@ -219,12 +194,10 @@ typedef struct _win {
|
|||
opacity_t opacity;
|
||||
/// Target window opacity.
|
||||
opacity_t opacity_tgt;
|
||||
/// Opacity of current alpha_pict.
|
||||
opacity_t opacity_cur;
|
||||
/// Cached value of opacity window attribute.
|
||||
opacity_t opacity_prop;
|
||||
/// Cached value of opacity window attribute on client window. For
|
||||
/// broken window managers not transferring client window's
|
||||
/// _NET_WM_OPACITY value
|
||||
opacity_t opacity_prop_client;
|
||||
/// Alpha mask Picture to render window with opacity.
|
||||
Picture alpha_pict;
|
||||
|
||||
|
@ -240,6 +213,8 @@ typedef struct _win {
|
|||
// Frame-opacity-related members
|
||||
/// Current window frame opacity. Affected by window opacity.
|
||||
double frame_opacity;
|
||||
/// Opacity of current frame_alpha_pict.
|
||||
opacity_t frame_opacity_cur;
|
||||
/// Alpha mask Picture to render window frame with opacity.
|
||||
Picture frame_alpha_pict;
|
||||
/// Frame widths. Determined by client window attributes.
|
||||
|
@ -250,6 +225,8 @@ typedef struct _win {
|
|||
Bool shadow;
|
||||
/// Opacity of the shadow. Affected by window opacity and frame opacity.
|
||||
double shadow_opacity;
|
||||
/// Opacity of current shadow_pict.
|
||||
double shadow_opacity_cur;
|
||||
/// X offset of shadow. Affected by commandline argument.
|
||||
int shadow_dx;
|
||||
/// Y offset of shadow. Affected by commandline argument.
|
||||
|
@ -274,27 +251,10 @@ typedef struct _win {
|
|||
|
||||
Bool need_configure;
|
||||
XConfigureEvent queue_configure;
|
||||
/// Region to be ignored when painting. Basically the region where
|
||||
/// higher opaque windows will paint upon. Depends on window frame
|
||||
/// opacity state, window geometry, window mapped/unmapped state,
|
||||
/// window mode, of this and all higher windows.
|
||||
XserverRegion reg_ignore;
|
||||
|
||||
struct _win *prev_trans;
|
||||
} win;
|
||||
|
||||
typedef enum _vsync_t {
|
||||
VSYNC_NONE,
|
||||
VSYNC_SW,
|
||||
VSYNC_DRM,
|
||||
VSYNC_OPENGL,
|
||||
} vsync_t;
|
||||
|
||||
#ifdef CONFIG_VSYNC_OPENGL
|
||||
typedef int (*f_WaitVideoSync) (int, int, unsigned *);
|
||||
typedef int (*f_GetVideoSync) (unsigned *);
|
||||
#endif
|
||||
|
||||
typedef struct _options {
|
||||
// General
|
||||
char *display;
|
||||
|
@ -309,12 +269,6 @@ typedef struct _options {
|
|||
/// Whether to work under synchronized mode for debugging.
|
||||
Bool synchronize;
|
||||
|
||||
// VSync
|
||||
/// User-specified refresh rate.
|
||||
int refresh_rate;
|
||||
/// VSync method to use;
|
||||
vsync_t vsync;
|
||||
|
||||
// Shadow
|
||||
Bool wintype_shadow[NUM_WINTYPES];
|
||||
/// Red, green and blue tone of the shadow.
|
||||
|
@ -348,16 +302,9 @@ typedef struct _options {
|
|||
/// Whether inactive_opacity overrides the opacity set by window
|
||||
/// attributes.
|
||||
Bool inactive_opacity_override;
|
||||
/// Frame opacity. Relative to window opacity, also affects shadow
|
||||
/// opacity.
|
||||
double frame_opacity;
|
||||
/// Whether to detect _NET_WM_OPACITY on client windows. Used on window
|
||||
/// managers that don't pass _NET_WM_OPACITY to frame windows.
|
||||
Bool detect_client_opacity;
|
||||
/// How much to dim an inactive window. 0.0 - 1.0, 0 to disable.
|
||||
double inactive_dim;
|
||||
/// Step for pregenerating alpha pictures. 0.01 - 1.0.
|
||||
double alpha_step;
|
||||
|
||||
// Calculated
|
||||
/// Whether compton needs to track focus changes.
|
||||
|
@ -407,16 +354,6 @@ set_ignore(Display *dpy, unsigned long sequence);
|
|||
static int
|
||||
should_ignore(Display *dpy, unsigned long sequence);
|
||||
|
||||
/**
|
||||
* Subtract two unsigned long values.
|
||||
*
|
||||
* Truncate to 0 if the result is negative.
|
||||
*/
|
||||
static inline unsigned long
|
||||
sub_unslong(unsigned long a, unsigned long b) {
|
||||
return (a > b) ? a - b : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Bool array of all wintypes to true.
|
||||
*/
|
||||
|
@ -578,41 +515,6 @@ timeval_subtract(struct timeval *result,
|
|||
return x->tv_sec < y->tv_sec;
|
||||
}
|
||||
|
||||
/*
|
||||
* Subtracting two struct timespec values.
|
||||
*
|
||||
* Taken from glibc manual.
|
||||
*
|
||||
* Subtract the `struct timespec' values X and Y,
|
||||
* storing the result in RESULT.
|
||||
* Return 1 if the difference is negative, otherwise 0.
|
||||
*/
|
||||
static inline int
|
||||
timespec_subtract(struct timespec *result,
|
||||
struct timespec *x,
|
||||
struct timespec *y) {
|
||||
/* Perform the carry for the later subtraction by updating y. */
|
||||
if (x->tv_nsec < y->tv_nsec) {
|
||||
int nsec = (y->tv_nsec - x->tv_nsec) / NS_PER_SEC + 1;
|
||||
y->tv_nsec -= NS_PER_SEC * nsec;
|
||||
y->tv_sec += nsec;
|
||||
}
|
||||
|
||||
if (x->tv_nsec - y->tv_nsec > NS_PER_SEC) {
|
||||
int nsec = (x->tv_nsec - y->tv_nsec) / NS_PER_SEC;
|
||||
y->tv_nsec += NS_PER_SEC * nsec;
|
||||
y->tv_sec -= nsec;
|
||||
}
|
||||
|
||||
/* Compute the time remaining to wait.
|
||||
tv_nsec is certainly positive. */
|
||||
result->tv_sec = x->tv_sec - y->tv_sec;
|
||||
result->tv_nsec = x->tv_nsec - y->tv_nsec;
|
||||
|
||||
/* Return 1 if result is negative. */
|
||||
return x->tv_sec < y->tv_sec;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print time passed since program starts execution.
|
||||
*
|
||||
|
@ -675,7 +577,7 @@ free_damage(Display *dpy, Damage *p) {
|
|||
}
|
||||
|
||||
static unsigned long
|
||||
get_time_ms(void);
|
||||
get_time_in_milliseconds(void);
|
||||
|
||||
static int
|
||||
fade_timeout(void);
|
||||
|
@ -729,7 +631,8 @@ solid_picture(Display *dpy, Bool argb, double a,
|
|||
|
||||
static inline bool is_normal_win(const win *w) {
|
||||
return (WINTYPE_NORMAL == w->window_type
|
||||
|| WINTYPE_UTILITY == w->window_type);
|
||||
|| WINTYPE_UTILITY == w->window_type
|
||||
|| WINTYPE_UNKNOWN == w->window_type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -858,6 +761,9 @@ repair_win(Display *dpy, win *w);
|
|||
static wintype
|
||||
get_wintype_prop(Display * dpy, Window w);
|
||||
|
||||
static wintype
|
||||
determine_wintype(Display *dpy, Window w);
|
||||
|
||||
static void
|
||||
map_win(Display *dpy, Window id,
|
||||
unsigned long sequence, Bool fade,
|
||||
|
@ -869,14 +775,16 @@ finish_map_win(Display *dpy, win *w);
|
|||
static void
|
||||
finish_unmap_win(Display *dpy, win *w);
|
||||
|
||||
#if HAS_NAME_WINDOW_PIXMAP
|
||||
static void
|
||||
unmap_callback(Display *dpy, win *w);
|
||||
#endif
|
||||
|
||||
static void
|
||||
unmap_win(Display *dpy, Window id, Bool fade);
|
||||
|
||||
static opacity_t
|
||||
wid_get_opacity_prop(Display *dpy, Window wid, opacity_t def);
|
||||
get_opacity_prop(Display *dpy, win *w, opacity_t def);
|
||||
|
||||
static double
|
||||
get_opacity_percent(Display *dpy, win *w);
|
||||
|
@ -927,8 +835,10 @@ circulate_win(Display *dpy, XCirculateEvent *ce);
|
|||
static void
|
||||
finish_destroy_win(Display *dpy, Window id);
|
||||
|
||||
#if HAS_NAME_WINDOW_PIXMAP
|
||||
static void
|
||||
destroy_callback(Display *dpy, win *w);
|
||||
#endif
|
||||
|
||||
static void
|
||||
destroy_win(Display *dpy, Window id, Bool fade);
|
||||
|
@ -970,7 +880,7 @@ static void
|
|||
usage(void);
|
||||
|
||||
static void
|
||||
register_cm(Bool want_glxct);
|
||||
register_cm(int scr);
|
||||
|
||||
inline static void
|
||||
ev_focus_in(XFocusChangeEvent *ev);
|
||||
|
@ -1037,39 +947,6 @@ copy_region(Display *dpy, XserverRegion oldregion) {
|
|||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump a region.
|
||||
*/
|
||||
static inline void
|
||||
dump_region(Display *dpy, XserverRegion region) {
|
||||
int nrects = 0, i;
|
||||
XRectangle *rects = XFixesFetchRegion(dpy, region, &nrects);
|
||||
if (!rects)
|
||||
return;
|
||||
|
||||
for (i = 0; i < nrects; ++i)
|
||||
printf("Rect #%d: %8d, %8d, %8d, %8d\n", i, rects[i].x, rects[i].y,
|
||||
rects[i].width, rects[i].height);
|
||||
|
||||
XFree(rects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a region is empty.
|
||||
*
|
||||
* Keith Packard said this is slow:
|
||||
* http://lists.freedesktop.org/archives/xorg/2007-November/030467.html
|
||||
*/
|
||||
static inline Bool
|
||||
is_region_empty(Display *dpy, XserverRegion region) {
|
||||
int nrects = 0;
|
||||
XRectangle *rects = XFixesFetchRegion(dpy, region, &nrects);
|
||||
|
||||
XFree(rects);
|
||||
|
||||
return !nrects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a window to damaged area.
|
||||
*
|
||||
|
@ -1125,34 +1002,3 @@ get_cfg(int argc, char *const *argv);
|
|||
|
||||
static void
|
||||
get_atoms(void);
|
||||
|
||||
static void
|
||||
update_refresh_rate(Display *dpy);
|
||||
|
||||
static Bool
|
||||
vsync_sw_init(void);
|
||||
|
||||
static struct timespec
|
||||
vsync_sw_ntimeout(int timeout);
|
||||
|
||||
static Bool
|
||||
vsync_drm_init(void);
|
||||
|
||||
#ifdef CONFIG_VSYNC_DRM
|
||||
static int
|
||||
vsync_drm_wait(void);
|
||||
#endif
|
||||
|
||||
static Bool
|
||||
vsync_opengl_init(void);
|
||||
|
||||
#ifdef CONFIG_VSYNC_OPENGL
|
||||
static void
|
||||
vsync_opengl_wait(void);
|
||||
#endif
|
||||
|
||||
static Bool
|
||||
vsync_wait(Display *dpy, struct pollfd *fd, int timeout);
|
||||
|
||||
static void
|
||||
init_alpha_picts(Display *dpy);
|
||||
|
|
Loading…
Reference in a new issue