diff --git a/config/config.c b/config/config.c index 7b282256..14e13ee4 100644 --- a/config/config.c +++ b/config/config.c @@ -67,5 +67,6 @@ Settings config = { .wmode = VERTICAL, // Padding of the window. .padding = 5, - .show_title = 1 + .show_title = 1, + .y_offset = 0 }; diff --git a/include/rofi.h b/include/rofi.h index 9b0c4b52..cb586620 100644 --- a/include/rofi.h +++ b/include/rofi.h @@ -101,8 +101,10 @@ typedef struct _Settings WindowLocation location; WindowMode wmode; unsigned int padding; + int y_offset; unsigned int show_title; + } Settings; extern Settings config; diff --git a/source/rofi.c b/source/rofi.c index 3fcfb837..ca9f3105 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1227,6 +1227,8 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi default: break; } + // Apply offset. + y+= config.y_offset; XMoveResizeWindow ( display, box, x, y, w, h ); diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 0ddde0f2..f6f3d50f 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -63,7 +63,8 @@ XrmOption xrmOptions[] = { { xrm_Number, "padding", { .num = &config.padding } }, { xrm_Number, "borderwidth", { .num = &config.menu_bw } }, { xrm_String, "terminal", { .str = &config.terminal_emulator } }, - { xrm_Number, "location", { .num = &config.location} }, + { xrm_Number, "location", { .num = &config.location } }, + { xrm_Number, "yoffset", { .num = &config.y_offset } }, };