mirror of
https://github.com/elementary/gala.git
synced 2025-01-03 15:53:47 +03:00
InternalUtils: Fix window placement (#1913)
This commit is contained in:
parent
29da53aedc
commit
2d30bee678
@ -143,6 +143,9 @@ namespace Gala {
|
||||
unowned WindowClone id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Careful: List<TilableWindow?> windows will be modified in place and shouldn't be used afterwards.
|
||||
*/
|
||||
#if HAS_MUTTER45
|
||||
public static List<TilableWindow?> calculate_grid_placement (Mtk.Rectangle area, List<TilableWindow?> windows) {
|
||||
#else
|
||||
@ -172,9 +175,8 @@ namespace Gala {
|
||||
}
|
||||
|
||||
// Assign each window to the closest available slot
|
||||
var tmplist = windows.copy ();
|
||||
while (tmplist.length () > 0) {
|
||||
unowned List<unowned TilableWindow?> link = tmplist.nth (0);
|
||||
while (windows.length () > 0) {
|
||||
unowned List<TilableWindow?> link = windows.nth (0);
|
||||
var window = link.data;
|
||||
var rect = window.rect;
|
||||
|
||||
@ -207,9 +209,9 @@ namespace Gala {
|
||||
continue;
|
||||
|
||||
if (taken_slots[slot_candidate] != null)
|
||||
tmplist.prepend (taken_slots[slot_candidate]);
|
||||
windows.prepend (taken_slots[slot_candidate]);
|
||||
|
||||
tmplist.remove_link (link);
|
||||
windows.remove_link (link);
|
||||
taken_slots[slot_candidate] = window;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user