summaryrefslogtreecommitdiff
path: root/app/cwm/xutil.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2013-12-16 19:02:18 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2013-12-16 19:02:18 +0000
commit6607b5d582214cfff74e2f83b584112c17932cd6 (patch)
tree7c3e4a97f0701f4d291e6fb1851239bf83c68112 /app/cwm/xutil.c
parent235d74776abb4df5a96170b419044ae120b931dc (diff)
Implement support for EWMH's _NET_WM_STATE_FULLSCREEN hint.
Since we already have a form of 'maximize', we need to differentiate between 'maximize' and the new 'fullscreen' mode. The 'maximize' mode will continue to honor gap but now *retains* the border, matching the 'vert/horz maximize' behaviour. The new 'fullscreen' mode supports and follows the _NET_WM_STATE_FULLSCREEN hint, allowing the client perform additional window modifications; in this mode, cwm(1) will *ignore* gap, remove borders and freeze(move/resize) the client. Additionally, 'fullscreen' mode will remember various combinations of previous states. * default keybinding changes: CM-f 'fullscreen', CM-m 'maximize' (re-map as desired). Positive feedback from a few, testing and ok sthen@
Diffstat (limited to 'app/cwm/xutil.c')
-rw-r--r--app/cwm/xutil.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c
index 303346349..6b07c0414 100644
--- a/app/cwm/xutil.c
+++ b/app/cwm/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xutil.c,v 1.80 2013/12/13 14:40:52 okan Exp $
+ * $OpenBSD: xutil.c,v 1.81 2013/12/16 19:02:17 okan Exp $
*/
#include <sys/param.h>
@@ -333,6 +333,9 @@ xu_ewmh_handle_net_wm_state_msg(struct client_ctx *cc, int action,
{ _NET_WM_STATE_MAXIMIZED_HORZ,
CLIENT_HMAXIMIZED,
client_hmaximize },
+ { _NET_WM_STATE_FULLSCREEN,
+ CLIENT_FULLSCREEN,
+ client_fullscreen },
{ _NET_WM_STATE_DEMANDS_ATTENTION,
CLIENT_URGENCY,
client_urgency },
@@ -369,6 +372,8 @@ xu_ewmh_restore_net_wm_state(struct client_ctx *cc)
client_hmaximize(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_MAXIMIZED_VERT])
client_vmaximize(cc);
+ if (atoms[i] == ewmh[_NET_WM_STATE_FULLSCREEN])
+ client_fullscreen(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
client_urgency(cc);
}
@@ -386,14 +391,19 @@ xu_ewmh_set_net_wm_state(struct client_ctx *cc)
for (i = j = 0; i < n; i++) {
if (oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_HORZ] &&
oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_VERT] &&
+ oatoms[i] != ewmh[_NET_WM_STATE_FULLSCREEN] &&
oatoms[i] != ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
atoms[j++] = oatoms[i];
}
free(oatoms);
- if (cc->flags & CLIENT_HMAXIMIZED)
- atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_HORZ];
- if (cc->flags & CLIENT_VMAXIMIZED)
- atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_VERT];
+ if (cc->flags & CLIENT_FULLSCREEN)
+ atoms[j++] = ewmh[_NET_WM_STATE_FULLSCREEN];
+ else {
+ if (cc->flags & CLIENT_HMAXIMIZED)
+ atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_HORZ];
+ if (cc->flags & CLIENT_VMAXIMIZED)
+ atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_VERT];
+ }
if (cc->flags & CLIENT_URGENCY)
atoms[j++] = ewmh[_NET_WM_STATE_DEMANDS_ATTENTION];
if (j > 0)