]> git.mdlowis.com Git - proto/labwc.git/commit
view: implement separate horizontal/vertical maximize
authorJohn Lindgren <john@jlindgren.net>
Thu, 26 Oct 2023 04:38:29 +0000 (00:38 -0400)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 28 Oct 2023 20:46:49 +0000 (22:46 +0200)
commit0430f6f8184c17e6abf7922396217ecfb46f17ec
tree393230c6eadea5c302965a7bb2cc7e4c355cd732
parent7b644b3b9476bfe0fe16c7bd25fe70afa6452970
view: implement separate horizontal/vertical maximize

This is a useful (if lesser-known) feature of at least a few popular X11
window managers, for example Openbox and XFWM4. Typically right-click on
the maximize button toggles horizontal maximize, while middle-click
toggles vertical maximize.

Support in labwc uses the same configuration syntax as Openbox, where the
Maximize/ToggleMaximize actions have an optional "direction" argument:
horizontal, vertical, or both (default). The default mouse bindings match
the XFWM4 defaults (not sure what Openbox has by default).

Most of the external protocols still assume "maximized" is a Boolean,
which is no longer true internally. For the sake of the outside world,
a view is only "maximized" if maximized in both directions.

Internally, I've taken the following approach:

- SSD code decorates the view as "maximized" (i.e. hiding borders) only
  if maximized in both directions.

- Layout code (interactive move/resize, tiling, etc.) generally treats
  the view as "maximized" (with the restrictions that entails) if
  maximized in either direction. For example, moving a vertically-
  maximized view first restores the natural geometry (this differs from
  Openbox, which instead allows the view to move only horizontally.)

v2: use enum view_axis for view->maximized
v3:
  - update docs
  - allow resizing if partly maximized
  - add TODOs & corrections noted by Consolatis
15 files changed:
docs/labwc-actions.5.scd
docs/rc.xml.all
include/view.h
src/action.c
src/config/rcxml.c
src/foreign.c
src/interactive.c
src/snap.c
src/ssd/ssd.c
src/ssd/ssd_border.c
src/ssd/ssd_extents.c
src/ssd/ssd_titlebar.c
src/view.c
src/xdg.c
src/xwayland.c