]> git.mdlowis.com Git - proto/labwc.git/commit
menu: improve algorithm for menu placement with xdg-positioner
authortokyo4j <hrak1529@gmail.com>
Mon, 25 Nov 2024 21:42:08 +0000 (06:42 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Sun, 15 Dec 2024 02:43:23 +0000 (11:43 +0900)
commit40c7350064cb6a3a7dfb9f5c4c50f71e03a09918
tree5ea67afef0616ca4f007ca79284d6335fb478807
parent08de4f3d6bb29a942e3dea42fdaee294eb8d746c
menu: improve algorithm for menu placement with xdg-positioner

This commit delegates the calculation for menu position into wlroots
utilities for xdg_positioner.

Notable functional changes are:
- Slide the menu to fit in the output when it's opened out of the output
  (e.g. top-left window menu is opened when the window is overflowing to
  the left), rather than not updating the menu at all.
- The horizontal alignment of menus is now determined based on the size of
  each (sub)menu alone rather than the total width of entire menu tree.
  This means submenus can now overlap with is parents, but this is no
  longer a problem since we recently added support for menu borders.
- Fixed that pipemenus always follow the alignment of its parent even when
  it overflows from the output.
include/menu/menu.h
src/menu/menu.c