In linux with render to main, make sure the emulator window is resized if the log window is opened or resized. Also fix a memory leak, and a little code clean up.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5190 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-03-12 04:10:48 +00:00
parent b2ab31681a
commit 3ccbd152fd
2 changed files with 9 additions and 9 deletions

View File

@ -546,7 +546,7 @@ void X11_SendEvent(const char *message)
// Events // Events
void CFrame::OnActive(wxActivateEvent& event) void CFrame::OnActive(wxActivateEvent& event)
{ {
#if defined(HAVE_GTK2) && HAVE_GTK2 && defined(wxGTK) #if defined(HAVE_X11) && HAVE_X11 && defined(HAVE_GTK2) && HAVE_GTK2 && defined(wxGTK)
if (event.GetActive() && (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE)) if (event.GetActive() && (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE))
X11_SendEvent("WINDOW_REFOCUS"); X11_SendEvent("WINDOW_REFOCUS");
#endif #endif
@ -612,15 +612,14 @@ void CFrame::OnResize(wxSizeEvent& event)
SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth = GetSize().GetWidth(); SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth = GetSize().GetWidth();
SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight = GetSize().GetHeight(); SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight = GetSize().GetHeight();
#if defined(HAVE_GTK2) && HAVE_GTK2 && defined(wxGTK)
if (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE)
X11_SendEvent("MAIN_RESIZED");
#endif
} }
void CFrame::OnResizeAll(wxSizeEvent& event) void CFrame::OnResizeAll(wxSizeEvent& event)
{ {
event.Skip(); event.Skip();
#if defined(HAVE_X11) && HAVE_X11 && defined(HAVE_GTK2) && HAVE_GTK2 && defined(wxGTK)
if (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE)
X11_SendEvent("MAIN_RESIZED");
#endif
//wxWindow * Win = (wxWindow*)event.GetEventObject(); //wxWindow * Win = (wxWindow*)event.GetEventObject();
//NOTICE_LOG(CONSOLE, "OnResizeAll: %i", (HWND)Win->GetHWND()); //NOTICE_LOG(CONSOLE, "OnResizeAll: %i", (HWND)Win->GetHWND());
} }

View File

@ -162,8 +162,6 @@ void CreateXWindow (void)
s_backbuffer_height = GLWin.height; s_backbuffer_height = GLWin.height;
// create the window // create the window
GLWin.attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask |
StructureNotifyMask | ResizeRedirectMask;
GLWin.win = XCreateWindow(GLWin.dpy, parent, GLWin.win = XCreateWindow(GLWin.dpy, parent,
GLWin.x, GLWin.y, GLWin.width, GLWin.height, 0, GLWin.vi->depth, InputOutput, GLWin.vi->visual, GLWin.x, GLWin.y, GLWin.width, GLWin.height, 0, GLWin.vi->depth, InputOutput, GLWin.vi->visual,
CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect, &GLWin.attr); CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect, &GLWin.attr);
@ -427,8 +425,10 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
PanicAlert("Couldn't Create GLX context.Quit"); PanicAlert("Couldn't Create GLX context.Quit");
exit(0); // TODO: Don't bring down entire Emu exit(0); // TODO: Don't bring down entire Emu
} }
// Create a color map. // Create a color map and set the event masks
GLWin.attr.colormap = XCreateColormap(GLWin.dpy, RootWindow(GLWin.dpy, GLWin.vi->screen), GLWin.vi->visual, AllocNone); GLWin.attr.colormap = XCreateColormap(GLWin.dpy, RootWindow(GLWin.dpy, GLWin.vi->screen), GLWin.vi->visual, AllocNone);
GLWin.attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask |
StructureNotifyMask | ResizeRedirectMask;
GLWin.attr.border_pixel = 0; GLWin.attr.border_pixel = 0;
XkbSetDetectableAutoRepeat(GLWin.dpy, True, NULL); XkbSetDetectableAutoRepeat(GLWin.dpy, True, NULL);
@ -756,6 +756,7 @@ void OpenGL_Shutdown()
if (GLWin.ctx) if (GLWin.ctx)
{ {
glXDestroyContext(GLWin.dpy, GLWin.ctx); glXDestroyContext(GLWin.dpy, GLWin.ctx);
XFreeColormap(GLWin.dpy, GLWin.attr.colormap);
XCloseDisplay(GLWin.dpy); XCloseDisplay(GLWin.dpy);
GLWin.ctx = NULL; GLWin.ctx = NULL;
} }