Pop-up menus no longer jump before appearing.
Added wxTLW::DoGetSize() which uses cashed values. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -88,6 +88,7 @@ protected:
|
|||||||
virtual void OnInternalIdle();
|
virtual void OnInternalIdle();
|
||||||
|
|
||||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||||
|
virtual void DoGetSize( int *width, int *height ) const;
|
||||||
virtual void DoSetClientSize(int width, int height);
|
virtual void DoSetClientSize(int width, int height);
|
||||||
virtual void DoSetSize(int x, int y,
|
virtual void DoSetSize(int x, int y,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
|
@@ -93,7 +93,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
|
|||||||
m_mainWindow = (WXWindow) xwindow;
|
m_mainWindow = (WXWindow) xwindow;
|
||||||
wxAddWindowToTable( xwindow, (wxWindow*) this );
|
wxAddWindowToTable( xwindow, (wxWindow*) this );
|
||||||
|
|
||||||
XMapWindow( xdisplay, xwindow );
|
// XMapWindow( xdisplay, xwindow );
|
||||||
|
|
||||||
xattributes.event_mask =
|
xattributes.event_mask =
|
||||||
ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
|
ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
|
||||||
@@ -128,6 +128,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
|
|||||||
m_clientWindow = (WXWindow) xwindow;
|
m_clientWindow = (WXWindow) xwindow;
|
||||||
wxAddClientWindowToTable( xwindow, (wxWindow*) this );
|
wxAddClientWindowToTable( xwindow, (wxWindow*) this );
|
||||||
|
|
||||||
|
m_isShown = FALSE;
|
||||||
XMapWindow( xdisplay, xwindow );
|
XMapWindow( xdisplay, xwindow );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -147,7 +148,8 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
|
|||||||
m_clientWindow = (WXWindow) xwindow;
|
m_clientWindow = (WXWindow) xwindow;
|
||||||
wxAddWindowToTable( xwindow, (wxWindow*) this );
|
wxAddWindowToTable( xwindow, (wxWindow*) this );
|
||||||
|
|
||||||
XMapWindow( xdisplay, xwindow );
|
m_isShown = FALSE;
|
||||||
|
// XMapWindow( xdisplay, xwindow );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
fixme
|
fixme
|
||||||
|
@@ -452,13 +452,29 @@ void wxTopLevelWindowX11::DoGetClientSize( int *width, int *height ) const
|
|||||||
*height = m_height;
|
*height = m_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxTopLevelWindowX11::DoGetSize( int *width, int *height ) const
|
||||||
|
{
|
||||||
|
// TODO add non-client size
|
||||||
|
|
||||||
|
if (width)
|
||||||
|
*width = m_width;
|
||||||
|
if (height)
|
||||||
|
*height = m_height;
|
||||||
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
|
void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
|
||||||
{
|
{
|
||||||
// wxLogDebug("DoSetClientSize: %s (%ld) %dx%d", GetClassInfo()->GetClassName(), GetId(), width, height);
|
int old_width = m_width;
|
||||||
|
int old_height = m_height;
|
||||||
|
|
||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
|
|
||||||
|
if (m_width == old_width && m_height == old_height)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// wxLogDebug("DoSetClientSize: %s (%ld) %dx%d", GetClassInfo()->GetClassName(), GetId(), width, height);
|
||||||
|
|
||||||
#if !wxUSE_NANOX
|
#if !wxUSE_NANOX
|
||||||
XSizeHints size_hints;
|
XSizeHints size_hints;
|
||||||
size_hints.flags = PSize;
|
size_hints.flags = PSize;
|
||||||
@@ -472,7 +488,10 @@ void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
|
|||||||
|
|
||||||
void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
// wxLogDebug("DoSetSize: %s (%ld) %d, %d %dx%d", GetClassInfo()->GetClassName(), GetId(), x, y, width, height);
|
int old_x = m_x;
|
||||||
|
int old_y = m_y;
|
||||||
|
int old_width = m_width;
|
||||||
|
int old_height = m_height;
|
||||||
|
|
||||||
if (x != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
if (x != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
m_x = x;
|
m_x = x;
|
||||||
@@ -485,7 +504,12 @@ void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int siz
|
|||||||
|
|
||||||
if (height != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
if (height != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
m_height = height;
|
m_height = height;
|
||||||
|
|
||||||
|
if (m_x == old_x && m_y == old_y && m_width == old_width && m_height == old_height)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// wxLogDebug("DoSetSize: %s (%ld) %d, %d %dx%d", GetClassInfo()->GetClassName(), GetId(), x, y, width, height);
|
||||||
|
|
||||||
#if !wxUSE_NANOX
|
#if !wxUSE_NANOX
|
||||||
XSizeHints size_hints;
|
XSizeHints size_hints;
|
||||||
size_hints.flags = 0;
|
size_hints.flags = 0;
|
||||||
|
Reference in New Issue
Block a user