[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] Problem with Shell._setSize()
|
Steve_Northover@xxxxxxx writes:
> All the discussion of "fantasy shell sizes" is bogus too. SWT returns the
> real size of the shell. State variables for location and size were not
> necessary on Motif so why would they be necessary on GTK? Both are
> asynchronous. Actually, there was some special processing in Shell
> on Motif with respect to the shell's initial size. I will go look at the
> code.
>
The Motif code is not maintaining the invariant about getSize(), I
don't think:
public void setSize (int width, int height) {
checkWidget();
/*
* Feature in Motif. Motif will not allow a window
* to have a zero width or zero height. The fix is
* to ensure these values are never zero.
*/
saveBounds ();
int newWidth = Math.max (width - trimWidth (), 1);
int newHeight = Math.max (height - trimHeight (), 1);
if (!reparented) {
super.setSize(newWidth, newHeight);
return;
}
boolean isFocus = caret != null && caret.isFocusCaret ();
if (isFocus) caret.killFocus ();
OS.XtResizeWidget (shellHandle, newWidth, newHeight, 0);
if (isFocus) caret.setFocus ();
}
It just tries to resize and returns.
So if SWT allows that semantic it's perfect, works fine in GTK too.
No need for maintaining a fantasy SWT size separately.
I don't know from reading the Motif getSize() though what size is
being gotten (client-side last-set size, last-received event size, or
server-side size). Someone who knows Motif could say.
Havoc