1 --- mate-desktop-1.12.1/libmate-desktop/mate-rr.c.~1~ 2015-11-30 10:10:03.000000000 +0300
2 +++ mate-desktop-1.12.1/libmate-desktop/mate-rr.c 2015-12-05 17:39:12.583263260 +0300
5 screen_info_new (MateRRScreen *screen, gboolean needs_reprobe, GError **error)
7 + GTimeVal cur_time_val;
10 + g_assert (screen != NULL);
12 + if ( screen->priv->info != NULL ) {
13 + g_get_current_time(&cur_time_val);
14 + cur = (gint64) cur_time_val.tv_sec * G_USEC_PER_SEC + cur_time_val.tv_usec;
15 + prev =(gint64) screen->priv->last_update_time.tv_sec * G_USEC_PER_SEC + screen->priv->last_update_time.tv_usec;
17 + /* Only referesh the info after 2 seconds have elapsed since last
18 + * update, otherwise it will cause a lot of extra probing on the X
21 + if (((cur - prev) < 0) || ((cur - prev) > 2000000)) {
22 + screen->priv->last_update_time = cur_time_val;
25 + /* Don't return any update, which should result in caller using
28 + g_warning("Call to screen_info_new is too frequent, skipping...");
33 ScreenInfo *info = g_new0 (ScreenInfo, 1);
34 MateRRScreenPrivate *priv;
36 - g_assert (screen != NULL);
42 priv->info = screen_info_new (self, TRUE, error);
44 + /* Initialize the last udpate time */
45 + g_get_current_time (&(priv->last_update_time));
51 --- mate-desktop-1.24.0/libmate-desktop/mate-rr-private.h 2020-02-10 11:33:51.000000000 +0000
52 +++ mate-desktop-1.24.0/libmate-desktop/mate-rr-private.h.new 2020-02-15 21:23:48.202041412 +0000
53 @@ -46,6 +46,7 @@ struct MateRRScreenPrivate
57 + GTimeVal last_update_time;
58 Atom connector_type_atom;