- screen = screen_area_monitor(client->desktop,
- (guint)settings->monitor - 1);
- else {
- Rect **all = NULL;
- all = pick_head(client);
- screen = all[0];
- g_free(all); /* the areas themselves don't need to be freed */
+ screen = screen_area(client->desktop, (guint)settings->monitor - 1,
+ NULL);
+
+ /* if we have't found a screen yet.. */
+ if (!screen) {
+ Rect **areas;
+ guint i;
+
+ areas = pick_head(client);
+ screen = areas[0];
+
+ /* don't free the first one, it's being set as "screen" */
+ for (i = 1; i < screen_num_monitors; ++i)
+ g_slice_free(Rect, areas[i]);
+ g_free(areas);