Monday, July 13, 2009

The little things screw up

I had this really weird bug in kwin for half a week. When you started resizing windows, all of them would start dancing about the screen. There would be little gaps between them and so on. And I couldn't figure out why. So today I finally tried comparing ( x + width ) and ( right ) of a window. Turns out they are always off by one. So to the QRect::right() documentation:
Returns the x-coordinate of the rectangle's right edge.

Note that for historical reasons this function returns left() + width() - 1; use x() + width() to retrieve the true x-coordinate.

Argh! That ( and bottom() ) was causing the mess. What a relief.

Tuesday, July 07, 2009

KWin dynamic resizing and the first layout

After a short break due to various other responsibilities and a general lack of clarity in planning some of the code, I've made progress and now you can resize windows while in tiling mode and watch all the others adjust themselves to fit the screen. Admittedly there are a few kinks, and an annoying bug where the resize pointer suddenly makes the window super-tiny, but they should be fixed in two or three days. I also implemented a basic Spiral layout today which keeps halving windows and moves towards the centre in a spiral. Gradually layouts will be in the form of a plugin system, and you would be able to choose different layouts for each virtual desktop. Here is the latest screenshot. House of Cards it is.


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.

Wednesday, June 10, 2009

Kwin : tree based tiling


In the quest to implement tiling in KWin, I've decided to use binary trees as an internal representation. This morning, I hacked on it to produce a decent prototype, just to check if the idea would work well enough, without introducing too much complexity in the code. At the moment, it does tend to crash or have repaint issues once in a while. But it works, and it does what tiling is supposed to do. Of course there is a lot to do yet. Moving and Resizing remain particularly icky because so many choices about what is good as a default, what is expected, how to implement it, will have to be made. If you are adventurous enough to try the kwin-tiling branch, do not move the windows, or basically abuse it in anyway :)

Friday, June 05, 2009

Internship and back to college

Well, my holiday has been cut short...

I'm leaving next Saturday to spend the last month and a half of my vacations in college.

I've received an internship opportunity to work as a Playtester and Beta-tester MILLEE.

I really enjoyed the short vacation though, I learnt to drive, did a lot of swimming, and hacked some decent code.

The last year (academic) has been really really unique, perhaps the most satisfying and enjoyable one. But thats for another post

KWin preliminary tiling

Yesterday I committed code which adds a semblance of tiling to kwin. Every time you launch a window, it will be maximized vertically, but each window shares the width of the screen equally. You can check out code from KDE svn. The location is /home/kde/branches/work/kwin-tiling/

You'll need to edit $KDEDIR/share/config/kwinrc and set Placement=Tiling.

Then you are ready to go.

Right now there are no configuration options, no key bindings, nothing! Still a long long way from a functional release.

Please leave feedback and bugs.

Sunday, May 17, 2009

May updates

I'm home! Till almost the end of July I'll be @ home. Which means a better internet connection at the very least :p

So I've been swimming and learning to drive! Driving is fun, I've finished five days out of the 22 and I've managed not to hit anyone or anything.

In programming, I'm working on a game using Canvas for the CodeChef game contest. You can track its progress on github.

Also I've been doing some C socket programming, mainly doing segmented multithreaded HTTP downloads. Right now all the code is prototype, but someday it will be a decent download manager.

I'm also working on implementing tiling in KWin along with Martin Graesslin, my mentor. Right now there isn't much real progress apart from a KWin branch which maximizes every window you open.

And yesterday I got a copy of Real World Haskell. Yay!