mirror of
https://codeberg.org/adnano/wmenu.git
synced 2025-11-05 13:29:53 -05:00
add center flag
This commit is contained in:
parent
0a38d45abb
commit
c417daa0a0
3 changed files with 28 additions and 8 deletions
17
wayland.c
17
wayland.c
|
|
@ -448,10 +448,19 @@ int menu_run(struct menu *menu) {
|
|||
|
||||
uint32_t anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
|
||||
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
|
||||
if (menu->bottom) {
|
||||
anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
|
||||
} else {
|
||||
anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP;
|
||||
|
||||
switch (menu->position) {
|
||||
|
||||
case POSITION_BOTTOM:
|
||||
anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
|
||||
break;
|
||||
case POSITION_TOP:
|
||||
anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP;
|
||||
break;
|
||||
case POSITION_CENTER:
|
||||
anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
|
||||
// we will handle this in rendering.
|
||||
break;
|
||||
}
|
||||
|
||||
zwlr_layer_surface_v1_set_anchor(layer_surface, anchor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue