diff --git a/include/view.h b/include/view.h index f18904fc..824657e8 100644 --- a/include/view.h +++ b/include/view.h @@ -414,7 +414,7 @@ void view_center(struct view *view, const struct wlr_box *ref); * view_place_initial - apply initial placement strategy to view * @view: view to be placed */ -void view_place_initial(struct view *view); +void view_place_initial(struct view *view, bool allow_cursor); void view_constrain_size_to_that_of_usable_area(struct view *view); void view_restore_to(struct view *view, struct wlr_box geometry); diff --git a/src/view.c b/src/view.c index c48ff9e0..8c26a8f1 100644 --- a/src/view.c +++ b/src/view.c @@ -728,9 +728,9 @@ view_center(struct view *view, const struct wlr_box *ref) } void -view_place_initial(struct view *view) +view_place_initial(struct view *view, bool allow_cursor) { - if (rc.placement_policy == LAB_PLACE_CURSOR) { + if (allow_cursor && rc.placement_policy == LAB_PLACE_CURSOR) { view_move_to_cursor(view); return; } else if (rc.placement_policy == LAB_PLACE_AUTOMATIC) { diff --git a/src/xdg.c b/src/xdg.c index 5787836b..5347d78c 100644 --- a/src/xdg.c +++ b/src/xdg.c @@ -435,7 +435,7 @@ set_initial_position(struct view *view) } /* All other views are placed according to a configured strategy */ - view_place_initial(view); + view_place_initial(view, /* allow_cursor */ true); } static const char * diff --git a/src/xwayland.c b/src/xwayland.c index 2d86427f..d032fd43 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -519,7 +519,7 @@ set_initial_position(struct view *view, view_constrain_size_to_that_of_usable_area(view); if (view_is_floating(view)) { - view_place_initial(view); + view_place_initial(view, /* allow_cursor */ true); } else { /* * View is maximized/fullscreen. Center the