diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c index a7b29a633b..052f58d32d 100644 --- a/app/display/gimpstatusbar.c +++ b/app/display/gimpstatusbar.c @@ -1207,8 +1207,32 @@ gimp_statusbar_update_cursor (GimpStatusbar *statusbar, GimpImage *image; gchar buffer[CURSOR_LEN]; +#ifdef GDK_WINDOWING_QUARTZ + /* + * This optimization dramatically improves drawing refresh speed on Macs with retina + * displays, which is all macbook pros since 2016 and macbook airs since 2018 and + * running Big Sur (released Nov 2020) or higher. + * https://gitlab.gnome.org/GNOME/gimp/-/issues/7690 + */ + gint64 curr_time = g_get_monotonic_time (); +#endif + g_return_if_fail (GIMP_IS_STATUSBAR (statusbar)); +#ifdef GDK_WINDOWING_QUARTZ + /* + * This optimization dramatically improves drawing refresh speed on Macs with retina + * displays, which is all macbook pros since 2016 and macbook airs since 2018 and + * running Big Sur (released Nov 2020) or higher. + * https://gitlab.gnome.org/GNOME/gimp/-/issues/7690 + */ + /* only redraw max every 100ms */ + if (curr_time - statusbar->last_frame_time < 1000 * 300) + return; + + statusbar->last_frame_time = curr_time; +#endif + shell = statusbar->shell; image = gimp_display_get_image (shell->display); diff --git a/app/display/gimpstatusbar.h b/app/display/gimpstatusbar.h index 0caeafb10d..c1d9f78630 100644 --- a/app/display/gimpstatusbar.h +++ b/app/display/gimpstatusbar.h @@ -44,6 +44,16 @@ struct _GimpStatusbar GHashTable *context_ids; guint seq_context_id; +#ifdef GDK_WINDOWING_QUARTZ + /* + * This optimization dramatically improves drawing refresh speed on Macs with retina + * displays, which is all macbook pros since 2016 and macbook airs since 2018 and + * running Big Sur (released Nov 2020) or higher. + * https://gitlab.gnome.org/GNOME/gimp/-/issues/7690 + */ + gint64 last_frame_time; +#endif + GdkPixbuf *icon; GHashTable *icon_hash; gint icon_space_width;