Neil's Place

May 22, 2010

Status Update for May 21

Filed under: Mozilla, Status Updates — enndeakin @ 1:32 am

I improved the waitForFocus function in bug 554873. This fixes problems with using waitForFocus when waiting for a new window to open. Instead, it waits for a non-blank page to load. If this is actually expected, a flag is available to alter this behaviour.

Other than that, I mostly worked on panel improvements again. I spent most of the week working on ensuring that the coordinates and position of panels are properly set when a titlebar is present.

Let’s say that you needed to write code that needs to store the position and size of two rectangles, and you wanted to store them in the most optimal way. But you didn’t want to optimize for space or for performance. Instead, you wanted to optimize for maximum confusion to someone reading your code eight years later. What would you do? The solution is obvious. Store only one rectangle but use the position of one rectangle and the size of the other. Or vice versa. And especially, mix and match the values at different times. Finally, have an aha moment when you realize it could be differently on each platform.

This is the way the window positioning and sizing code works. Luckily I discovered that I should be able to avoid having to deal with that confusion and handle things entirely in the popup code.

Now that that is mostly complete, I next plan to polish up the code and break it down into smaller patches to make it clearer as to which patch implements or fixes what popup feature.

Besides titlebars, a new floating panel will be available, by setting the level attribute on a panel to ‘floating’. This creates a panel suited for a floating panel such as a tool palette window on each platform. The exact behaviour will differ on each platform though due to available features of the underlying platform. Generally, the panel will appear on top of the parent window, can be moved independently of it, and on Mac, will hide when the application becomes inactive.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: