Skip to content

Commit

Permalink
interface: Allows Delete key to kill processes
Browse files Browse the repository at this point in the history
The delete key now can kill selected processes as Ctrl-K can while
the menu entry displaying the Ctrl+K shortcut remains. The purpose of
this is to allow convenience for those who are switching over from
gnome-system-monitor or other process managers which allow the
delete key to kill selected processes. This was accomplished by
adding an accelerator item with the delete key as the accelerator
and putting the menu entry of the KillProcess_Del on top of the
KillProcess menu entry so the latter shows over the former.

Issue mate-desktop#101
  • Loading branch information
Yetoo1 committed Apr 15, 2018
1 parent bf08ac4 commit 799c172
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
59 changes: 59 additions & 0 deletions a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From 1198265841e2560f878341414c6019aa29a151d8 Mon Sep 17 00:00:00 2001
From: Yetoo1 <[email protected]>
Date: Wed, 11 Oct 2017 09:59:58 -0700
Subject: [PATCH] interface: Allows Delete key to kill processes

The delete key now can kill selected processes as Ctrl-K can while
the menu entry displaying the Ctrl+K shortcut remains. The purpose of
this is to allow convenience for those who are switching over from
gnome-system-monitor or other process managers which allow the
delete key to kill selected processes. This was accomplished by
adding an accelerator item with the delete key as the accelerator
and putting the menu entry of the KillProcess_Del on top of the
KillProcess menu entry so the latter shows over the former.

Issue #101
---
src/interface.cpp | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/src/interface.cpp b/src/interface.cpp
index bacab98..3e41a62 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -66,6 +66,8 @@ static const GtkActionEntry menu_entries[] =

{ "EndProcess", NULL, N_("_End Process"), "<control>E",
N_("Force process to finish normally"), G_CALLBACK (cb_end_process) },
+ { "KillProcess_Del", NULL, N_("_Kill Process"), "Delete",
+ N_("Force process to finish immediately"), G_CALLBACK (cb_kill_process) },
{ "KillProcess", NULL, N_("_Kill Process"), "<control>K",
N_("Force process to finish immediately"), G_CALLBACK (cb_kill_process) },
{ "ChangePriority", NULL, N_("_Change Priority"), NULL,
@@ -137,6 +139,7 @@ static const char ui_info[] =
" <menuitem name=\"EditContProcessMenu\" action=\"ContProcess\" />"
" <separator />"
" <menuitem name=\"EditEndProcessMenu\" action=\"EndProcess\" />"
+ " <menuitem name=\"EditKillProcessMenu\" action=\"KillProcess_Del\" />"
" <menuitem name=\"EditKillProcessMenu\" action=\"KillProcess\" />"
" <separator />"
" <menu name=\"EditChangePriorityMenu\" action=\"ChangePriority\" >"
@@ -175,6 +178,7 @@ static const char ui_info[] =
" <menuitem action=\"ContProcess\" />"
" <separator />"
" <menuitem action=\"EndProcess\" />"
+ " <menuitem action=\"KillProcess_Del\" />"
" <menuitem action=\"KillProcess\" />"
" <separator />"
" <menu name=\"ChangePriorityMenu\" action=\"ChangePriority\" >"
@@ -835,6 +839,7 @@ update_sensitivity(ProcData *data)
const char * const selected_actions[] = { "StopProcess",
"ContProcess",
"EndProcess",
+ "KillProcess_Del"
"KillProcess",
"ChangePriority",
"MemoryMaps",
--
2.14.1

5 changes: 5 additions & 0 deletions src/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static const GtkActionEntry menu_entries[] =

{ "EndProcess", NULL, N_("_End Process"), "<control>E",
N_("Force process to finish normally"), G_CALLBACK (cb_end_process) },
{ "KillProcess_Del", NULL, N_("_Kill Process"), "Delete",
N_("Force process to finish immediately"), G_CALLBACK (cb_kill_process) },
{ "KillProcess", NULL, N_("_Kill Process"), "<control>K",
N_("Force process to finish immediately"), G_CALLBACK (cb_kill_process) },
{ "ChangePriority", NULL, N_("_Change Priority"), NULL,
Expand Down Expand Up @@ -137,6 +139,7 @@ static const char ui_info[] =
" <menuitem name=\"EditContProcessMenu\" action=\"ContProcess\" />"
" <separator />"
" <menuitem name=\"EditEndProcessMenu\" action=\"EndProcess\" />"
" <menuitem name=\"EditKillProcessMenu\" action=\"KillProcess_Del\" />"
" <menuitem name=\"EditKillProcessMenu\" action=\"KillProcess\" />"
" <separator />"
" <menu name=\"EditChangePriorityMenu\" action=\"ChangePriority\" >"
Expand Down Expand Up @@ -175,6 +178,7 @@ static const char ui_info[] =
" <menuitem action=\"ContProcess\" />"
" <separator />"
" <menuitem action=\"EndProcess\" />"
" <menuitem action=\"KillProcess_Del\" />"
" <menuitem action=\"KillProcess\" />"
" <separator />"
" <menu name=\"ChangePriorityMenu\" action=\"ChangePriority\" >"
Expand Down Expand Up @@ -780,6 +784,7 @@ update_sensitivity(ProcData *data)
const char * const selected_actions[] = { "StopProcess",
"ContProcess",
"EndProcess",
"KillProcess_Del"
"KillProcess",
"ChangePriority",
"MemoryMaps",
Expand Down

0 comments on commit 799c172

Please sign in to comment.