summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2012-11-09 21:44:02 +0800
committerRichard Grenville <[email protected]>2012-11-09 22:16:41 +0800
commitbbe376ad1b4029f64ac3a89b4b7cc90a99eeaf1f (patch)
tree11612bd94d17b123315336d7ad8ec0244ca426da /compton.h
parent295bbf30c2cca975bcfd774fab61c3158ef460fc (diff)
downloadtdebase-bbe376ad1b4029f64ac3a89b4b7cc90a99eeaf1f.tar.gz
tdebase-bbe376ad1b4029f64ac3a89b4b7cc90a99eeaf1f.zip
Feature: Unredirect windows when there's a fullscreen window
- Optionally unredirect windows when there's a fullscreen opaque window on the top of the stack (--unredir-if-possible). Experimental. Known issues: * Screen flickers when redirecting/unredirecting windows. --paint-on-overlay seemingly minimizes it (Thanks for hints from mutter), but still noticeable. * It probably does not play well with vdpau in some cases. - A debug option DEBUG_REDIR is added. - Fix a bug that reg_ignore are not expired when a CirculateNotify is received. - Add extra safe guards in some places, which could be bad for performance. - Remove some abundant code.
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/compton.h b/compton.h
index b7a9d66eb..b66e77303 100644
--- a/compton.h
+++ b/compton.h
@@ -14,6 +14,7 @@
// #define DEBUG_CLIENTWIN 1
// #define DEBUG_WINDATA 1
// #define DEBUG_WINMATCH 1
+// #define DEBUG_REDIR 1
// #define MONITOR_REPAINT 1
// Whether to enable PCRE regular expression support in blacklists, enabled
@@ -367,6 +368,9 @@ typedef struct _options {
/// Whether to paint on X Composite overlay window instead of root
/// window.
Bool paint_on_overlay;
+ /// Whether to unredirect all windows if a full-screen opaque window
+ /// is detected.
+ Bool unredir_if_possible;
/// Whether to work under synchronized mode for debugging.
Bool synchronize;
@@ -960,12 +964,26 @@ update_reg_ignore_expire(const win *w) {
reg_ignore_expire = True;
}
+/**
+ * Check whether a window has WM frames.
+ */
static inline bool
win_has_frame(const win *w) {
return w->top_width || w->left_width || w->right_width
|| w->bottom_width;
}
+/**
+ * Check if a window is a fullscreen window.
+ *
+ * It's not using w->border_size for performance measures.
+ */
+static inline bool
+win_is_fullscreen(const win *w) {
+ return (w->a.x <= 0 && w->a.y <= 0 && (w->a.x + w->widthb) >= root_width
+ && (w->a.y + w->heightb) >= root_height && !w->bounding_shaped);
+}
+
static void
win_rounded_corners(Display *dpy, win *w);
@@ -1345,3 +1363,9 @@ init_dbe(void);
static void
init_overlay(void);
+
+static void
+redir_start(Display *dpy);
+
+static void
+redir_stop(Display *dpy);