I found from win.meta_window.move_resize_frame(0, x, y, width, height) does not work on tiled window (#2407) · Issues · GNOME / mutter · GitLab that
“Tiled” is treated as a window state like “maximized”, so the window is positioned and sized automatically until it becomes unconstrained again.
My first keyword was constraints. So i tried
win.clear_constraints();
win.clear_actions();
win.clear_effects();
It did not work.
Then i ended up with:
MoveResize(winid, x, y, width, height) {
let win = global.get_window_actors().find(w => w.meta_window.get_id() == winid);
if (win) {
if (win.meta_window.maximized_horizontally || win.meta_window.maximized_vertically) {
win.meta_window.unmaximize(3);
}
win.meta_window.move_resize_frame(0, x, y, width, height);
} else {
throw new Error('Not found');
}
}
This looks like a hack as i am unmaximizing or untiling before moving the window.
What is the native solution here? This looks odd that a window unmaximize then go to a different location. I want to do something so that the unmaximizing is not visible before moving or resizing. I want to change some internal state so that there are no more constrains and i can just move or resize the window.