Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with Shell.setMaximized()
Problem with Shell.setMaximized() [message #466852] Wed, 18 January 2006 10:39 Go to next message
Thomas Mauch is currently offline Thomas MauchFriend
Messages: 8
Registered: July 2009
Junior Member
I have an application where the shell should always be in maximized
mode, i.e. the user should not be able to move, resize or minimize the
application window.

To achieve this behavior, I use Shell.setMaximized(). However this does
not work as intented.

- When I run the application appended below, the window appears
maximized, but the user is still able to change its size by double
clicking on the title bar. Then the window gets resize to a smaller
size. But then double clicking on the title has no longer any effect,
so the user is unable to make the window maximized again.

- When I run the application appended below, the window appears
maximized, but it covers the task bar as well. This is not common
under Windows and does not happen If I change the creation
of the shell to
Shell shell = new Shell(display)

Any ideas?
Thomas


import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Snippet28 {

public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display, SWT.CLOSE | SWT.TITLE);
shell.setMaximized(true);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
Re: Problem with Shell.setMaximized() [message #466858 is a reply to message #466852] Wed, 18 January 2006 14:42 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
I suggest you compute the client area of the Display using getClientArea() and then set your shell to those bounds. That way the shell will appear maximized and never actually is. The end user shouldn't be able to tell the difference as long as there's no maximize button on the title bar.

As to the covering of the task bar, you've got me. I've never seen that in a modal dialog - or any Shell for that matter.
Re: Problem with Shell.setMaximized() [message #466862 is a reply to message #466858] Wed, 18 January 2006 16:41 Go to previous messageGo to next message
Thomas Mauch is currently offline Thomas MauchFriend
Messages: 8
Registered: July 2009
Junior Member
Unfortunately the user can move the window around if it is not maximized.
Re: Problem with Shell.setMaximized() [message #466867 is a reply to message #466862] Wed, 18 January 2006 18:41 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
This sounds like a platform issue (the maximize deal). There really isn't anything to be done about it (other than possible work arounds). You could try dipping down through JNI if the platform supports finer-grained control over the Shell state. Other than that, I guess you're out of options.
Re: Problem with Shell.setMaximized() [message #466886 is a reply to message #466867] Wed, 18 January 2006 22:42 Go to previous message
Terry Corbet is currently offline Terry CorbetFriend
Messages: 14
Registered: July 2009
Junior Member
Bugs #85892 and #108893 have discussions
about this topic.

The first one was resolved as WON'T FIX, but
after some further work, Steve requested it
be re-submitted, which is the current state
of the second one.

In the meantime, if it would be of any help
to you, I'd be happy to provide the workaround-
fix patch code that I use to solve the
problem of a maximized window over-laying the
task bar. My requirement/problem, however,
had a slightly different aspect than what
seems to be most troubling to you, so I am
not 100% certain that my workaround-fix,
as written, will solve yours. I do belief,
however, that a slight modification in the
same section of the code could solve yours.
Previous Topic:TreeEditor: ProgressBar does not fill cell correctly
Next Topic:Dialog to Load Images?
Goto Forum:
  


Current Time: Thu Mar 28 12:36:54 GMT 2024

Powered by FUDForum. Page generated in 0.24899 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top