[jitsi-dev] [patch] Jitsi stays outside the visible area when the resolution is changed


#1

Hey

The attached patch tries to resolve the problem that Jitsi windows open outside the visible area of the screen when the resolution changed while the application is running.

-> Instead of just returning just the cached bounds that were read once, a daemon thread checks every ten seconds whether the resolution changed. It updates the cached value and informs all registered listeners of the change to let them reposition when they are visible.

Regards,
Ingo

screen_change_while_running.patch (20 KB)


#2

Hey Ingo,

На 23.03.11 21:31, Bauersachs Ingo написа:

Hey

The attached patch tries to resolve the problem that Jitsi windows
open outside the visible area of the screen when the resolution
changed while the application is running.

-> Instead of just returning just the cached bounds that were read
once, a daemon thread checks every ten seconds whether the resolution
changed. It updates the cached value and informs all registered
listeners of the change to let them reposition when they are
visible.

If I understand correctly you are trying to resolve two issues here:

1) making sure that new windows do not open outside the visible area and

2) repositioning currently open windows

While I agree that 1. has to be taken care of I think 2. is definitely
the responsibility of the Window Manager. Most window managers
reposition windows properly and trying to also do that ourselves is
likely to cause weird behaviour.

In order to resolve 1. on the other hand, we don't really need a thread
running checks every 10 seconds, do we? Is there anything time consuming
in the method retrieving the screen size that would make it a bad idea
to simply query the actual screensize every time someone is trying to
obtain it?

Cheers,
Emil


#3

If I understand correctly you are trying to resolve two issues here:

1) making sure that new windows do not open outside the visible area and
2) repositioning currently open windows

While I agree that 1. has to be taken care of I think 2. is definitely
the responsibility of the Window Manager. Most window managers
reposition windows properly and trying to also do that ourselves is
likely to cause weird behaviour.

Interesting. When I implemented this yesterday at home, open windows were sometimes not repositioned. Today at work, they indeed are positioned by the window manager. Same notebook, same Windows 7, different monitors (but same resolution)...

In order to resolve 1. on the other hand, we don't really need a thread
running checks every 10 seconds, do we? Is there anything time consuming
in the method retrieving the screen size that would make it a bad idea
to simply query the actual screensize every time someone is trying to
obtain it?

The query method usually returns in less than 0.1ms (without threads, Oracle Java 1.6.24 on Windows 7). On a colleague's Dual-Screen Linux it took 2.7ms on overage (Ubuntu 10.10, OpenJDK 1.6.20). No idea about other setups.
Guess I relied too much on the comment "the query is very slow" inside the original ScreenInformation class.

Regards,
Ingo