Generate a size event for wxGLCanvas when it is realized
This ensures that a wxSizeEvent handler can set the initial viewport size correctly. Fixes the initial display of the pyramid sample with GTK2.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasX11
|
||||
{
|
||||
typedef wxGLCanvasX11 BaseType;
|
||||
public:
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
const wxGLAttributes& dispAttrs,
|
||||
@@ -110,6 +111,7 @@ public:
|
||||
|
||||
// implementation from now on
|
||||
void OnInternalIdle() wxOVERRIDE;
|
||||
virtual void GTKHandleRealized() wxOVERRIDE;
|
||||
|
||||
bool m_exposed;
|
||||
#ifdef __WXGTK3__
|
||||
|
@@ -332,6 +332,13 @@ Window wxGLCanvas::GetXWindow() const
|
||||
return window ? GDK_WINDOW_XID(window) : 0;
|
||||
}
|
||||
|
||||
void wxGLCanvas::GTKHandleRealized()
|
||||
{
|
||||
BaseType::GTKHandleRealized();
|
||||
|
||||
SendSizeEvent();
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnInternalIdle()
|
||||
{
|
||||
if (m_exposed)
|
||||
|
Reference in New Issue
Block a user