floating/resize: Fix broken global geometry
This commit is contained in:
parent
39528878f8
commit
53d2cf01aa
2 changed files with 9 additions and 16 deletions
|
|
@ -28,6 +28,7 @@ use smithay::{
|
||||||
},
|
},
|
||||||
Seat,
|
Seat,
|
||||||
},
|
},
|
||||||
|
output::Output,
|
||||||
utils::{IsAlive, Logical, Point, Rectangle, Serial, Size},
|
utils::{IsAlive, Logical, Point, Rectangle, Serial, Size},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -56,6 +57,7 @@ pub struct ResizeSurfaceGrab {
|
||||||
seat: Seat<State>,
|
seat: Seat<State>,
|
||||||
window: CosmicMapped,
|
window: CosmicMapped,
|
||||||
edges: ResizeEdge,
|
edges: ResizeEdge,
|
||||||
|
output: Output,
|
||||||
initial_window_size: Size<i32, Logical>,
|
initial_window_size: Size<i32, Logical>,
|
||||||
last_window_size: Size<i32, Logical>,
|
last_window_size: Size<i32, Logical>,
|
||||||
release: ReleaseMode,
|
release: ReleaseMode,
|
||||||
|
|
@ -111,15 +113,11 @@ impl ResizeSurfaceGrab {
|
||||||
|
|
||||||
self.last_window_size = (new_window_width, new_window_height).into();
|
self.last_window_size = (new_window_width, new_window_height).into();
|
||||||
|
|
||||||
|
let mut win_loc = location.as_local().to_global(&self.output).to_i32_round();
|
||||||
|
win_loc.y += self.window.ssd_height(false).unwrap_or(0);
|
||||||
self.window.set_resizing(true);
|
self.window.set_resizing(true);
|
||||||
self.window.set_geometry(Rectangle::new(
|
self.window
|
||||||
if let Some(s) = self.window.active_window().x11_surface() {
|
.set_geometry(Rectangle::new(win_loc, self.last_window_size.as_global()));
|
||||||
s.geometry().loc.as_global()
|
|
||||||
} else {
|
|
||||||
(0, 0).into()
|
|
||||||
},
|
|
||||||
self.last_window_size.as_global(),
|
|
||||||
));
|
|
||||||
if self.window.latest_size_committed() {
|
if self.window.latest_size_committed() {
|
||||||
self.window.configure();
|
self.window.configure();
|
||||||
}
|
}
|
||||||
|
|
@ -376,6 +374,7 @@ impl ResizeSurfaceGrab {
|
||||||
start_data: GrabStartData,
|
start_data: GrabStartData,
|
||||||
mapped: CosmicMapped,
|
mapped: CosmicMapped,
|
||||||
edges: ResizeEdge,
|
edges: ResizeEdge,
|
||||||
|
output: Output,
|
||||||
initial_window_location: Point<i32, Local>,
|
initial_window_location: Point<i32, Local>,
|
||||||
initial_window_size: Size<i32, Logical>,
|
initial_window_size: Size<i32, Logical>,
|
||||||
seat: &Seat<State>,
|
seat: &Seat<State>,
|
||||||
|
|
@ -414,6 +413,7 @@ impl ResizeSurfaceGrab {
|
||||||
seat: seat.clone(),
|
seat: seat.clone(),
|
||||||
window: mapped,
|
window: mapped,
|
||||||
edges,
|
edges,
|
||||||
|
output,
|
||||||
initial_window_size,
|
initial_window_size,
|
||||||
last_window_size: initial_window_size,
|
last_window_size: initial_window_size,
|
||||||
release,
|
release,
|
||||||
|
|
@ -525,14 +525,6 @@ impl ResizeSurfaceGrab {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.window.set_resizing(false);
|
self.window.set_resizing(false);
|
||||||
self.window.set_geometry(Rectangle::new(
|
|
||||||
if let Some(x11_surface) = self.window.active_window().x11_surface() {
|
|
||||||
x11_surface.geometry().loc.as_global()
|
|
||||||
} else {
|
|
||||||
(0, 0).into()
|
|
||||||
},
|
|
||||||
self.last_window_size.as_global(),
|
|
||||||
));
|
|
||||||
self.window.configure();
|
self.window.configure();
|
||||||
|
|
||||||
let mut resize_state = self.window.resize_state.lock().unwrap();
|
let mut resize_state = self.window.resize_state.lock().unwrap();
|
||||||
|
|
|
||||||
|
|
@ -899,6 +899,7 @@ impl FloatingLayout {
|
||||||
start_data,
|
start_data,
|
||||||
mapped.clone(),
|
mapped.clone(),
|
||||||
edges,
|
edges,
|
||||||
|
self.space.outputs().next().cloned().unwrap(),
|
||||||
location,
|
location,
|
||||||
size,
|
size,
|
||||||
seat,
|
seat,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue