screen_pointer_pos(&px, &py);
for (i = 0; i < screen_num_monitors; i++) {
- Rect *monitor = screen_physical_area_monitor(i);
+ const Rect *monitor = screen_physical_area_monitor(i);
gboolean contain = RECT_CONTAINS(*monitor, px, py);
- g_free(monitor);
if (contain) {
add_choice(choice, i);
ob_debug("placement adding choice %d for mouse pointer", i);
else *y = areas[i]->y;
for (i = 0; i < screen_num_monitors; ++i)
- g_free(areas[i]);
+ g_slice_free(Rect, areas[i]);
g_free(areas);
return TRUE;
static GSList* area_add(GSList *list, Rect *a)
{
- Rect *r = g_new(Rect, 1);
+ Rect *r = g_slice_new(Rect);
*r = *a;
return g_slist_prepend(list, r);
}
}
/* 'r' is not being added to the result list, so free it */
- g_free(r);
+ g_slice_free(Rect, r);
}
}
g_slist_free(list);
}
while (spaces) {
- g_free(spaces->data);
+ g_slice_free(Rect, spaces->data);
spaces = g_slist_delete_link(spaces, spaces);
}
}
}
for (i = 0; i < screen_num_monitors; ++i)
- g_free(areas[i]);
+ g_slice_free(Rect, areas[i]);
g_free(areas);
return ret;
}
*y = py - client->area.height / 2 - client->frame->size.top;
*y = MIN(MAX(*y, t), b);
+ g_slice_free(Rect, area);
+
return TRUE;
}
/* don't free the first one, it's being set as "screen" */
for (i = 1; i < screen_num_monitors; ++i)
- g_free(areas[i]);
+ g_slice_free(Rect, areas[i]);
g_free(areas);
}
settings->position.x.pos;
else
*x = screen->x + settings->position.x.pos;
+ if (settings->position.x.denom)
+ *x = (*x * screen->width) / settings->position.x.denom;
if (settings->position.y.center)
*y = screen->y + screen->height / 2 - client->area.height / 2;
settings->position.y.pos;
else
*y = screen->y + settings->position.y.pos;
+ if (settings->position.y.denom)
+ *y = (*y * screen->height) / settings->position.y.denom;
- g_free(screen);
+ g_slice_free(Rect, screen);
return TRUE;
}
*y = (areas[0]->height - client->frame->area.height) / 2 + areas[0]->y;
for (i = 0; i < screen_num_monitors; ++i)
- g_free(areas[i]);
+ g_slice_free(Rect, areas[i]);
g_free(areas);
return TRUE;
}