I was looking at How can I reliably resize a window via metaWindow.move_resize_frame(boolean, x, y, width, height)
What I understood is, I should replace:
window.move_resize_frame(false, x, y, width, height);
with
GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
window.move_resize_frame(false, x, y, width, height);
return GLib.SOURCE_REMOVE;
});
I did and it works.
However, the move seems slow.
Then i looked at metaWindowActor.connect('first-frame'
. I think it will be faster.
When i replaced:
window.move_resize_frame(false, x, y, width, height);
with
let windowReadyId = 0;
Meta.WindowActor.connect('first-frame', () => {
windowReadyId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
meta_window.move_resize_frame(false, x, y, width, height);
windowReadyId = 0
return GLib.SOURCE_REMOVE;
});
});
meta_window.connect('unmanaging', () => {
if (windowReadyId)
GLib.Source.remove(windowReadyId);
});
it does not work. Am i missing some imports or something.