@@ -41,8 +41,8 @@ void Cursor::process_resize(const uint32_t time) const {
41
41
return ;
42
42
}
43
43
44
- const wlr_box min_size = view->get_min_size_with_decorations ();
45
- const wlr_box max_size = view->get_max_size_with_decorations ();
44
+ const wlr_box min_size = view->get_surface_min_size ();
45
+ const wlr_box max_size = view->get_surface_max_size ();
46
46
const double border_x = wlr.x - seat.server .grab_x ;
47
47
const double border_y = wlr.y - seat.server .grab_y ;
48
48
int32_t new_left = seat.server .grab_geobox .x ;
@@ -199,8 +199,27 @@ static void cursor_button_notify(wl_listener* listener, void* data) {
199
199
/* Focus that client if the button was _pressed_ */
200
200
server.focus_view (std::dynamic_pointer_cast<View>(magpie_surface));
201
201
202
- if (server.ssd_at (cursor.wlr .x , cursor.wlr .y ) == SceneRectType::TITLEBAR) {
202
+ auto ssd_at_cursor = server.ssd_at (cursor.wlr .x , cursor.wlr .y );
203
+ if (ssd_at_cursor == SceneRectType::TITLEBAR) {
203
204
view->begin_interactive (MAGPIE_CURSOR_MOVE, 0 );
205
+ } else if (ssd_at_cursor == SceneRectType::BORDER || ssd_at_cursor == SceneRectType::EXTENTS) {
206
+ auto surface_geo = view->surface_current ;
207
+
208
+ uint8_t edges = WLR_EDGE_NONE;
209
+ if (cursor.wlr .x < surface_geo.x ) {
210
+ edges |= WLR_EDGE_LEFT;
211
+ }
212
+ if (cursor.wlr .y < surface_geo.y ) {
213
+ edges |= WLR_EDGE_TOP;
214
+ }
215
+ if (cursor.wlr .x > surface_geo.x + surface_geo.width ) {
216
+ edges |= WLR_EDGE_RIGHT;
217
+ }
218
+ if (cursor.wlr .y > surface_geo.y + surface_geo.height ) {
219
+ edges |= WLR_EDGE_BOTTOM;
220
+ }
221
+
222
+ view->begin_interactive (MAGPIE_CURSOR_RESIZE, edges);
204
223
}
205
224
} else {
206
225
server.focus_view (nullptr );
0 commit comments