mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Dont call wl_egl_window_resize on every swap
This commit is contained in:
parent
8e59b598e0
commit
8c7994c0ac
2 changed files with 6 additions and 2 deletions
2
glfw/wl_platform.h
vendored
2
glfw/wl_platform.h
vendored
|
|
@ -186,7 +186,7 @@ typedef struct _GLFWwindowWayland
|
|||
} layer_shell;
|
||||
|
||||
struct {
|
||||
int width, height;
|
||||
int width, height, dirty;
|
||||
} framebuffer_size_at_last_resize;
|
||||
/* information about axis events on current frame */
|
||||
struct
|
||||
|
|
|
|||
6
glfw/wl_window.c
vendored
6
glfw/wl_window.c
vendored
|
|
@ -379,12 +379,16 @@ resizeFramebuffer(_GLFWwindow* window) {
|
|||
wait_for_swap_to_commit(window);
|
||||
window->wl.framebuffer_size_at_last_resize.width = scaled_width;
|
||||
window->wl.framebuffer_size_at_last_resize.height = scaled_height;
|
||||
window->wl.framebuffer_size_at_last_resize.dirty = true;
|
||||
_glfwInputFramebufferSize(window, scaled_width, scaled_height);
|
||||
}
|
||||
|
||||
void
|
||||
_glfwWaylandBeforeBufferSwap(_GLFWwindow* window) {
|
||||
wl_egl_window_resize(window->wl.native, window->wl.framebuffer_size_at_last_resize.width, window->wl.framebuffer_size_at_last_resize.height, 0, 0);
|
||||
if (window->wl.framebuffer_size_at_last_resize.dirty) {
|
||||
wl_egl_window_resize(window->wl.native, window->wl.framebuffer_size_at_last_resize.width, window->wl.framebuffer_size_at_last_resize.height, 0, 0);
|
||||
window->wl.framebuffer_size_at_last_resize.dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue