update best_overlap as we go through the loop - doh. Fix from

2002-09-24  Havoc Pennington  <hp@pobox.com>

	* src/place.c (fit_rect_in_xinerama): update best_overlap as we go
	through the loop - doh. Fix from readams@hmc.edu for #90799.
	(find_first_fit): try the origin of each xinerama screen
	after the first. Also from readams@hmc.edu
This commit is contained in:
Havoc Pennington 2002-09-25 01:20:44 +00:00 committed by Havoc Pennington
parent 49a9e74900
commit f5f20efe0d
2 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2002-09-24 Havoc Pennington <hp@pobox.com>
* src/place.c (fit_rect_in_xinerama): update best_overlap as we go
through the loop - doh. Fix from readams@hmc.edu for #90799.
(find_first_fit): try the origin of each xinerama screen
after the first. Also from readams@hmc.edu
2002-09-24 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_save_rect): new function,

View File

@ -374,7 +374,10 @@ fit_rect_in_xinerama (MetaScreen *screen,
overlap = 0;
if (overlap > best_overlap)
best_index = i;
{
best_index = i;
best_overlap = overlap;
}
++i;
}
@ -425,6 +428,7 @@ find_first_fit (MetaWindow *window,
GList *sorted;
GList *tmp;
MetaRectangle rect;
int i;
retval = FALSE;
sorted = NULL;
@ -527,6 +531,31 @@ find_first_fit (MetaWindow *window,
tmp = tmp->next;
}
/* Origin of each Xinerama screen which isn't the first */
i = 1;
while (i < window->screen->n_xinerama_infos)
{
rect.x = window->screen->xinerama_infos[i].x_origin;
rect.y = window->screen->xinerama_infos[i].y_origin;
if (fit_rect_in_xinerama (window->screen, &rect) &&
!rectangle_overlaps_some_window (&rect, windows))
{
*new_x = rect.x;
*new_y = rect.y;
if (fgeom)
{
*new_x += fgeom->left_width;
*new_y += fgeom->top_height;
}
retval = TRUE;
goto out;
}
++i;
}
out:
g_list_free (sorted);