]> git.mdlowis.com Git - proto/labwc.git/commit
view: Tidy up view->output/view->fullscreen redundancy
authorJohn Lindgren <john@jlindgren.net>
Wed, 15 Feb 2023 07:12:22 +0000 (02:12 -0500)
committerJohn Lindgren <john@jlindgren.net>
Fri, 17 Feb 2023 11:59:39 +0000 (06:59 -0500)
commit49c94660391b0ea6e77d7e3abe608e17f8b239c5
tree707998e932ead399ca4411182b5e722ed45c0104
parent6efc6a9db41fec64a77e136fc599c22293dcac49
view: Tidy up view->output/view->fullscreen redundancy

A fullscreen view currently has its output specified twice by:
  - struct output *output
  - struct wlr_output *fullscreen

view->fullscreen may also become a dangling pointer if the output is
disconnected, because view_on_output_destroy() clears view->output but
not view->fullscreen.

To eliminate the redundancy and the dangling pointer, let's change
view->fullscreen to a Boolean and rely on view->output to specify the
output.

Along the way, change a few related usages of struct wlr_output to
struct output as well.

No functional change intended.

v2: Don't allow entering fullscreen on disabled output (makes
    conditions for entering/leaving fullscreen symmetric)
v3: Use output_is_usable() helper
include/view.h
src/view.c
src/xdg.c