Integrate native Rime and stabilize input, output, and rendering
- Add optional modifier-only Super binding whose tap is cancelled by other input, focus changes, grabs, locks, and session teardown. - Ship the native ferese-rime user service, Rime defaults, installer inventory, package dependencies, session environment, and docs. - Vendor Smithay 8a27023 with the SHM texture-cache format fix and add GPU regressions for format changes and resize snapshots. - Release reused CRTC owners before staging output modes, then restore changed outputs before former owners when a transaction fails. - Wait for resize-capture GPU completion, expand filtered surface damage, and preserve IME popup origin under fractional scaling. - Mark weekends like holidays in both calendar layouts.
This commit is contained in:
1 parent
a2be421974
commit
993bc0f88f
391 files changed
+130908
-76
No files matched your search
@@ -1,14 +1,17 @@
|
||||
use smithay::backend::allocator::dmabuf::Dmabuf;
|
||||
use smithay::backend::renderer::utils::on_commit_buffer_handler;
|
||||
use smithay::reexports::wayland_server::Client;
|
||||
use smithay::reexports::calloop::Interest;
|
||||
use smithay::reexports::wayland_server::protocol::wl_buffer;
|
||||
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
|
||||
use smithay::reexports::wayland_server::{Client, Resource};
|
||||
use smithay::wayland::buffer::BufferHandler;
|
||||
use smithay::wayland::compositor::{
|
||||
CompositorClientState, CompositorHandler, CompositorState, get_parent, get_role,
|
||||
is_sync_subsurface,
|
||||
BufferAssignment, CompositorClientState, CompositorHandler, CompositorState, SurfaceAttributes,
|
||||
add_blocker, add_pre_commit_hook, get_parent, get_role, is_sync_subsurface, with_states,
|
||||
};
|
||||
use smithay::wayland::dmabuf::{
|
||||
DmabufGlobal, DmabufHandler, DmabufState, ImportNotifier, get_dmabuf,
|
||||
};
|
||||
use smithay::wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportNotifier};
|
||||
use smithay::wayland::shm::{ShmHandler, ShmState};
|
||||
|
||||
use super::{layer_shell, xdg_shell};
|
||||
@@ -29,6 +32,39 @@ impl CompositorHandler for Ferese {
|
||||
|
||||
fn new_surface(&mut self, surface: &WlSurface) {
|
||||
self.update_surface_preferences(surface);
|
||||
// A commit is not proof that the GPU has finished writing its dma-buf.
|
||||
// Keep the previous surface state renderable until the acquire fence
|
||||
// signals, including during resize snapshots and subsurface updates.
|
||||
add_pre_commit_hook::<Self, _>(surface, |state, _dh, surface| {
|
||||
let dmabuf = with_states(surface, |states| {
|
||||
states
|
||||
.cached_state
|
||||
.get::<SurfaceAttributes>()
|
||||
.pending()
|
||||
.buffer
|
||||
.as_ref()
|
||||
.and_then(|assignment| match assignment {
|
||||
BufferAssignment::NewBuffer(buffer) => get_dmabuf(buffer).ok().cloned(),
|
||||
_ => None,
|
||||
})
|
||||
});
|
||||
let Some((dmabuf, client)) = dmabuf.zip(surface.client()) else {
|
||||
return;
|
||||
};
|
||||
if let Ok((blocker, source)) = dmabuf.generate_blocker(Interest::READ) {
|
||||
let inserted = state.loop_handle.insert_source(source, move |_, _, state| {
|
||||
let dh = state.display_handle.clone();
|
||||
state
|
||||
.client_compositor_state(&client)
|
||||
.blocker_cleared(state, &dh);
|
||||
Ok(())
|
||||
});
|
||||
match inserted {
|
||||
Ok(_) => add_blocker(surface, blocker),
|
||||
Err(error) => tracing::warn!(%error, "could not monitor surface GPU readiness"),
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn new_subsurface(&mut self, surface: &WlSurface, _parent: &WlSurface) {
|
||||
|
||||
@@ -81,6 +81,7 @@ impl SeatHandler for Ferese {
|
||||
}
|
||||
|
||||
fn focus_changed(&mut self, seat: &Seat<Self>, focused: Option<&WlSurface>) {
|
||||
self.super_tap.cancel();
|
||||
self.pending_layer_focus = None;
|
||||
// Smithay has already sent enter. last_enter uses a separate mutex;
|
||||
// querying current_focus here would reenter the held keyboard lock.
|
||||
@@ -157,6 +158,7 @@ impl KeyboardShortcutsInhibitHandler for Ferese {
|
||||
.and_then(|keyboard| keyboard.current_focus());
|
||||
|
||||
if focused.as_ref() == Some(inhibitor.wl_surface()) {
|
||||
self.super_tap.cancel();
|
||||
inhibitor.activate();
|
||||
self.active_shortcuts_inhibitor = Some(inhibitor);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ impl VirtualKeyboardHandler for Ferese {
|
||||
_ => None,
|
||||
};
|
||||
if let Some(device) = device {
|
||||
self.super_tap.cancel();
|
||||
keyboard.release_source(self, device.source());
|
||||
}
|
||||
return;
|
||||
@@ -78,7 +79,10 @@ impl VirtualKeyboardHandler for Ferese {
|
||||
context.set_modifier_mask(mods_depressed, mods_latched, mods_locked, group)
|
||||
});
|
||||
}
|
||||
InputEvent::DeviceRemoved { device } => keyboard.release_source(self, device.source()),
|
||||
InputEvent::DeviceRemoved { device } => {
|
||||
self.super_tap.cancel();
|
||||
keyboard.release_source(self, device.source());
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user