Kristian Lyngstøl's Blog

2 + 2 != 5

Posted on 2006-12-30

I've been spending my time working on the bug known as "The OpenOffice bug" lately. About a week now I guess. It's a bug where OpenOffice windows open maximized and stay that way, including the dialog boxes. This happens semi-randomly or not at all.

Initially I wasn't going to look at it because I can't reproduce the problem myself, but as the community grew more and more impatient and it became apparant that non of the devs had this issue and the time to work on it, I ended up grabbing it...

So how do you debug something you can't reproduce and that isn't obvious and is semi-random? Why, you write a debug plugin.

It quickly proved usefull as pichalsi (and a few others, thanks to all of you) gave me feedback. It became obvious that w->type was set to 0x8000 when the windows bugged, and w->type 0x40 when they didn't. At the same time, w->wmType was allways 0x40. The sizeHints were correct, but any other value representing the window size were wrong (maximized).

Ok, so what did THAT mean? Well, this is where 2+2=5 comes into the picture. I spent about 5 days imagining that 0x8000 was 1