I'm running Mint 12 LXDE on a 9" netbook. To save a bit of vertical space I remove window decorations from maximised windows. I got a bit tired of right-clicking and selecting "close" on the LXPanel task bar/window list icons to exit an application (or Alt-F4) and really like the middle-click to close functionality of the Cinnamon panel I run on another computer. So I decided to mess around in the LXPanel source and I got middle-click to close working in the LXPanel taskbar plugin! (note I'm not a C coder, I just know how to G----- err I mean Duck Duck Go).
Save the following as 'taskbar-middleclicktoclose.patch'
Code: Select all
diff --git a/src/plugins/taskbar.c b/src/plugins/taskbar.c
index ea822d9..f8313ea 100644
--- a/src/plugins/taskbar.c
+++ b/src/plugins/taskbar.c
@@ -1112,11 +1112,8 @@ static gboolean taskbar_task_control_event(GtkWidget * widget, GdkEventButton *
}
else if (event->button == 2)
{
- /* Middle button. Toggle the shaded state of the window. */
- Xclimsg(tk->win, a_NET_WM_STATE,
- 2, /* a_NET_WM_STATE_TOGGLE */
- a_NET_WM_STATE_SHADED,
- 0, 0, 0);
+ /* Middle button. Close the application. */
+ Xclimsgwm(tk->win, a_WM_PROTOCOLS, a_WM_DELETE_WINDOW);
}
else if (event->button == 3)
{
Code: Select all
#install dependencies
sudo apt-get install automake build-essential libltdl-dev libtool libasound2-dev libwnck-dev intltool libmenu-cache1 libmenu-cache1-dev libgtk2.0-dev git
#Get LXPanel
git clone git://lxde.git.sourceforge.net/gitroot/lxde/lxpanel
#Apply the patch
git apply ../taskbar-middleclicktoclose.patch
#Build and install
./autogen.sh
./configure --enable-man #ignore enable-man error...
make
sudo make install
#log out and in again.
Thanks to vlad2005's post on compiling lxpanel which got me started.