From e7471958e42791ed88afcf2eb951de6c66d3ec40 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 6 Aug 2014 22:22:13 -0400 Subject: [PATCH] X11_Util: Resize the GLX window by listening to events on the parent We now have two cases: the GLX window is parented into a frame, or it's parented into the MainNoGUI host. In both cases, the GLX window should be locked to the size of the parent, so just sync it up based on that. --- Source/Core/DolphinWX/FrameTools.cpp | 7 ------- Source/Core/DolphinWX/GLInterface/X11_Util.cpp | 5 +++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 04f2e4dd1e..039b6370a3 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -840,13 +840,6 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event) SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth = width; SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight = height; } -#if defined(HAVE_X11) && HAVE_X11 - wxRect client_rect = m_RenderParent->GetClientRect(); - XMoveResizeWindow(X11Utils::XDisplayFromHandle(GetHandle()), - (Window) Core::GetWindowHandle(), - client_rect.x, client_rect.y, - client_rect.width, client_rect.height); -#endif m_LogWindow->Refresh(); m_LogWindow->Update(); } diff --git a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp index 79d0d76b8b..21096fbb1a 100644 --- a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp +++ b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp @@ -11,7 +11,6 @@ void cX11Window::CreateXWindow(void) // Setup window attributes GLWin.attr.colormap = XCreateColormap(GLWin.dpy, GLWin.parent, GLWin.vi->visual, AllocNone); - GLWin.attr.event_mask = StructureNotifyMask; GLWin.attr.background_pixel = BlackPixel(GLWin.dpy, GLWin.screen); GLWin.attr.border_pixel = 0; @@ -19,7 +18,8 @@ void cX11Window::CreateXWindow(void) GLWin.win = XCreateWindow(GLWin.dpy, GLWin.parent, 0, 0, 1, 1, 0, GLWin.vi->depth, InputOutput, GLWin.vi->visual, - CWBorderPixel | CWBackPixel | CWColormap | CWEventMask, &GLWin.attr); + CWBorderPixel | CWBackPixel | CWColormap, &GLWin.attr); + XSelectInput(GLWin.dpy, GLWin.parent, StructureNotifyMask); XMapWindow(GLWin.dpy, GLWin.win); XSync(GLWin.dpy, True); @@ -45,6 +45,7 @@ void cX11Window::XEventThread() XNextEvent(GLWin.dpy, &event); switch (event.type) { case ConfigureNotify: + XResizeWindow(GLWin.dpy, GLWin.win, event.xconfigure.width, event.xconfigure.height); GLInterface->SetBackBufferDimensions(event.xconfigure.width, event.xconfigure.height); break; default: