The KWin Button Applet
March 24, 2010
I like to save screen estate, and in the latest iteration of my workspace layout, I have eliminated another 20px vertical space. I noticed that I’m mostly working in maximized windows. Their titlebar is nearly empty due to my wide notebook screen. What a waste!
Solution: Move the panel to the top and make it cover the titlebar of the maximized window.
Problem: The panel is bigger than the titlebar, and therefore covering the toolbar.
Solution: Make the titlebar bigger (Oxygen windeco allows to make the buttons bigger), then make the panel size match the titlebar size.
Next problem: There are buttons in the titlebar which I might need.
Immediate solution: Resize the panel to not cover these buttons. But that does not work because I’m regularly changing my screen resolution when wiring up my notebook to a projector.
Slightly harder solution: Implement the titlebar buttons as a Plasma applet. (Sounds harder than it is, thanks to libtaskmanager from kdebase-workspace.) Because this is something others might find useful, I’ve shared these 200 lines of code.
Updates:
- Aaron Seigo points out that plasma-netbook comes with a quite similar applet called “Current Application Control”, which combines all buttons into one, together with the title of the current application.
- Christian adds that KWin has built-in support for removing the decoration from maximized windows automatically, although this option is not presented in the GUI. To activate this option, set “BorderlessMaximizedWindows=true” in the “[Windows]” section of your kwinrc (usually found at .kde/share/config/kwinrc or .kde4/share/config/kwinrc in your home directory). Then fire up KRunner and run “kwin –replace” to restart KWin.
- Luboš Luňák announces the immediate availability of an openSUSE build service package for the kwinbuttonapplet. I have added this information to the kde-look page.
Thanks to all commenters!
March 24, 2010 at 22:40
you can heven save more space a n making the aplications more usable but making tose buttons on a small auto hide pannel on top and puting the traditional pannel in the bottom,
this will give you infinite hit area for the appplication menus 😉
March 24, 2010 at 23:02
Thank you. I work in a similar way and have wanted something like this.
I’ve never been able to figure out how to make Max Window == borderless in a sane, obviously reversible way, but the button plasmoids are a good chunk of what I want.
March 24, 2010 at 23:13
> Implement the titlebar buttons as a Plasma applet
plasma-netbook ships with a plasmoid called currentappcontrol (sexy, i know 😉 that provides window controls. it is not a 100% replica of what you’ve done, but it’s quite close. it’s in kdebase/workspace/plasma/netbook/applets/currentappcontrol/
in combination with some kwin settings, plasma-netbook manages to give you exactly the layout you have there, swapping out the tasks widget for an activities switcher (you switch tasks by clicking on the name of the current window, which triggers expose)
March 24, 2010 at 23:17
I got as far as the last step, and was left wondering if it would be possible to have window buttons on the panel. you solved that.
this should be perfect for netbook screens as well. kde netbook remix default maybe?
March 24, 2010 at 23:38
¡ like it !
March 24, 2010 at 23:47
Linking CXX shared module lib/plasma_applet_kwinbutton.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lKDE4Workspace__taskmanager
collect2: ld returned 1 exit status
!= like
March 24, 2010 at 23:51
You have to install kdebase-workspace-dev etc.
March 24, 2010 at 23:49
Hi Stefan!
Thank you very much for sharing your applet. It is really useful to me. I was looking for such applet already because I remove the window title bar from maximized windows to save screen space.
You say you accomplish it by making the panel cover the window title bar. Well, KDE has a better way for this, it’s sometimes called netbook mode. Just add the line “BorderlessMaximizedWindows=true” into the [Windows] section of your .kde/share/config/kwinrc – and from now on KDE will show maximized windows borderless.
Greetings,
Chris
April 1, 2010 at 14:55
Nice. Very nice.
January 6, 2013 at 09:52
Thanks for BorderlessMaximizedWindows option!
March 25, 2010 at 00:24
wouldn’t it still be nice of plasma could remember the width of its panels as “screenwidth – x px” or at least in percentages
March 25, 2010 at 05:25
Hrm, one step closer to the panel becoming a tab-bar. 🙂 Similar to the way ChromeOS works. I can see a setup like that being very useful.
March 25, 2010 at 06:44
Rings a bell, I think there’s a wish for this somewhere at bugs.kde.org .
BTW, you could have also shared binaries of code, with kde-obs-generator it was a minute of “work”. You can modify the kde-apps.org profile to include OBS repository home:llunak:kde, package kwinbuttonapplet (see http://en.opensuse.org/KDE/Build_Service/Cross-distro).
March 25, 2010 at 06:59
My current idea to this use case is to make the window decoration auto-hiding if the window is maximized. Don’t know if it will work, but it is worth a try.
March 25, 2010 at 08:18
Nice work! I love all the cool creativity that’s coming from the KDE project! 😀
March 25, 2010 at 09:06
I have done a similar applet nearly one year ago I think, it’s called active window control and resides in playground but I never took the time to clean it and update it
March 25, 2010 at 13:24
from your screenshot, it seems that the applet don’t reflect the disabled/enabled states of the kwin’s button (ie: the “maximize” button should be disabled because the windows is already maximized). But I may be wrong ?
For those interested : http://kde-look.org/content/show.php/ActiveWindow+Control?content=91258
(I think the version in playground is a bit more up-to-date)
One of my idea (not yet really implemented) was to navigate through open windows (next/prev, similar to alt-tab) by using the scrollwheel on the applet) so that you can move your mouse on the plasmoid’s close button and quickly choose with the scrollwheel which windows to close (or hide, minimize, etc.)
Anyway, it’s a bit old but maybe someone will be interested 🙂
March 25, 2010 at 09:12
It would be better, if you have helped to complete http://kde-look.org/content/show.php/ActiveWindow+Control?content=91258
March 25, 2010 at 10:00
Hm, i just set my panels to “window can cover” resp. “autohide” in order to save space on my 13″ screen. I don’t really see what this new solution makes better, unless you get rid of the title bar at all, but then the panel will cover the menu again.
March 25, 2010 at 19:28
It’s a matter of personal taste. I do not like hiding the panel because it contains information that is important to me.
March 25, 2010 at 14:04
I have not tested this “BorderlessMaximizedWindows=true”, it seems interesting, but how are such windows easily closed? how about a screen-corner-action that shows the min/max/close buttons?
March 25, 2010 at 19:25
That’s a very nice idea, but I am not so much into KWin hacking. Please file a feature request on bugs.kde.org.
March 25, 2010 at 21:17
See my comment 12 – I already had the idea of something like that. I just need the time and motivation to try it out 🙂
March 25, 2010 at 20:17
Is it possible to compile “Current Application Control” on kde 4.4?
I’m getting:
” Unknown CMake command “kde4_add_plugin”.”
or is this for future 4.5 versions….
March 26, 2010 at 08:55
KDE SC 4.4 should come with “Current Application Control” preinstalled. It’s included with the Plasma Netbook shell, so if that one is in a separate package in your distribution, you might want to install this package.
March 26, 2010 at 02:22
Who would’ve thought…
March 31, 2010 at 22:28
[…] this time goes to Christian who wrote about this feature in a comment in this blog post. The post also links to a neat widget […]
March 31, 2010 at 22:50
[…] this time go to Christian who wrote about this feature in a comment in this blog post. The post also links to a neat widget […]
April 1, 2010 at 14:56
Instead of hiding the panel, what about making another panel that is narrower with the information you need? I’ve done that from time to time, though I ultimately enjoy a completely hidden panel.
November 21, 2010 at 05:24
hi
would u update this so it can be installed in kubuntu kde 4.5.3 ppa ?
the other plasmoid you mentioned does not cut it for me, i want just plain the 3 close maximze and minize buttons.
thank you
December 19, 2011 at 23:14
[…] Fuente GA_googleAddAttr("AdOpt", "1"); GA_googleAddAttr("Origin", "other"); GA_googleAddAttr("LangId", "19"); GA_googleAddAttr("Tag", "archlinux"); GA_googleAddAttr("Tag", "kde"); GA_googleFillSlot("wpcom_sharethrough"); Share this:TwitterMe gusta:LikeSé el primero en decir que te gusta esta post. Esta entrada fue publicada en archlinux, KDE por Dario. Guarda el enlace permanente. […]
March 23, 2012 at 07:34
Thanks for this article, I’m pretty sure that the tips from Aaron and Christian will cut it right for my need of vertical screen space.
Hope all this stuff will work the same way in upcoming Kubuntu 12.04, too.
Cheers!
December 2, 2012 at 00:45
[…] 參考網址: https://majewsky.wordpress.com/2010/03/24/the-kwin-button-applet/ […]