mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
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:
parent
49a9e74900
commit
f5f20efe0d
@ -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>
|
2002-09-24 Havoc Pennington <hp@redhat.com>
|
||||||
|
|
||||||
* src/window.c (meta_window_save_rect): new function,
|
* src/window.c (meta_window_save_rect): new function,
|
||||||
|
31
src/place.c
31
src/place.c
@ -374,7 +374,10 @@ fit_rect_in_xinerama (MetaScreen *screen,
|
|||||||
overlap = 0;
|
overlap = 0;
|
||||||
|
|
||||||
if (overlap > best_overlap)
|
if (overlap > best_overlap)
|
||||||
best_index = i;
|
{
|
||||||
|
best_index = i;
|
||||||
|
best_overlap = overlap;
|
||||||
|
}
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
@ -425,6 +428,7 @@ find_first_fit (MetaWindow *window,
|
|||||||
GList *sorted;
|
GList *sorted;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
MetaRectangle rect;
|
MetaRectangle rect;
|
||||||
|
int i;
|
||||||
|
|
||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
sorted = NULL;
|
sorted = NULL;
|
||||||
@ -528,6 +532,31 @@ find_first_fit (MetaWindow *window,
|
|||||||
tmp = tmp->next;
|
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:
|
out:
|
||||||
g_list_free (sorted);
|
g_list_free (sorted);
|
||||||
return retval;
|
return retval;
|
||||||
|
Loading…
Reference in New Issue
Block a user