Project

General

Profile

Bug #3008

Window in Swing GUI cannot be moved outside of screen bounds

Added by Hynek Cihlar about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/29/2016
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

History

#1 Updated by Hynek Cihlar about 8 years ago

Top-level window in Swing GUI, smaller than screen size, cannot be moved outside of screen bounds. When mouse-dragging the window by its title bar the window will hit the screen bounds and won't go further. This is caused by limitations of java.awt.Window.setLocation().

When the window fits fully on the screen, calling java.awt.Window.setLocation() doesn't allow the window to move outside of the screen bounds. So for example when window.setLocation(-10, -10) is called, it will end up at actual location 0,0.

But when the window is resized so that it doesn't fit on the screen, java.awt.Window.setLocation() will allow to set off-screen locations. An example, window height is set to be greater than screen height, width is set less than screen height, a call to window.setLocation(-10, -10) will position the window at -10,-10.

At this moment there doesn't seem to be an easy workaround. As long as we draw the window decorations ourselves we have to use java.awt.Window.setLocation() to reposition the window on mouse drag.

This issue was identified during work on #2914.

Also available in: Atom PDF