summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorIlia Bozhinov <ammen99@gmail.com>2019-03-25 22:21:17 +0100
committerJari Vetoniemi <mailRoxas@gmail.com>2019-03-25 23:21:17 +0200
commit38069992ec97aa22da84a1e1dbb5e8ff9cd03d60 (patch)
tree4c476d8c56c8b1fe84c7858b6c8b61a46cadae21 /client
parentb375ef8b0bd2c40b4fc26bd0c4d38dcb4374c149 (diff)
downloadbemenu-38069992ec97aa22da84a1e1dbb5e8ff9cd03d60.tar.gz
bemenu-38069992ec97aa22da84a1e1dbb5e8ff9cd03d60.tar.bz2
bemenu-38069992ec97aa22da84a1e1dbb5e8ff9cd03d60.zip
Add option to respect panel position (#48)
* implement option to make menu respect panel boundaries * fixup! implement option to make menu respect panel boundaries
Diffstat (limited to 'client')
-rw-r--r--client/common/common.c8
-rw-r--r--client/common/common.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/client/common/common.c b/client/common/common.c
index f59088c..7633d7f 100644
--- a/client/common/common.c
+++ b/client/common/common.c
@@ -84,6 +84,7 @@ usage(FILE *out, const char *name)
" -b, --bottom appears at the bottom of the screen. (wx)\n"
" -f, --grab show the menu before reading stdin. (wx)\n"
+ " -n, --no-overlap adjust geometry to not overlap with panels. (w)\n"
" -m, --monitor index of monitor where menu will appear. (x)\n"
" --fn defines the font to be used ('name [size]'). (wx)\n"
" --tb defines the title background color. (wx)\n"
@@ -122,6 +123,7 @@ parse_args(struct client *client, int *argc, char **argv[])
{ "bottom", no_argument, 0, 'b' },
{ "grab", no_argument, 0, 'f' },
+ { "no-overlap", no_argument, 0, 'n' },
{ "monitor", required_argument, 0, 'm' },
{ "fn", required_argument, 0, 0x101 },
{ "tb", required_argument, 0, 0x102 },
@@ -146,7 +148,7 @@ parse_args(struct client *client, int *argc, char **argv[])
* or parse them before running getopt.. */
for (;;) {
- int32_t opt = getopt_long(*argc, *argv, "hviwl:I:p:P:I:bfm:", opts, NULL);
+ int32_t opt = getopt_long(*argc, *argv, "hviwl:I:p:P:I:bfm:n", opts, NULL);
if (opt < 0)
break;
@@ -192,6 +194,9 @@ parse_args(struct client *client, int *argc, char **argv[])
case 'm':
client->monitor = strtol(optarg, NULL, 10);
break;
+ case 'n':
+ client->no_overlap = true;
+ break;
case 0x101:
client->font = optarg;
@@ -284,6 +289,7 @@ run_menu(const struct client *client, struct bm_menu *menu, void (*item_cb)(stru
{
bm_menu_set_highlighted_index(menu, client->selected);
bm_menu_grab_keyboard(menu, true);
+ bm_menu_set_panel_overlap(menu, !client->no_overlap);
if (client->ifne && !bm_menu_get_items(menu, NULL))
return BM_RUN_RESULT_CANCEL;
diff --git a/client/common/common.h b/client/common/common.h
index 66587f2..cf258af 100644
--- a/client/common/common.h
+++ b/client/common/common.h
@@ -17,6 +17,7 @@ struct client {
bool grab;
bool wrap;
bool ifne;
+ bool no_overlap;
};
void parse_args(struct client *client, int *argc, char **argv[]);