Last active
September 24, 2023 01:26
-
-
Save ortango/f6befe8b9d6406db5c551fa05829f65b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ruN a/src/events.c b/src/events.c | |
--- a/src/events.c 2023-09-20 13:19:04.638950917 -0400 | |
+++ b/src/events.c 2023-09-21 15:50:17.182394979 -0400 | |
@@ -474,20 +474,35 @@ | |
void handle_state(monitor_t *m, desktop_t *d, node_t *n, xcb_atom_t state, unsigned int action) | |
{ | |
if (state == ewmh->_NET_WM_STATE_FULLSCREEN) { | |
- if (action == XCB_EWMH_WM_STATE_ADD && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) { | |
- set_state(m, d, n, STATE_FULLSCREEN); | |
- } else if (action == XCB_EWMH_WM_STATE_REMOVE && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0) { | |
- if (n->client->state == STATE_FULLSCREEN) { | |
- set_state(m, d, n, n->client->last_state); | |
- } | |
+ if (action == XCB_EWMH_WM_STATE_ADD) { | |
+ if ((ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) { | |
+ set_state(m, d, n, STATE_FULLSCREEN); | |
+ arrange(m, d); | |
+ } else { | |
+ n->client->wm_flags |= WM_FLAG_FULLSCREEN; | |
+ ewmh_wm_state_update(n); | |
+ } | |
+ } else if (action == XCB_EWMH_WM_STATE_REMOVE) { | |
+ if ((ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0) { | |
+ if (n->client->state == STATE_FULLSCREEN) { | |
+ set_state(m, d, n, n->client->last_state); | |
+ arrange(m, d); | |
+ } | |
+ } else { | |
+ n->client->wm_flags &= ~WM_FLAG_FULLSCREEN; | |
+ ewmh_wm_state_update(n); | |
+ } | |
} else if (action == XCB_EWMH_WM_STATE_TOGGLE) { | |
client_state_t next_state = IS_FULLSCREEN(n->client) ? n->client->last_state : STATE_FULLSCREEN; | |
if ((next_state == STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) || | |
(next_state != STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0)) { | |
set_state(m, d, n, next_state); | |
- } | |
+ arrange(m, d); | |
+ } else { | |
+ n->client->wm_flags ^= WM_FLAG_FULLSCREEN; | |
+ ewmh_wm_state_update(n); | |
+ } | |
} | |
- arrange(m, d); | |
} else if (state == ewmh->_NET_WM_STATE_BELOW) { | |
if (action == XCB_EWMH_WM_STATE_ADD) { | |
set_layer(m, d, n, LAYER_BELOW); | |
diff -ruN a/src/tree.c b/src/tree.c | |
--- a/src/tree.c 2023-09-20 13:19:04.642284396 -0400 | |
+++ b/src/tree.c 2023-09-21 15:50:17.182394979 -0400 | |
@@ -1968,6 +1968,8 @@ | |
client_t *c = n->client; | |
+ unsigned int wmfs = (WM_FLAG_FULLSCREEN & c->wm_flags); | |
+ | |
cancel_presel(m, d, n); | |
if (!n->hidden) { | |
set_vacant(m, d, n, value); | |
@@ -1981,8 +1983,8 @@ | |
neutralize_occluding_windows(m, d, n); | |
} | |
} | |
- | |
- ewmh_wm_state_update(n); | |
+ if (wmfs != (WM_FLAG_FULLSCREEN & c->wm_flags)) | |
+ ewmh_wm_state_update(n); | |
stack(d, n, (d->focus == n)); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ruN a/src/events.c b/src/events.c | |
--- a/src/events.c 2023-09-20 13:19:04.638950917 -0400 | |
+++ b/src/events.c 2023-09-20 13:08:30.901066166 -0400 | |
@@ -475,19 +475,19 @@ | |
{ | |
if (state == ewmh->_NET_WM_STATE_FULLSCREEN) { | |
if (action == XCB_EWMH_WM_STATE_ADD && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) { | |
- set_state(m, d, n, STATE_FULLSCREEN); | |
+ n->client->wm_flags |= WM_FLAG_FULLSCREEN; | |
} else if (action == XCB_EWMH_WM_STATE_REMOVE && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0) { | |
if (n->client->state == STATE_FULLSCREEN) { | |
- set_state(m, d, n, n->client->last_state); | |
+ n->client->wm_flags &= ~WM_FLAG_FULLSCREEN; | |
} | |
} else if (action == XCB_EWMH_WM_STATE_TOGGLE) { | |
client_state_t next_state = IS_FULLSCREEN(n->client) ? n->client->last_state : STATE_FULLSCREEN; | |
if ((next_state == STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) || | |
(next_state != STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0)) { | |
- set_state(m, d, n, next_state); | |
+ n->client->wm_flags ^= WM_FLAG_FULLSCREEN; | |
} | |
} | |
- arrange(m, d); | |
+ ewmh_wm_state_update(n); | |
} else if (state == ewmh->_NET_WM_STATE_BELOW) { | |
if (action == XCB_EWMH_WM_STATE_ADD) { | |
set_layer(m, d, n, LAYER_BELOW); | |
diff -ruN a/src/tree.c b/src/tree.c | |
--- a/src/tree.c 2023-09-20 13:19:04.642284396 -0400 | |
+++ b/src/tree.c 2023-09-20 13:09:25.540071228 -0400 | |
@@ -1973,16 +1973,10 @@ | |
set_vacant(m, d, n, value); | |
} | |
- if (value) { | |
- c->wm_flags |= WM_FLAG_FULLSCREEN; | |
- } else { | |
- c->wm_flags &= ~WM_FLAG_FULLSCREEN; | |
- if (d->focus == n) { | |
- neutralize_occluding_windows(m, d, n); | |
- } | |
+ if (!value && d->focus == n) { | |
+ neutralize_occluding_windows(m, d, n); | |
} | |
- ewmh_wm_state_update(n); | |
stack(d, n, (d->focus == n)); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-hack: remove WM_FLAG_FULLSCREEN from set_fullscreen, and remove set_fullscreen from _NET_WM_STATE_FULLSCREEN event.
-hack-alt: _NET_WM_STATE_FULLSCREEN event will always set/unset _NET_WM_STATE_FULLSCREEN regardless of
ignore_ewmh_fullscreen
, but not always set STATE_FULLSCREEN or vacant, etc depending on ignore_ewmh_fullscreen.