|
|
79df40 |
From c4c29246f96ff959db7054c60d9aa76fb45b9e91 Mon Sep 17 00:00:00 2001
|
|
|
79df40 |
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
|
|
|
79df40 |
Date: Wed, 24 Jul 2019 15:41:14 +0200
|
|
|
79df40 |
Subject: [PATCH 21/28] monitor: Use delete link to free the tiled modes while
|
|
|
79df40 |
iterating
|
|
|
79df40 |
|
|
|
79df40 |
We iterate over a temporary list of tiled modes when adding them, but the list
|
|
|
79df40 |
isn't free'd during the iteration.
|
|
|
79df40 |
|
|
|
79df40 |
So use GList's delete_link instead of remove_link.
|
|
|
79df40 |
|
|
|
79df40 |
https://gitlab.gnome.org/GNOME/mutter/merge_requests/682
|
|
|
79df40 |
---
|
|
|
79df40 |
src/backends/meta-monitor.c | 2 +-
|
|
|
79df40 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
79df40 |
|
|
|
79df40 |
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
|
|
|
79df40 |
index ec583aa13..ff959b3bc 100644
|
|
|
79df40 |
--- a/src/backends/meta-monitor.c
|
|
|
79df40 |
+++ b/src/backends/meta-monitor.c
|
|
|
79df40 |
@@ -901,61 +901,61 @@ generate_tiled_monitor_modes (MetaMonitorTiled *monitor_tiled)
|
|
|
79df40 |
|
|
|
79df40 |
main_output = meta_monitor_get_main_output (META_MONITOR (monitor_tiled));
|
|
|
79df40 |
|
|
|
79df40 |
for (i = 0; i < main_output->n_modes; i++)
|
|
|
79df40 |
{
|
|
|
79df40 |
MetaCrtcMode *reference_crtc_mode = main_output->modes[i];
|
|
|
79df40 |
MetaMonitorMode *mode;
|
|
|
79df40 |
gboolean is_preferred;
|
|
|
79df40 |
|
|
|
79df40 |
if (!is_crtc_mode_tiled (main_output, reference_crtc_mode))
|
|
|
79df40 |
continue;
|
|
|
79df40 |
|
|
|
79df40 |
mode = create_tiled_monitor_mode (monitor_tiled, reference_crtc_mode,
|
|
|
79df40 |
&is_preferred);
|
|
|
79df40 |
if (!mode)
|
|
|
79df40 |
continue;
|
|
|
79df40 |
|
|
|
79df40 |
tiled_modes = g_list_append (tiled_modes, mode);
|
|
|
79df40 |
|
|
|
79df40 |
if (is_monitor_mode_assigned (monitor, mode))
|
|
|
79df40 |
monitor_priv->current_mode = mode;
|
|
|
79df40 |
|
|
|
79df40 |
if (is_preferred)
|
|
|
79df40 |
monitor_priv->preferred_mode = mode;
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
while ((l = tiled_modes))
|
|
|
79df40 |
{
|
|
|
79df40 |
MetaMonitorMode *mode = l->data;
|
|
|
79df40 |
|
|
|
79df40 |
- tiled_modes = g_list_remove_link (tiled_modes, l);
|
|
|
79df40 |
+ tiled_modes = g_list_delete_link (tiled_modes, l);
|
|
|
79df40 |
|
|
|
79df40 |
if (!meta_monitor_add_mode (monitor, mode, FALSE))
|
|
|
79df40 |
{
|
|
|
79df40 |
meta_monitor_mode_free (mode);
|
|
|
79df40 |
continue;
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
if (!monitor_priv->preferred_mode)
|
|
|
79df40 |
{
|
|
|
79df40 |
if (!best_mode ||
|
|
|
79df40 |
mode->spec.refresh_rate > best_mode->spec.refresh_rate)
|
|
|
79df40 |
best_mode = mode;
|
|
|
79df40 |
}
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
if (best_mode)
|
|
|
79df40 |
monitor_priv->preferred_mode = best_mode;
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
static MetaMonitorMode *
|
|
|
79df40 |
create_untiled_monitor_mode (MetaMonitorTiled *monitor_tiled,
|
|
|
79df40 |
MetaOutput *main_output,
|
|
|
79df40 |
MetaCrtcMode *crtc_mode)
|
|
|
79df40 |
{
|
|
|
79df40 |
MetaMonitor *monitor = META_MONITOR (monitor_tiled);
|
|
|
79df40 |
MetaMonitorPrivate *monitor_priv =
|
|
|
79df40 |
meta_monitor_get_instance_private (monitor);
|
|
|
79df40 |
MetaMonitorModeTiled *mode;
|
|
|
79df40 |
GList *l;
|
|
|
79df40 |
int i;
|
|
|
79df40 |
--
|
|
|
79df40 |
2.26.2
|
|
|
79df40 |
|