xdg-shell: Fix menu offset
This commit is contained in:
parent
8c4d77e43c
commit
02a6290067
1 changed files with 9 additions and 2 deletions
|
|
@ -19,9 +19,11 @@ use smithay::{
|
|||
},
|
||||
utils::{Logical, Point, Serial},
|
||||
wayland::{
|
||||
compositor::with_states,
|
||||
seat::WaylandFocus,
|
||||
shell::xdg::{
|
||||
PopupSurface, PositionerState, ToplevelSurface, XdgShellHandler, XdgShellState,
|
||||
PopupSurface, PositionerState, SurfaceCachedState, ToplevelSurface, XdgShellHandler,
|
||||
XdgShellState,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -365,9 +367,14 @@ impl XdgShellHandler for State {
|
|||
surface: ToplevelSurface,
|
||||
seat: WlSeat,
|
||||
serial: Serial,
|
||||
location: Point<i32, Logical>,
|
||||
mut location: Point<i32, Logical>,
|
||||
) {
|
||||
let seat = Seat::from_resource(&seat).unwrap();
|
||||
location -= with_states(surface.wl_surface(), |states| {
|
||||
states.cached_state.current::<SurfaceCachedState>().geometry
|
||||
})
|
||||
.unwrap_or_default()
|
||||
.loc;
|
||||
Shell::menu_request(self, surface.wl_surface(), &seat, serial, location)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue