struct view_size_hints (*get_size_hints)(struct view *self);
/* if not implemented, VIEW_WANTS_FOCUS_ALWAYS is assumed */
enum view_wants_focus (*wants_focus)(struct view *self);
+ /* returns true if view reserves space at screen edge */
+ bool (*has_strut_partial)(struct view *self);
};
struct view {
*/
bool view_is_related(struct view *view, struct wlr_surface *surface);
+/**
+ * view_has_strut_partial() - returns true for views that reserve space
+ * at a screen edge (e.g. panels). These views are treated as if they
+ * have the fixedPosition window rule: i.e. they are not restricted to
+ * the usable area and cannot be moved/resized interactively.
+ */
+bool view_has_strut_partial(struct view *view);
+
const char *view_get_string_prop(struct view *view, const char *prop);
void view_update_title(struct view *view);
void view_update_app_id(struct view *view);
return;
}
- if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE) {
+ /* Prevent moving/resizing fixed-position and panel-like views */
+ if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE
+ || view_has_strut_partial(view)) {
return;
}
return false;
}
- if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE) {
+ /* Avoid moving panels out of their own reserved area ("strut") */
+ if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE
+ || view_has_strut_partial(view)) {
return false;
}
return false;
}
+bool
+view_has_strut_partial(struct view *view)
+{
+ assert(view);
+ return view->impl->has_strut_partial &&
+ view->impl->has_strut_partial(view);
+}
+
const char *
view_get_string_prop(struct view *view, const char *prop)
{
return VIEW_WANTS_FOCUS_NEVER;
}
+static bool
+xwayland_view_has_strut_partial(struct view *view)
+{
+ struct wlr_xwayland_surface *xsurface =
+ xwayland_surface_from_view(view);
+ return (bool)xsurface->strut_partial;
+}
+
static struct wlr_xwayland_surface *
top_parent_of(struct view *view)
{
.is_related = xwayland_view_is_related,
.get_size_hints = xwayland_view_get_size_hints,
.wants_focus = xwayland_view_wants_focus,
+ .has_strut_partial = xwayland_view_has_strut_partial,
};
void