mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 06:14:35 +00:00
Only create decorations if wp_viewporter is supported
This commit is contained in:
parent
4e31dc5e6e
commit
8ed91e8a77
@ -238,6 +238,9 @@ static void createDecorations(_GLFWwindow* window)
|
|||||||
unsigned char data[] = { 224, 224, 224, 255 };
|
unsigned char data[] = { 224, 224, 224, 255 };
|
||||||
const GLFWimage image = { 1, 1, data };
|
const GLFWimage image = { 1, 1, data };
|
||||||
|
|
||||||
|
if (!_glfw.wl.viewporter)
|
||||||
|
return;
|
||||||
|
|
||||||
struct wl_buffer* buffer = createShmBuffer(&image);
|
struct wl_buffer* buffer = createShmBuffer(&image);
|
||||||
|
|
||||||
createDecoration(&window->wl.decorations.top, window->wl.surface, buffer,
|
createDecoration(&window->wl.decorations.top, window->wl.surface, buffer,
|
||||||
@ -276,6 +279,9 @@ static void resizeWindow(_GLFWwindow* window, int width, int height)
|
|||||||
{
|
{
|
||||||
wl_egl_window_resize(window->wl.native, width, height, 0, 0);
|
wl_egl_window_resize(window->wl.native, width, height, 0, 0);
|
||||||
|
|
||||||
|
if (!_glfw.wl.viewporter)
|
||||||
|
return;
|
||||||
|
|
||||||
// Top decoration.
|
// Top decoration.
|
||||||
wp_viewport_set_destination(window->wl.decorations.top.viewport, width, _GLFW_DECORATION_TOP);
|
wp_viewport_set_destination(window->wl.decorations.top.viewport, width, _GLFW_DECORATION_TOP);
|
||||||
wl_surface_commit(window->wl.decorations.top.surface);
|
wl_surface_commit(window->wl.decorations.top.surface);
|
||||||
|
Loading…
Reference in New Issue
Block a user