mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 10:48:51 -05:00
wayland: Always make the window surface opaque
This commit is contained in:
parent
ef80beab81
commit
a502152075
|
@ -174,6 +174,21 @@ static const struct wl_surface_listener surfaceListener = {
|
||||||
handleLeave
|
handleLeave
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Makes the surface considered as XRGB instead of ARGB.
|
||||||
|
static void setOpaqueRegion(_GLFWwindow* window)
|
||||||
|
{
|
||||||
|
struct wl_region* region;
|
||||||
|
|
||||||
|
region = wl_compositor_create_region(_glfw.wl.compositor);
|
||||||
|
if (!region)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wl_region_add(region, 0, 0, window->wl.width, window->wl.height);
|
||||||
|
wl_surface_set_opaque_region(window->wl.surface, region);
|
||||||
|
wl_surface_commit(window->wl.surface);
|
||||||
|
wl_region_destroy(region);
|
||||||
|
}
|
||||||
|
|
||||||
static GLFWbool createSurface(_GLFWwindow* window,
|
static GLFWbool createSurface(_GLFWwindow* window,
|
||||||
const _GLFWwndconfig* wndconfig)
|
const _GLFWwndconfig* wndconfig)
|
||||||
{
|
{
|
||||||
|
@ -197,6 +212,9 @@ static GLFWbool createSurface(_GLFWwindow* window,
|
||||||
window->wl.height = wndconfig->height;
|
window->wl.height = wndconfig->height;
|
||||||
window->wl.scale = 1;
|
window->wl.scale = 1;
|
||||||
|
|
||||||
|
// TODO: make this optional once issue #197 is fixed.
|
||||||
|
setOpaqueRegion(window);
|
||||||
|
|
||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,6 +499,7 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||||
window->wl.width = width;
|
window->wl.width = width;
|
||||||
window->wl.height = height;
|
window->wl.height = height;
|
||||||
wl_egl_window_resize(window->wl.native, scaledWidth, scaledHeight, 0, 0);
|
wl_egl_window_resize(window->wl.native, scaledWidth, scaledHeight, 0, 0);
|
||||||
|
setOpaqueRegion(window);
|
||||||
_glfwInputFramebufferSize(window, scaledWidth, scaledHeight);
|
_glfwInputFramebufferSize(window, scaledWidth, scaledHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user