Skip to content

Instantly share code, notes, and snippets.

@fwsmit
Created April 4, 2021 17:06
Show Gist options
  • Save fwsmit/120497047c1c1d895dd6aa78999825fe to your computer and use it in GitHub Desktop.
Save fwsmit/120497047c1c1d895dd6aa78999825fe to your computer and use it in GitHub Desktop.
Mako patch for adding left-right anchors
diff --git a/config.c b/config.c
index 6d68205..2423dbf 100644
--- a/config.c
+++ b/config.c
@@ -597,6 +597,16 @@ static bool apply_style_option(struct mako_style *style, const char *name,
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT;
} else if (strcmp(value, "center") == 0) {
style->anchor = 0;
+ } else if (strcmp(value, "left-right") == 0) {
+ style->anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
+ ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
+ } else if (strcmp(value, "left-right-top") == 0) {
+ style->anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT |
+ ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
+ ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP;
+ } else if (strcmp(value, "top-bottom") == 0) {
+ style->anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
+ ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP;
} else {
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment