@@ -28,6 +28,7 @@ use smithay::{
28
28
} ,
29
29
Seat ,
30
30
} ,
31
+ output:: Output ,
31
32
utils:: { IsAlive , Logical , Point , Rectangle , Serial , Size } ,
32
33
} ;
33
34
@@ -56,6 +57,7 @@ pub struct ResizeSurfaceGrab {
56
57
seat : Seat < State > ,
57
58
window : CosmicMapped ,
58
59
edges : ResizeEdge ,
60
+ output : Output ,
59
61
initial_window_size : Size < i32 , Logical > ,
60
62
last_window_size : Size < i32 , Logical > ,
61
63
release : ReleaseMode ,
@@ -111,15 +113,11 @@ impl ResizeSurfaceGrab {
111
113
112
114
self . last_window_size = ( new_window_width, new_window_height) . into ( ) ;
113
115
116
+ let mut win_loc = location. as_local ( ) . to_global ( & self . output ) . to_i32_round ( ) ;
117
+ win_loc. y += self . window . ssd_height ( false ) . unwrap_or ( 0 ) ;
114
118
self . window . set_resizing ( true ) ;
115
- self . window . set_geometry ( Rectangle :: new (
116
- if let Some ( s) = self . window . active_window ( ) . x11_surface ( ) {
117
- s. geometry ( ) . loc . as_global ( )
118
- } else {
119
- ( 0 , 0 ) . into ( )
120
- } ,
121
- self . last_window_size . as_global ( ) ,
122
- ) ) ;
119
+ self . window
120
+ . set_geometry ( Rectangle :: new ( win_loc, self . last_window_size . as_global ( ) ) ) ;
123
121
if self . window . latest_size_committed ( ) {
124
122
self . window . configure ( ) ;
125
123
}
@@ -376,6 +374,7 @@ impl ResizeSurfaceGrab {
376
374
start_data : GrabStartData ,
377
375
mapped : CosmicMapped ,
378
376
edges : ResizeEdge ,
377
+ output : Output ,
379
378
initial_window_location : Point < i32 , Local > ,
380
379
initial_window_size : Size < i32 , Logical > ,
381
380
seat : & Seat < State > ,
@@ -414,6 +413,7 @@ impl ResizeSurfaceGrab {
414
413
seat : seat. clone ( ) ,
415
414
window : mapped,
416
415
edges,
416
+ output,
417
417
initial_window_size,
418
418
last_window_size : initial_window_size,
419
419
release,
@@ -525,14 +525,6 @@ impl ResizeSurfaceGrab {
525
525
}
526
526
527
527
self . window . set_resizing ( false ) ;
528
- self . window . set_geometry ( Rectangle :: new (
529
- if let Some ( x11_surface) = self . window . active_window ( ) . x11_surface ( ) {
530
- x11_surface. geometry ( ) . loc . as_global ( )
531
- } else {
532
- ( 0 , 0 ) . into ( )
533
- } ,
534
- self . last_window_size . as_global ( ) ,
535
- ) ) ;
536
528
self . window . configure ( ) ;
537
529
538
530
let mut resize_state = self . window . resize_state . lock ( ) . unwrap ( ) ;
0 commit comments