[kepler-dev] _windowsProperty x and y checked against screen size
cxh at eecs.berkeley.edu
Tue Jun 6 12:32:15 PDT 2006
Edward and I have 1024x768 laptops and I've run up against user
submitted models that have the _windowsProperty attribute set
such that the window is placed off the edge of the screen.
I think this can also happen when the user has a two headed display.
The fix is to
> // If x or y is greater than the width or height of the
> // screen, then offset them by 30 pixels so the user can
> // drag the window.
> Toolkit tk = Toolkit.getDefaultToolkit();
> x = (x > tk.getScreenSize().width
> ? tk.getScreenSize().width - 30 : x);
> y = (y > tk.getScreenSize().height
> ? tk.getScreenSize().height - 30 : y);
I'm not sure if this should go into the release branch or not.
Technically, it is a bug, because it is easy to have a model that will
not appear on the user's screen if the user has a small screen.
More information about the Kepler-dev