Monday, June 22, 2009

KWin tiling ratios and orientations...

... now with minimize support.

KWin tiling has been proceeding forward at a steady rate. If you check out the latest revision, you will not only have a pretty stable experience, but will also get a design document for free.

So orientation is horizontal and vertical, and ratio is how much space the left child gets. Using these two properties I expect to be able to do most layouts. For now you can use D-BUS calls to actually use tiling pretty well.

Here are the calls

qdbus org.kde.kwin /KWin slotToggleOrientation
qdbus org.kde.kwin /KWin slotSetRatio <float> # between 0 and 1
qdbus org.kde.kwin /KWin dumpTiles # get a nice tree if you have debugging enabled and visible

Some applications will cause trouble. Especially some plasma widgets and Kruler aren't setting the right window attributes, so I can't exempt them from tiling. So don't launch panel settings or Kickoff menu, it won't look so well.

Minimize and restore works now, it will keep track of where the window was before you minimized it and put it back there.

Please leave feedback about bugs here or on the KWin mailing list, it will be appreciated.


  1. why don't you add your blog to PlanetKDE...?

  2. thanks for the suggestion.

    I'll take a look into it.

  3. This looks absolutely great, I'd really like to try it out.

    In particular being able to tile one application to the left and then 3 down the right looks great.

    Can this code be used on non-trunk kwin? Is it a standalone plug-in? An install guide would be appreciated.

  4. Well right now it is a separate branch. But if everything goes well, it will be merged with trunk in a few weeks.

    It is not a standalone plugin since it has to interact with KWin in some fundamental ways.

    As for the install guide, well right now you will just have to build it like normal kwin. Have a working KDE svn checkout, pull the kwin-tiling branch, symlink kdebase/workspace/kwin to point to kwin-tiling instead, then build kwin

  5. Thanks very much for the information, and so fast.

    I ran kde trunk head for 2 years before deciding it wasn't stable enough for general work, but with tiling support there I might have to go back.

    By the way I like your societyisstupid post, post more there!

  6. Well I am online right now, thats why I'm replying quickly :)

    You don't have to use trunk all the time. I always run stable. Then I install trunk in my home directory itself and run it on another X instance when developing.

    As for societyisstupid, that was made in a fit of rage, but one post is all it has :D

    Could you please make your profile public or atleast let me know who you are? website and so on is appreciated. Cheers

  7. I know about the nested X server, generally I just use a prefixed install for trunk and switch in my .xinitrc depending on how stable it is.

    I'm here, you probably know me from kde stuff already.

    What happened to the google summer of code student who was working on kwin tiling? I was going to do this work until I found out someone else was doing it.

  8. Another KDE contributor. great! and an impressive CV btw. Ya I've heard of Kitten, haven't tried it though.

    There was no gsoc student for tiling. I had applied, but it was tabbing that got the only slot available for KWin. So I thought, why not go ahead and do it anyway, so it's now under SoK.

  9. I've got kde trunk built now (liking the new stuff a lot). Can't find your branch anywhere though. What's the svn URL?

  10. Sorry I found it, just gotta set my damn kde svn+ssh information up, it's trying to log in as my system user rather than my kde svn user id.

  11. It won't build on trunk. It asks for the main.cpp from the following list.. I copied these files from the trunk:

    ? kcmkwin/kwindesktop/main.ui
    ? kcmkwin/kwindesktop/desktopnameswidget.cpp
    ? kcmkwin/kwindesktop/main.cpp
    ? kcmkwin/kwindesktop/desktopnameswidget.h
    ? kcmkwin/kwindesktop/main.h

    kdebase is building now at least, but could be a few hours before I know if it worked.

    Will you merge these files from the trunk? I'll probably be sending you patches soon ;)

  12. Hmm, did you check out the branch kwin-tiling ( )? I don't know how merging from trunk is going to do it. I haven't modified any of the files you listed above and they aren't related to tiling, so I can't really help you with that, sorry.

    If you did checkout the branch, do the following steps:

    1. go to your kdebase/workspace/
    2. rename kwin to kwin-trunk
    3. create a soft link kwin-> kwin-tiling
    4. then run make install from the root kdebase directory once. The thing is you always need to compile through kdebase. You can do cd kdebase/workspace/kwin and end up in kwin-tiling and then it will compile, but don't directly switch to kwin-tiling and run make install.

    You probably already know this, but well, maybe it will help. It shouldn't take more than 40 minutes to compile kdebase

    Patches would be dead useful. Thanks.

  13. Hi,

    Yes I did exactly as you said, those files are missing from the kwin-tiling branch though. Can you do "svn status" and make sure those files are not listed with "?" in your local copy.

    I've got your work compiled now, just about to test it.


  14. Oh,

    Also maybe you should use the anonsvn versions of the svn:externals, otherwise non-kde developers cannot check your code out.

    I had to use svn propedit to fix them for me (as even though I have a kde svn account I have to use ssh+svn rather than https+svn due to account name differences).

  15. Okay I'm using your work right now.

    Against the current trunk it is so buggy it is unusable. At the moment it has decided firefox is on top and nothing else will ever be visible.

    Resizing windows leads to terrible slowness and distortions at the top of the screen.

    If I turn tiling off with "Shift + Alt + F11" then the behaviour changes but it crashes in different ways (also Tiling was on by default, should it not be off by default?).

    Let me know when you think it's stable enough for me to try again.

  16. I did svn status, and these files ARE '?' in mine. thats weird, I never really noticed anything wrong in that. And they are present in the kwin-tiling branch on websvn, so I have no idea why this is happening. Should I do an svn add and commit again?

    The svn:externals is actually modified because svn:// is blocked in my college, so I have to access over https://. It will have to stay that way until the sysadmin relents ( I've written to him about 10 times with no results :( )

    In your last comment, when you mean 'current trunk' you mean the tiling branch right? When it crashes could you please send the traceback to me at nsm.nikhil ( gmail ). I don't understand why resizing should be terribly slow. It is quite snappy even with compositing enabled on my nvidia card. What is your hardware spec?

    Tiling is on by default so I don't have to enable it all the time when testing. Once it is stable enough, I'll switch to off. You can keep it off by default by editing the Workspace::Workspace member initialisation list in workspace.cpp, and set tilingMode_ to false.

  17. Hi,

    The correct procedure in this place is to merge that directory from the trunk. I've done it for you and committed I hope you don't mind.

    Ah how can places of learning block ports, especially svn! Madness. I think you should still keep the anonsvn externals in the repository though for the benefit of the thousands of people who may want to try your code, you can always do a propedit for your own version and make sure you don't commit those externals.

    I have a nvidia QUATRO, it's a fairly decent video card, and I have a core 2 duo, I'm sure it's not a performance issue with my machine as KDE trunk runs fine, just this kwin-tiling is buggy. I tested it with compositing on and off.

    Maybe you could try removing your kdebase build dir, updated kdebase to the trunk revision, and then compiling your work against this, you will probably see the same behaviour. Although I can't see any obvious changes in kdebase/workspace/kwin over the last few weeks that would indicate a compatibility change.

  18. Oh and yes I mean the tiling branch.. but the tiling branch only provides kdebase/workspace/kwin, you are developing this against kdebase trunk right?

  19. yes i'm developing it against trunk. I'll try updating, haven't done that in a few days.