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
@@ -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 */
- 0, 0, 0);
+ /* Middle button. Close the application. */
+ Xclimsgwm(tk->win, a_WM_PROTOCOLS, a_WM_DELETE_WINDOW);
else if (event->button == 3)
Then cd to the directory you saved the patch to, download lxpanel, apply the patch and build.
Code: Select all
sudo apt-get install automake build-essential libltdl-dev libtool libasound2-dev libwnck-dev intltool libmenu-cache1 libmenu-cache1-dev libgtk2.0-dev git
git clone git://lxde.git.sourceforge.net/gitroot/lxde/lxpanel
#Apply the patch
git apply ../taskbar-middleclicktoclose.patch
#Build and install
./configure --enable-man #ignore enable-man error...
sudo make install
#log out and in again.
Note: this will install the entire lxpanel manually to /usr/local and won't be managed by the package manager. I don't know anything about building deb packages so didn't try to install it "properly". To uninstall: sudo rm -rf `locate lxpanel|grep /usr/local`
Thanks to vlad2005's post on compiling lxpanel which got me started.