Add toplevel map-location hint to xdg-shell
Applications such as zoom will open a new window when a meeting is started. Usually there is a long time (at least several seconds) between the user requesting access to a meeting and the meeting actually starting. During this time the user might move his focus to a different output or to a different workspace. When zoom finally creates the window, the compositor might map this window wherever the current focus of the user is.
Instead it might be more optimal to map the window on the same workspace or at least on the same output as the main zoom window.
The following addition to xdg-shell could allow us to fix this problem:
// Sets a hint for the compositor where to map this toplevel.
//
// This hint is only used during the current commit cycle. If the application
// unmaps the toplevel and later maps it again, it should set the hint again at
// that point.
//
// This hint is ignored unless the toplevel is newly mapped during this commit
// cycle.
//
// The compositor is free to ignore this hint.
fn xdg_toplevel::set_map_location_hint(
// The surface relative to which this toplevel should be mapped.
reference_surface: wl_surface,
// The granularity of the hint.
granularity: map_location_hint_granularity,
);
enum map_location_hint_granularity {
// The toplevel should be mapped on the same output as the reference surface.
Output,
// The toplevel should be mapped on the same workspace as the reference surface.
Workspace,
}