From 807f09c94f9854056c154aca1c9dfad5865b7fd0 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 27 Mar 2015 15:48:54 +0200 Subject: [PATCH] terminal: add "Minimize" to context menu Terminal is a nice app that support fullscreening. To be able to test minimizing of a fullscreen app, add an entry to the context menu. That is the only way to minimize, as window frame is not there when fullscreen. Signed-off-by: Pekka Paalanen --- clients/terminal.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clients/terminal.c b/clients/terminal.c index 3e89bdf5..739d1d42 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -2680,6 +2680,12 @@ recompute_selection(struct terminal *terminal) return 1; } +static void +terminal_minimize(struct terminal *terminal) +{ + window_set_minimized(terminal->window); +} + static void menu_func(void *data, struct input *input, int index) { @@ -2698,6 +2704,9 @@ menu_func(void *data, struct input *input, int index) case 2: terminal_paste(terminal, input); break; + case 3: + terminal_minimize(terminal); + break; } } @@ -2706,7 +2715,7 @@ show_menu(struct terminal *terminal, struct input *input, uint32_t time) { int32_t x, y; static const char *entries[] = { - "Open Terminal", "Copy", "Paste" + "Open Terminal", "Copy", "Paste", "Minimize" }; input_get_position(input, &x, &y);