Declare variables at start of blocks in place.c
This commit is contained in:
parent
f469a46da1
commit
9fb4b56ba9
1 changed files with 22 additions and 19 deletions
|
@ -257,13 +257,13 @@ static Rect* choose_monitor(ObClient *c, gboolean client_to_be_foregrounded,
|
||||||
static gboolean place_under_mouse(ObClient *client, gint *x, gint *y,
|
static gboolean place_under_mouse(ObClient *client, gint *x, gint *y,
|
||||||
Size frame_size)
|
Size frame_size)
|
||||||
{
|
{
|
||||||
if (config_place_policy != OB_PLACE_POLICY_MOUSE)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
gint l, r, t, b;
|
gint l, r, t, b;
|
||||||
gint px, py;
|
gint px, py;
|
||||||
Rect *area;
|
Rect *area;
|
||||||
|
|
||||||
|
if (config_place_policy != OB_PLACE_POLICY_MOUSE)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
ob_debug("placing under mouse");
|
ob_debug("placing under mouse");
|
||||||
|
|
||||||
if (!screen_pointer_pos(&px, &py))
|
if (!screen_pointer_pos(&px, &py))
|
||||||
|
@ -443,24 +443,27 @@ static gboolean place_least_overlap(ObClient *c, Rect *head, int *x, int *y,
|
||||||
n_client_rects += 1;
|
n_client_rects += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rect client_rects[n_client_rects];
|
|
||||||
|
|
||||||
GSList* it;
|
{
|
||||||
guint i = 0;
|
Rect client_rects[n_client_rects];
|
||||||
if (!config_dock_hide)
|
GSList* it;
|
||||||
dock_get_area(&client_rects[i++]);
|
Point result;
|
||||||
for (it = potential_overlap_clients; it != NULL; it = g_slist_next(it)) {
|
guint i = 0;
|
||||||
ObClient* potential_overlap_client = (ObClient*)it->data;
|
|
||||||
client_rects[i] = potential_overlap_client->frame->area;
|
if (!config_dock_hide)
|
||||||
i += 1;
|
dock_get_area(&client_rects[i++]);
|
||||||
|
for (it = potential_overlap_clients; it != NULL; it = g_slist_next(it)) {
|
||||||
|
ObClient* potential_overlap_client = (ObClient*)it->data;
|
||||||
|
client_rects[i] = potential_overlap_client->frame->area;
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
g_slist_free(potential_overlap_clients);
|
||||||
|
|
||||||
|
place_overlap_find_least_placement(client_rects, n_client_rects, head,
|
||||||
|
&frame_size, &result);
|
||||||
|
*x = result.x;
|
||||||
|
*y = result.y;
|
||||||
}
|
}
|
||||||
g_slist_free(potential_overlap_clients);
|
|
||||||
|
|
||||||
Point result;
|
|
||||||
place_overlap_find_least_placement(client_rects, n_client_rects, head,
|
|
||||||
&frame_size, &result);
|
|
||||||
*x = result.x;
|
|
||||||
*y = result.y;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue