GLEventListener.displayChanged()

Hi everyone,
I’m programming in multiscreen enviroment and this method would really help me a lot. Unfortunatelly it has been unimplemented since I started using JOGL half a year ago. I have not seen any questions regarding this method either so I guess that it 's low priority on it. Does anyone know when it will be implemented?

I’m most interested to know when a component is moved from one screen to another. Any known workarounds?

Regards
/Amir

The JAWT doesn’t seem to provide enough information to allow us to implement this method. I filed an RFE a while back to have the JAWT extended but it hasn’t been addressed yet.

However, JOGL definitely works in multi-card and multi-screen environments. I’ve personally tested it on Windows XP and Linux. It looks like a lot of the details of moving windows from screen to screen are actually handled by the OS, so that the AWT and JOGL don’t even need to recreate the component when it moves from screen to screen; the component can even span screens. What environment are you running in, and what are you trying to achieve?

I have implemented a map which has, among other features, a scale. In order to compute the scale I have to find out a real distance between two points on the current screen. This distance depends on the resolution and dpi which is specific for each screen.
So each time I move the map between two screens these two values have to be updated. This is what I intended to implement in displayChanged() method.

I’m currently programming on Windows XP (JSDK 1.5.0) but the program has to work also on Linux and Mac OS.

BTW thanks for a quick answer :slight_smile:

I don’t know how you’re going to find out when the display has changed. You might try adding a ComponentListener to your top-level Frame and watch for componentMoved events. However I don’t think its GraphicsConfiguration will change when it moves from screen to screen. You can probably figure out whether it has moved to a new screen by seeing whether the default GraphicsConfiguration for a given GraphicsDevice contains the window. You might want to post on the forums on java.sun.com or javadesktop.org for more help.