summaryrefslogtreecommitdiffstats
path: root/compton.c
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-07-26 12:52:16 +0800
committerRichard Grenville <[email protected]>2013-07-26 13:02:06 +0800
commit4f92672534b2ebb83616de98b40fb79761c0c2ac (patch)
tree46aa3bd831a5b8b1a40be17e4fc1a46c56c0aaad /compton.c
parentbd40b36f01e2f114b0647ec7365550fb9f610326 (diff)
downloadtdebase-4f92672534b2ebb83616de98b40fb79761c0c2ac.tar.gz
tdebase-4f92672534b2ebb83616de98b40fb79761c0c2ac.zip
Improvement #41: Enable/disable redirection through D-Bus
- Add "redirected_force" to D-Bus opts_get to forcefully redirect/unredirect windows. - Add D-Bus method "repaint", to, namely, repaint the screen.
Diffstat (limited to 'compton.c')
-rw-r--r--compton.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/compton.c b/compton.c
index 0f578791f..4cbeae7fa 100644
--- a/compton.c
+++ b/compton.c
@@ -1076,7 +1076,7 @@ get_alpha_pict_o(session_t *ps, opacity_t o) {
static win *
paint_preprocess(session_t *ps, win *list) {
// Initialize unredir_possible
- ps->unredir_possible = false;
+ bool unredir_possible = false;
win *w;
win *t = NULL, *next = NULL;
@@ -1229,13 +1229,13 @@ paint_preprocess(session_t *ps, win *list) {
last_reg_ignore = w->reg_ignore;
- if (is_highest && to_paint) {
+ if (ps->o.unredir_if_possible && is_highest && to_paint) {
is_highest = false;
// Disable unredirection for multi-screen setups
if (WMODE_SOLID == w->mode
&& (!w->frame_opacity || !win_has_frame(w))
&& win_is_fullscreen(ps, w))
- ps->unredir_possible = true;
+ unredir_possible = true;
}
// Reset flags
@@ -1259,12 +1259,13 @@ paint_preprocess(session_t *ps, win *list) {
}
// If possible, unredirect all windows and stop painting
- if (ps->o.unredir_if_possible && ps->unredir_possible) {
+ if (UNSET != ps->o.redirected_force)
+ unredir_possible = !ps->o.redirected_force;
+
+ if (unredir_possible)
redir_stop(ps);
- }
- else {
+ else
redir_start(ps);
- }
return t;
}
@@ -6365,6 +6366,7 @@ session_init(session_t *ps_old, int argc, char **argv) {
.paint_on_overlay = false,
.resize_damage = 0,
.unredir_if_possible = false,
+ .redirected_force = UNSET,
.dbus = false,
.benchmark = 0,
.benchmark_wid = None,
@@ -6435,7 +6437,6 @@ session_init(session_t *ps_old, int argc, char **argv) {
.all_damage_last = { None },
.time_start = { 0, 0 },
.redirected = false,
- .unredir_possible = false,
.alpha_picts = NULL,
.reg_ignore_expire = false,
.idling = false,