Add XWayland support (#16)

* save dev state

* fix xwayland-satellite supervisor lifecycle, readiness and cleanup

* remove wayland scanner protocol generated files

* default xwayland enabled with path

* remove jargons

* address x11 review: park unconfirmed cleanup, never signal a reaped group, fix storm test and notify dir mode

* fix resize tests: never build Size values from negative dimensions

* add min-width/min-height window rules that replace client minimum sizes

* rename effective_size_constraints to effective_minimum_size and minor cleanups
This commit is contained in:
Samuel Onoja authored and GitHub committed 2026-10-06 19:40:22 +01:00
1 parent ed23949a95
commit a6f83689f8
42 files changed
+7162 -1333

No files matched your search

+38
View File
@@ -261,8 +261,42 @@ impl Ferese {
self.apply_window_rule_result(window, rule);
}
pub(crate) fn effective_size_constraints(
&self,
window: &Window,
minimum: (i32, i32),
maximum: (i32, i32),
) -> ((i32, i32), (i32, i32)) {
let Some(toplevel) = window.toplevel() else {
return (minimum, maximum);
};
let rules = &self.window_rules;
with_states(toplevel.wl_surface(), |states| {
let attributes = states
.data_map
.get::<XdgToplevelSurfaceData>()
.expect("xdg toplevel state exists")
.lock()
.expect("xdg toplevel state is not poisoned");
let rule = resolve_window_rules(
rules,
attributes.app_id.as_deref(),
attributes.title.as_deref(),
attributes.parent.is_some(),
);
(
(
rule.min_width.map_or(minimum.0, |width| width.ceil() as i32),
rule.min_height.map_or(minimum.1, |height| height.ceil() as i32),
),
maximum,
)
})
}
pub(super) fn reapply_window_rules(&mut self, old_rules: &[WindowRule]) {
let windows = self.windows.ids().keys().cloned().collect::<Vec<_>>();
let mut minimums_changed = false;
for window in windows {
let Some(toplevel) = window.toplevel() else {
continue;
@@ -278,10 +312,14 @@ impl Ferese {
});
let old = resolve_window_rules(old_rules, app_id.as_deref(), title.as_deref(), transient);
let new = resolve_window_rules(&self.window_rules, app_id.as_deref(), title.as_deref(), transient);
minimums_changed |= old.min_width != new.min_width || old.min_height != new.min_height;
if let Some(new) = crate::window_rules::live_result(old, new, transient) {
self.apply_window_rule_result(&window, new);
}
}
if minimums_changed {
self.relayout();
}
}
pub(super) fn apply_window_rule_result(&mut self, window: &Window, rule: crate::window_rules::WindowRuleResult) {