--- a/src/view/xdg-shell.cpp +++ b/src/view/xdg-shell.cpp @@ -15,6 +15,7 @@ #include "xdg-shell.hpp" #include "wayfire/output-layout.hpp" #include +#include #include #include #include @@ -313,6 +314,14 @@ } auto box = get_output()->get_relative_geometry(); + if (auto toplevel = wf::toplevel_cast(toplevel_parent)) + { + // Popup positioners use the toplevel's coordinate system. Keep a + // physical-scope application's menus on its member of a stitched + // output, while virtual-scope and layer-shell parents retain the + // logical output bounds. + box = wf::window_scope_fullscreen(toplevel); + } auto parent_offset = toplevel_parent->get_surface_root_node()->to_global({0, 0}); box.x -= parent_offset.x; box.y -= parent_offset.y;