]> git.mdlowis.com Git - proto/labwc.git/commit
view: account for base size in resize indicator
authorJohn Lindgren <john@jlindgren.net>
Fri, 22 Sep 2023 05:22:19 +0000 (01:22 -0400)
committerJohn Lindgren <john@jlindgren.net>
Tue, 26 Sep 2023 05:24:02 +0000 (01:24 -0400)
commitce36cbac2db9a949874ddbf269ae2bb813f36b73
tree60beb82974c0200580ea525ec2a408129d5cfd8b
parent48e0b3f6a6bc7a60d8414f5f366a9d7bc3f1c42e
view: account for base size in resize indicator

For views with a non-pixel size increment (e.g. X11 terminals), it's
helpful to subtract the base size of the window (typically including
menu bar, scrollbars, etc.) before computing the number of size
increments (e.g. cells/characters). This way, the displayed size will
exactly match the terminal grid (e.g. 80x25 or whatever).

wlr_box isn't really the best fit for size hints, so let's define a
struct view_size_hints and a nice view_get_size_hints() function,
wrapping view->impl->get_size_hints().

This also seems like a great opportunity to make view_adjust_size()
window-system-agnostic and eliminate xwayland_apply_size_hints().
include/view.h
include/xwayland.h
src/ssd/resize_indicator.c
src/view.c
src/xwayland.c