mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-17 03:15:39 +00:00
GL/Context: Better handle resizing with GLX
Fixes fullscreen having no effect when running under XWayland.
This commit is contained in:
parent
5df28eff9d
commit
47ba6e7449
|
@ -105,21 +105,21 @@ bool ContextEGL::ChangeSurface(const WindowInfo& new_wi)
|
||||||
|
|
||||||
void ContextEGL::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_height /*= 0*/)
|
void ContextEGL::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_height /*= 0*/)
|
||||||
{
|
{
|
||||||
// This seems to race on Android...
|
if (new_surface_width == 0 && new_surface_height == 0)
|
||||||
#ifndef ANDROID
|
|
||||||
EGLint surface_width, surface_height;
|
|
||||||
if (eglQuerySurface(m_display, m_surface, EGL_WIDTH, &surface_width) &&
|
|
||||||
eglQuerySurface(m_display, m_surface, EGL_HEIGHT, &surface_height))
|
|
||||||
{
|
{
|
||||||
m_wi.surface_width = static_cast<u32>(surface_width);
|
EGLint surface_width, surface_height;
|
||||||
m_wi.surface_height = static_cast<u32>(surface_height);
|
if (eglQuerySurface(m_display, m_surface, EGL_WIDTH, &surface_width) &&
|
||||||
return;
|
eglQuerySurface(m_display, m_surface, EGL_HEIGHT, &surface_height))
|
||||||
|
{
|
||||||
|
m_wi.surface_width = static_cast<u32>(surface_width);
|
||||||
|
m_wi.surface_height = static_cast<u32>(surface_height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log_ErrorPrintf("eglQuerySurface() failed: %d", eglGetError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Log_ErrorPrintf("eglQuerySurface() failed: %d", eglGetError());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_wi.surface_width = new_surface_width;
|
m_wi.surface_width = new_surface_width;
|
||||||
m_wi.surface_height = new_surface_height;
|
m_wi.surface_height = new_surface_height;
|
||||||
|
|
|
@ -113,7 +113,7 @@ bool ContextGLX::ChangeSurface(const WindowInfo& new_wi)
|
||||||
|
|
||||||
void ContextGLX::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_height /*= 0*/)
|
void ContextGLX::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_height /*= 0*/)
|
||||||
{
|
{
|
||||||
m_window.Resize();
|
m_window.Resize(new_surface_width, new_surface_height);
|
||||||
m_wi.surface_width = m_window.GetWidth();
|
m_wi.surface_width = m_window.GetWidth();
|
||||||
m_wi.surface_height = m_window.GetHeight();
|
m_wi.surface_height = m_window.GetHeight();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue