diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 755118233a..ea38e45bfa 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -546,7 +546,7 @@ void X11_SendEvent(const char *message) // Events 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)) X11_SendEvent("WINDOW_REFOCUS"); #endif @@ -612,15 +612,14 @@ void CFrame::OnResize(wxSizeEvent& event) SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth = GetSize().GetWidth(); 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) { 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(); //NOTICE_LOG(CONSOLE, "OnResizeAll: %i", (HWND)Win->GetHWND()); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index 5f329a62d4..ecb8b872de 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -162,8 +162,6 @@ void CreateXWindow (void) s_backbuffer_height = GLWin.height; // create the window - GLWin.attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | - StructureNotifyMask | ResizeRedirectMask; GLWin.win = XCreateWindow(GLWin.dpy, parent, GLWin.x, GLWin.y, GLWin.width, GLWin.height, 0, GLWin.vi->depth, InputOutput, GLWin.vi->visual, 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"); 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.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | + StructureNotifyMask | ResizeRedirectMask; GLWin.attr.border_pixel = 0; XkbSetDetectableAutoRepeat(GLWin.dpy, True, NULL); @@ -756,6 +756,7 @@ void OpenGL_Shutdown() if (GLWin.ctx) { glXDestroyContext(GLWin.dpy, GLWin.ctx); + XFreeColormap(GLWin.dpy, GLWin.attr.colormap); XCloseDisplay(GLWin.dpy); GLWin.ctx = NULL; }