Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Proposed multiple monitor solution

I would like to propose a solution to the multi-monitor problem.  The
problem mainly arises when the programmer tries to constrain a popup or
something similar to the monitor so it doesn't show up off the screen.
This is done via Display.getBounds().  However on win32 platforms this
call does a GetSystemMetrics() call to determine the screen bounds.
This call is limited due to the fact that it always returns the bounds
of the primary screen, which may or may not be what is required.

1:  Display.getBounds().  Modified to return the bound of the monitor
that the app is primarily running on.
2:  Add Display.getBounds(point p).  Get the bounds of the monitor that
contains the point.
3:  Add Display.getVirtualBounds().  Get the bounds of all monitors put
together in a big virtual bounds.

However this does not totally fix the problem as the code which
constrains popups incorrectly assumes that the x,y coordinates of the
returned bounds is 0,0.

I have implemented this solution on the win32 platform.  If the dev team
accepts the solution I will submit it as a patch.

Rob Hughes



Back to the top