Page 1 of 1

Smart Client starts up "minimized"

PostPosted: Thu Mar 18, 2010 10:22 am
by michel
On some systems running vista the smart client starts up "minimized". That is, after the smart client is started it shows up in the windows task bar, the title bar is shown maximized on top of the screen without the rest of the window (so only the title bar is displayed).
When the button in the windows task bar is clicked, the title bar disappears and the smart client is now a normal minimized application. After clicking the button in the windows task bar again the smart client window is shown like it should and works correctly.
Does anyone recognize this effect?

Re: Smart Client starts up "minimized"

PostPosted: Thu Mar 18, 2010 11:47 am
by mboegem
Hi Michel,

I recognize this from other applications also on XP. I don't think it's a Servoy specific issue.
We don't have this problem running the smart client, as we save the last state of the window as an user property and recall this at startup.
Doing this you'll never get into trouble as it is user + client specific storage of this data.

Maybe this can help you.

Re: Smart Client starts up "minimized"

PostPosted: Tue Mar 23, 2010 10:49 am
by michel
Storing these user properties and recall them at startup works okay on normal windows but does not work correctly on maximized window (icon next to the close icon in the window title bar is different than that of a normal window). In that case application.getWindowX() and application.getWindowY() both return -4, passing this to application.setLocation() does not show a maximized window, but shows the window on location (2, 10) approximately.

Re: Smart Client starts up "minimized"

PostPosted: Tue Mar 23, 2010 10:56 am
by mboegem
michel wrote:application.getWindowX() and application.getWindowY() both return -4


that's correct (forgotten about this), anyway we've worked around this by requesting screen size (H&W) and resize the window to the max. possible for this screen.
not exactly maximized, but anyway workable (for us...)

Re: Smart Client starts up "minimized"

PostPosted: Tue Mar 23, 2010 11:06 am
by michel
Possible, but then i have a problem with my windows taskbar...

Re: Smart Client starts up "minimized"

PostPosted: Tue Mar 23, 2010 12:14 pm
by Harjo
michel wrote:Possible, but then i have a problem with my windows taskbar...

Indeed, we worked around that also, by limiting the height, but I agree, Servoy should have a function, to maximize the screen.

maybe this is already possible with plain Java? I dont know.....
Let some Java -guru's answer that :-)

Found a real old topic about this: http://forum.servoy.com/viewtopic.php?f ... 31&start=0
with Johan arguing that he was against this..
I'm also not a big fan, of solutions, that do this EVERY time at start-up, but the servoy-client starts up default so small, that just one maximize is enough.
Johan, look at microsoft Office, OpenOffice, they ALL start maximized the first time ;-)

Re: Smart Client starts up "minimized"

PostPosted: Tue Mar 23, 2010 12:31 pm
by mboegem
Harjo wrote:I'm also not a big fan, of solutions, that do this EVERY time at start-up


don't have to... if we just had the function to do it, we will let the user decide what (s)he wants... :D

I've seen Paul Bakker promising something like this function in his soon to be available 'Tools' plugin.... If I'm not mistaken that was 2004, so I guess he should have it available by now.... :wink:

@Paul: can you help us out here?

Re: Smart Client starts up "minimized"

PostPosted: Tue Mar 23, 2010 4:01 pm
by jcompagner
Harjo wrote:
Found a real old topic about this: viewtopic.php?f=2&t=2531&start=0
with Johan arguing that he was against this..
I'm also not a big fan, of solutions, that do this EVERY time at start-up, but the servoy-client starts up default so small, that just one maximize is enough.
Johan, look at microsoft Office, OpenOffice, they ALL start maximized the first time ;-)


in Servoy 6 the plan is that windows get a bit nicer api so that servoy developers can control it a bit better.
Not everything is in stone but we could add something like
boolean setState(JSWindow constant)

And that window constant can then be JSWindow.minimized, JSWindow.maximized, JSWindow.normal
things like that.

But as you all know, i am against those setSize and setLocation all the time. That should only happen once.
So we could add besides setSize/setLocation/setState methods like:
setInitialXxxx()
And that is only used when the window (name) you now show is not yet know, if it is known (stored in settings) then initial will be ignored.

This way you can configure the default size and position for the main and all other windows, but let the user decide from then on where it wants it.
And servoy also takes care of remembering the settings throughout restarts for all the named dialogs/windows you have.