Skip to content

Commit

Permalink
Add --ewmh-no-fullscreen
Browse files Browse the repository at this point in the history
This arg reverts to the old behaviour of checking for fullscreen
windows.
  • Loading branch information
tatokis committed Jun 7, 2019
1 parent fe24e19 commit 1649082
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions man/compton.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
*--benchmark-wid* 'WINDOW_ID'::
Specify window ID to repaint in benchmark mode. If omitted or is 0, the whole screen is repainted.

*--use-damage*::
Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is fullscreen based only on its size and coordinates.

FORMAT OF CONDITIONS
--------------------
Some options accept a condition string to match certain windows. A condition string is formed by one or more conditions, joined by logical operators.
Expand Down
1 change: 1 addition & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
.focus_blacklist = NULL,
.detect_transient = false,
.detect_client_leader = false,
.no_ewmh_fullscreen = false,

.track_wdata = false,
.track_leader = false,
Expand Down
3 changes: 3 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ typedef struct options {
bool track_wdata;
/// Whether compton needs to track window leaders.
bool track_leader;

// Don't use EWMH to detect fullscreen applications
bool no_ewmh_fullscreen;
} options_t;

extern const char *const BACKEND_STRS[NUM_BKEND + 1];
Expand Down
2 changes: 2 additions & 0 deletions src/config_libconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
lcfg_lookup_bool(&cfg, "detect-transient", &opt->detect_transient);
// --detect-client-leader
lcfg_lookup_bool(&cfg, "detect-client-leader", &opt->detect_client_leader);
// --no-ewmh-fullscreen
lcfg_lookup_bool(&cfg, "no-ewmh-fullscreen", &opt->no_ewmh_fullscreen);
// --shadow-exclude
parse_cfg_condlst(&cfg, &opt->shadow_blacklist, "shadow-exclude");
// --fade-exclude
Expand Down
9 changes: 8 additions & 1 deletion src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,14 @@ static void usage(int ret) {
"--benchmark-wid window-id\n"
" Specify window ID to repaint in benchmark mode. If omitted or is 0,\n"
" the whole screen is repainted.\n"
"\n"
"--monitor-repaint\n"
" Highlight the updated area of the screen. For debugging the xrender\n"
" backend only.\n";
" backend only.\n"
"\n"
"--no-ewmh-fullscreen\n"
" Do not use EWMH to detect fullscreen windows. Reverts to checking\n"
" if a window is fullscreen based only on its size and coordinates.\n";
FILE *f = (ret ? stderr : stdout);
fputs(usage_text, f);
#undef WARNING_DISABLED
Expand Down Expand Up @@ -406,6 +411,7 @@ static const struct option longopts[] = {
{"experimental-backends", no_argument, NULL, 733},
{"monitor-repaint", no_argument, NULL, 800},
{"diagnostics", no_argument, NULL, 801},
{"no-ewmh-fullscreen", no_argument, NULL, 802},
// Must terminate with a NULL entry
{NULL, 0, NULL, 0},
};
Expand Down Expand Up @@ -775,6 +781,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
P_CASEBOOL(733, experimental_backends);
P_CASEBOOL(800, monitor_repaint);
case 801: opt->print_diagnostics = true; break;
P_CASEBOOL(802, no_ewmh_fullscreen);
default: usage(1); break;
#undef P_CASEBOOL
}
Expand Down
2 changes: 1 addition & 1 deletion src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -2145,7 +2145,7 @@ static inline bool win_is_fullscreen_xcb(xcb_connection_t *c, const struct atom
* It's not using w->border_size for performance measures.
*/
bool win_is_fullscreen(const session_t *ps, const struct managed_win *w) {
if(win_is_fullscreen_xcb(ps->c, ps->atoms, w->client_win))
if(!ps->o.no_ewmh_fullscreen && win_is_fullscreen_xcb(ps->c, ps->atoms, w->client_win))
return true;
return rect_is_fullscreen(ps, w->g.x, w->g.y, w->widthb, w->heightb) &&
(!w->bounding_shaped || w->rounded_corners);
Expand Down

0 comments on commit 1649082

Please sign in to comment.