mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-20 15:12:37 +00:00
Fix margins drawn with the wrong viewport with the Vulkan driver
The viewport is driver state shared by all surfaces with Vulkan (and Metal), unlike OpenGL where it is per context. It was set only when an OS Window's size changed, so a resize of another OS Window could leave a stale viewport in place, causing the border/margin rects to be drawn at the wrong size. Set it every time an OS Window is rendered. Fixes #10813
This commit is contained in:
parent
0ed517c6b6
commit
ea7568d513
1 changed files with 5 additions and 1 deletions
|
|
@ -1207,8 +1207,12 @@ render_os_window(OSWindow *w, monotonic_t now, bool scan_for_animated_images) {
|
|||
w->render_calls++;
|
||||
make_os_window_context_current(w);
|
||||
bool needs_render = w->redraw_count > 0 || w->live_resize.in_progress || global_state.thumbnail_callback.os_window == w->id;
|
||||
// The viewport is driver state shared by all surfaces with some GPU
|
||||
// drivers, such as Vulkan, so it must be set for this window every time,
|
||||
// as it may have been changed while another OS Window was current, for
|
||||
// example, by a resize of another OS Window.
|
||||
set_gpu_viewport(w->viewport_width, w->viewport_height);
|
||||
if (w->viewport_size_dirty) {
|
||||
set_gpu_viewport(w->viewport_width, w->viewport_height);
|
||||
w->viewport_size_dirty = false;
|
||||
needs_render = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue