From 3bd41b9a419fcf01250d614d1e05c8a79576dcd8 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Thu, 12 May 2016 11:25:18 +0200 Subject: [PATCH] window: Kill the window on delete-entry Signed-off-by: Quentin Glidic --- doc/rofi-manpage.markdown | 2 ++ doc/rofi.1 | 4 ++-- source/dialogs/window.c | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/rofi-manpage.markdown b/doc/rofi-manpage.markdown index 29c3cd39..31da0a27 100644 --- a/doc/rofi-manpage.markdown +++ b/doc/rofi-manpage.markdown @@ -712,10 +712,12 @@ A keybinding starting with `!` will act when all keys have been released. ### Window Show a list of all the windows and allow switching between them. +Pressing the `delete-entry` binding (`shift-delete`) will kill the window. ### WindowCD Shows a list of the windows on the current desktop and allows switching between them. +Pressing the `delete-entry` binding (`shift-delete`) will kill the window. ### Run diff --git a/doc/rofi.1 b/doc/rofi.1 index d44f8c1c..5654b70b 100644 --- a/doc/rofi.1 +++ b/doc/rofi.1 @@ -1166,10 +1166,10 @@ A keybinding starting with \fB!\fR will act when all keys have been released\. .SH "Available Modi" . .SS "Window" -Show a list of all the windows and allow switching between them\. +Show a list of all the windows and allow switching between them\. Pressing the \fBdelete\-entry\fR binding (\fBshift\-delete\fR) will kill the window\. . .SS "WindowCD" -Shows a list of the windows on the current desktop and allows switching between them\. +Shows a list of the windows on the current desktop and allows switching between them\. Pressing the \fBdelete\-entry\fR binding (\fBshift\-delete\fR) will kill the window\. . .SS "Run" Shows a list of executables in \fB$PATH\fR and can launch them (optional in a terminal)\. Pressing the \fBaccept\-custom\fR binding (\fBcontrol\-enter\fR or \fBshift\-enter\fR) will run the command in a terminal\. diff --git a/source/dialogs/window.c b/source/dialogs/window.c index 5b2fd249..2a9cedb0 100644 --- a/source/dialogs/window.c +++ b/source/dialogs/window.c @@ -590,6 +590,11 @@ static ModeMode window_mode_result ( Mode *sw, int mretv, G_GNUC_UNUSED char **i xcb_flush ( xcb->connection ); } } + else if ( ( mretv & ( MENU_ENTRY_DELETE ) ) == MENU_ENTRY_DELETE ) { + /* TODO: WM_DELETE_WINDOW support, see i3 */ + xcb_destroy_window ( xcb->connection, rmpd->ids->array[selected_line] ); + xcb_flush ( xcb->connection ); + } return retv; }