Handle OS not reporting live resizing end
This commit is contained in:
parent
c181919a57
commit
fd7ddc2905
@ -663,7 +663,7 @@ render(double now) {
|
|||||||
for (size_t i = 0; i < global_state.num_os_windows; i++) {
|
for (size_t i = 0; i < global_state.num_os_windows; i++) {
|
||||||
OSWindow *w = global_state.os_windows + i;
|
OSWindow *w = global_state.os_windows + i;
|
||||||
if (!w->num_tabs) continue;
|
if (!w->num_tabs) continue;
|
||||||
if (w->live_resize.in_progress || !should_os_window_be_rendered(w)) {
|
if ((w->live_resize.in_progress && (now - w->live_resize.last_resize_event_at) < 1) || !should_os_window_be_rendered(w)) {
|
||||||
update_os_window_title(w);
|
update_os_window_title(w);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,9 +59,8 @@ update_os_window_viewport(OSWindow *window, bool notify_boss) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_resizing_window(OSWindow *w, unsigned int width, unsigned int height) {
|
draw_resizing_text(OSWindow *w, unsigned int width, unsigned int height) {
|
||||||
char text[32] = {0};
|
char text[32] = {0};
|
||||||
blank_os_window(w);
|
|
||||||
snprintf(text, sizeof(text), "%u x %u cells", width / w->fonts_data->cell_width, height / w->fonts_data->cell_height);
|
snprintf(text, sizeof(text), "%u x %u cells", width / w->fonts_data->cell_width, height / w->fonts_data->cell_height);
|
||||||
StringCanvas rendered = render_simple_text(w->fonts_data, text);
|
StringCanvas rendered = render_simple_text(w->fonts_data, text);
|
||||||
if (rendered.canvas) {
|
if (rendered.canvas) {
|
||||||
@ -164,7 +163,8 @@ framebuffer_size_callback(GLFWwindow *w, int width, int height) {
|
|||||||
// you get partially rendered windows.
|
// you get partially rendered windows.
|
||||||
make_os_window_context_current(window);
|
make_os_window_context_current(window);
|
||||||
update_surface_size(width, height, window->offscreen_texture_id);
|
update_surface_size(width, height, window->offscreen_texture_id);
|
||||||
draw_resizing_window(window, MAX(0, width), MAX(0, height));
|
blank_os_window(window);
|
||||||
|
draw_resizing_text(window, MAX(0, width), MAX(0, height));
|
||||||
swap_window_buffers(window);
|
swap_window_buffers(window);
|
||||||
request_tick_callback();
|
request_tick_callback();
|
||||||
} else log_error("Ignoring resize request for tiny size: %dx%d", width, height);
|
} else log_error("Ignoring resize request for tiny size: %dx%d", width, height);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user