Skip to content

Skip empty parts for stringToEnum template

Gary Wang requested to merge garywang/layer-shell-qt:test-enum into master

metaEnum.keyToValue("") will results all flags get set, thus creating an enum with empty (0) flags become impossible. This patch fixes that so developers can use layershellqt-test to test the case that the window is centered (i.e. no anchors is set).

To test the issue, run the following command:

$ ./bin/layershellqt-test --layer LayerTop --anchors="" --width 114 --height 514
  • Before the fix: The test window will take all the spaces of the screen, the size of the window was ignored.
  • After the fix: The test window with size as (114, 514) gets shown centered on the screen.

By the way, what would happen if anchors on opposing sides were set? It was the reason that I found this bug, and I personally think we shouldn't set the width and/or height to zero when that happens. See also: Sway: anchors on opposing sides do not center the layer-shell

Edited by Gary Wang

Merge request reports