decor: Add menu option for minimize

This commit is contained in:
K. Lange 2023-04-16 14:44:41 +09:00
parent 9c01875fe1
commit ac6150e956

View File

@ -143,6 +143,12 @@ static void _decor_start_maximize(struct MenuEntry * self) {
yutani_focus_window(_decor_menu_owner_window->ctx, _decor_menu_owner_window->wid);
}
static void _decor_start_minimize(struct MenuEntry * self) {
if (!_decor_menu_owner_window)
return;
_decor_minimize(_decor_menu_owner_window->ctx, _decor_menu_owner_window);
}
static void _decor_close(struct MenuEntry * self) {
if (!_decor_menu_owner_window)
return;
@ -163,6 +169,7 @@ void init_decorations() {
_decor_menu = menu_create();
menu_insert(_decor_menu, menu_create_normal(NULL, NULL, "Maximize", _decor_start_maximize));
menu_insert(_decor_menu, menu_create_normal(NULL, NULL, "Minimize", _decor_start_minimize));
menu_insert(_decor_menu, menu_create_normal(NULL, NULL, "Move", _decor_start_move));
menu_insert(_decor_menu, menu_create_separator());
menu_insert(_decor_menu, menu_create_normal(NULL, NULL, "Close", _decor_close));