Skip to main content

When taskbar is hidden, what event is sent to fullscreen applet?

5 replies [Last post]
demonduck
Offline
Joined: 2008-03-14
Points: 0

If an applet is in fullscreen mode on Windows and the task bar is
hidden, what event is sent to the applet so the applet can resize itself to
fill the space left below when the task bar is hidden.

Demonstration:
http://pancyl.com/VSync.htm

With the task bar showing, enter fullscreen mode by pressing F1 when the applet
has focus -- that is click in the applet first to get focus then press F1.

When the applet is in fullscreen mode, hide the task bar. See the empty space below
the taskbar? What event is sent to the applet that can be listened for so that the
applet can be resized?

I've tried the listening for the usual WindowEvents and none of those apply to this
situation because nothing is happening to the fullscreen window itself. It
is the environment of the window that is changing.

But this is an important issue. When users want fullscreen they want FULLSCREEN
and complain if there is a little space unused at the bottom. It looks unsightly anyway.

So my question is: what event should I listen for or if there is no relevant event why not?

DD

Message was edited by: demonduck

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ixmal
Offline
Joined: 2004-08-08
Points: 0

AWT/Swing don't provide any (public) listener interfaces for screen insets changes. I think that sun.awt.DisplayChangedListener may be what you need, but it is located in sun.awt package and therefore is inaccessible from unsigned applets.

The only option that comes to my mind is to query screen insets - with Toolkit.getScreenInsets(gc) method - periodically and adjust the window bounds accordingly.

demonduck
Offline
Joined: 2008-03-14
Points: 0

> AWT/Swing don't provide any (public) listener
> interfaces for screen insets changes. I think that
> sun.awt.DisplayChangedListener may be what you need,
> but it is located in sun.awt package and therefore is
> inaccessible from unsigned applets.
>
> The only option that comes to my mind is to query
> screen insets - with Toolkit.getScreenInsets(gc)
> method - periodically and adjust the window bounds
> accordingly.

Why would sun.awt.DisplayChangedListener be hidden from unsigned applets?
How could that possibly be a security risk? Who makes these kinds of decisions?

ixmal
Offline
Joined: 2004-08-08
Points: 0

All sun.* packages are hidden for unsigned applets, not only sun.awt.* I'm not sure where these checks are performed...

walterln
Offline
Joined: 2007-04-17
Points: 0

How do you do fullscreen? When I run the [url=http://java.sun.com/docs/books/tutorial/extra/fullscreen/example.html]DisplayModeTest[/url] from as an applet (copied main method to a JApplet start()), it automatically covered the task bar (win XP, eclipse applet viewer, 6u10-rc2). Your VSync doesn't.

Ah, nevermind, it's because it opens a new JFrame and GraphicsDevice#setFullScreenWindow(Window) probably does the magic.

Message was edited by: walterln

demonduck
Offline
Joined: 2008-03-14
Points: 0

VSync is a plain AWT applet. No Swing. I go fullscreen pretty much like the example you
referenced. Here's a snippit:

boolean isFullScreen this.getGraphicsConfiguration().getDevice().isFullScreenSupported();
this.setIgnoreRepaint(true);
fsW = gdFS.getDisplayMode().getWidth();
fsH = gdFS.getDisplayMode().getHeight();
inset = getInsets();
fsH -= inset.bottom;
fsW += (fsW % 2);
fsH += (fsH % 2);
this.setBounds(0, 0, fsW, fsH);
this.setUndecorated(isFullScreen);
this.setResizable(!isFullScreen);
this.setVisible(true);
if(getGraphicsConfiguration().getDevice().isFullScreenSupported())
getGraphicsConfiguration().getDevice().setFullScreenWindow(this);
this.toFront();
this.requestFocus();

So you are saying that a JApplet will automatically cover the TaskBar?

Can I test your applet on my machine?

DD