Rename state variable to be closer to its actual purpose
This commit is contained in:
@@ -594,7 +594,7 @@ prepare_to_render_os_window(OSWindow *os_window, monotonic_t now, unsigned int *
|
||||
monotonic_t min_gap;
|
||||
if (scan_active_animations(WD.screen->grman, now, &min_gap, true)) needs_render = true;
|
||||
if (min_gap < MONOTONIC_T_MAX) {
|
||||
global_state.has_active_animated_images = true;
|
||||
global_state.check_for_active_animated_images = true;
|
||||
set_maximum_wait(min_gap);
|
||||
}
|
||||
}
|
||||
@@ -670,7 +670,7 @@ no_render_frame_received_recently(OSWindow *w, monotonic_t now, monotonic_t max_
|
||||
|
||||
static inline void
|
||||
render(monotonic_t now, bool input_read) {
|
||||
EVDBG("input_read: %d, has_active_animated_images: %d", input_read, global_state.has_active_animated_images);
|
||||
EVDBG("input_read: %d, check_for_active_animated_images: %d", input_read, global_state.check_for_active_animated_images);
|
||||
static monotonic_t last_render_at = MONOTONIC_T_MIN;
|
||||
monotonic_t time_since_last_render = last_render_at == MONOTONIC_T_MIN ? OPT(repaint_delay) : now - last_render_at;
|
||||
if (!input_read && time_since_last_render < OPT(repaint_delay)) {
|
||||
@@ -678,8 +678,8 @@ render(monotonic_t now, bool input_read) {
|
||||
return;
|
||||
}
|
||||
|
||||
const bool scan_for_animated_images = global_state.has_active_animated_images;
|
||||
global_state.has_active_animated_images = false;
|
||||
const bool scan_for_animated_images = global_state.check_for_active_animated_images;
|
||||
global_state.check_for_active_animated_images = false;
|
||||
|
||||
for (size_t i = 0; i < global_state.num_os_windows; i++) {
|
||||
OSWindow *w = global_state.os_windows + i;
|
||||
|
||||
@@ -162,7 +162,7 @@ window_close_callback(GLFWwindow* window) {
|
||||
static void
|
||||
window_occlusion_callback(GLFWwindow *window, bool occluded) {
|
||||
if (!set_callback_window(window)) return;
|
||||
if (!occluded) global_state.has_active_animated_images = true;
|
||||
if (!occluded) global_state.check_for_active_animated_images = true;
|
||||
request_tick_callback();
|
||||
global_state.callback_os_window = NULL;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ window_occlusion_callback(GLFWwindow *window, bool occluded) {
|
||||
static void
|
||||
window_iconify_callback(GLFWwindow *window, int iconified) {
|
||||
if (!set_callback_window(window)) return;
|
||||
if (!iconified) global_state.has_active_animated_images = true;
|
||||
if (!iconified) global_state.check_for_active_animated_images = true;
|
||||
request_tick_callback();
|
||||
global_state.callback_os_window = NULL;
|
||||
}
|
||||
|
||||
@@ -768,7 +768,7 @@ grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float scree
|
||||
}
|
||||
if (img->is_drawn && !was_drawn && img->animation_enabled && img->extra_framecnt && img->animation_duration) {
|
||||
self->has_images_needing_animation = true;
|
||||
global_state.has_active_animated_images = true;
|
||||
global_state.check_for_active_animated_images = true;
|
||||
}
|
||||
}
|
||||
if (!self->count) return false;
|
||||
@@ -1016,7 +1016,7 @@ handle_animation_control_command(GraphicsManager *self, bool *is_dirty, const Gr
|
||||
if (img->animation_enabled) {
|
||||
self->has_images_needing_animation = true;
|
||||
if (!was_enabled) img->current_frame_shown_at = monotonic();
|
||||
global_state.has_active_animated_images = true;
|
||||
global_state.check_for_active_animated_images = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,7 +955,7 @@ PYWRAP1(update_window_visibility) {
|
||||
WITH_WINDOW(os_window_id, tab_id, window_id);
|
||||
bool was_visible = window->visible & 1;
|
||||
window->visible = visible & 1;
|
||||
if (!was_visible && window->visible) global_state.has_active_animated_images = true;
|
||||
if (!was_visible && window->visible) global_state.check_for_active_animated_images = true;
|
||||
END_WITH_WINDOW;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ typedef struct {
|
||||
bool has_pending_resizes, has_pending_closes;
|
||||
bool in_sequence_mode;
|
||||
bool tab_bar_hidden;
|
||||
bool has_active_animated_images;
|
||||
bool check_for_active_animated_images;
|
||||
double font_sz_in_pts;
|
||||
struct { double x, y; } default_dpi;
|
||||
id_type active_drag_in_window;
|
||||
|
||||
Reference in New Issue
Block a user