mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-25 09:59:21 +01:00
Fiddle with stuff
This commit is contained in:
parent
d813d429bf
commit
824595637b
5 changed files with 17 additions and 8 deletions
|
@ -99,6 +99,8 @@ function pinnacle.setup(config_func)
|
|||
local msg_len_bytes, err_msg, err_num = read_exact(socket_fd, 4)
|
||||
assert(msg_len_bytes)
|
||||
|
||||
-- TODO: break here if error in read_exact
|
||||
|
||||
---@type integer
|
||||
local msg_len = string.unpack("=I4", msg_len_bytes)
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ impl FocusState {
|
|||
Default::default()
|
||||
}
|
||||
|
||||
// TODO: how does this work with unmapped windows?
|
||||
/// Get the currently focused window. If there is none, the previous focus is returned.
|
||||
pub fn current_focus(&mut self) -> Option<Window> {
|
||||
while let Some(window) = self.focus_stack.last() {
|
||||
|
|
|
@ -96,6 +96,8 @@ impl<B: Backend> CompositorHandler for State<B> {
|
|||
}
|
||||
|
||||
fn commit(&mut self, surface: &WlSurface) {
|
||||
tracing::debug!("commit");
|
||||
|
||||
utils::on_commit_buffer_handler::<Self>(surface);
|
||||
|
||||
if !compositor::is_sync_subsurface(surface) {
|
||||
|
@ -147,7 +149,7 @@ fn ensure_initial_configure<B: Backend>(surface: &WlSurface, state: &mut State<B
|
|||
// println!("initial_configure_sent is {}", initial_configure_sent);
|
||||
|
||||
if !initial_configure_sent {
|
||||
tracing::info!("Initial configure");
|
||||
tracing::debug!("Initial configure");
|
||||
window.toplevel().send_configure();
|
||||
}
|
||||
return;
|
||||
|
@ -257,7 +259,7 @@ impl<B: Backend> XdgShellHandler for State<B> {
|
|||
let windows: Vec<Window> = self.space.elements().cloned().collect();
|
||||
|
||||
self.loop_handle.insert_idle(|data| {
|
||||
tracing::info!("Layout master_stack");
|
||||
tracing::debug!("Layout master_stack");
|
||||
Layout::master_stack(&mut data.state, windows, crate::layout::Direction::Left);
|
||||
});
|
||||
}
|
||||
|
@ -389,11 +391,13 @@ impl<B: Backend> XdgShellHandler for State<B> {
|
|||
// | mapping the element in commit, this means that the window won't reappear on a tag
|
||||
// | change. The code below is a workaround until I can figure it out.
|
||||
if !self.space.elements().any(|win| win == &window) {
|
||||
tracing::debug!("remapping window");
|
||||
WindowState::with_state(&window, |state| {
|
||||
if let WindowResizeState::WaitingForCommit(new_loc) = state.resize_state {
|
||||
self.space.map_element(window.clone(), new_loc, false);
|
||||
state.resize_state = WindowResizeState::Idle;
|
||||
tracing::debug!("remapping window");
|
||||
let win = window.clone();
|
||||
self.loop_handle.insert_idle(move |data| {
|
||||
data.state.space.map_element(win, new_loc, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -263,10 +263,8 @@ impl<B: Backend> State<B> {
|
|||
move_mode = false;
|
||||
}
|
||||
}
|
||||
FilterResult::Forward
|
||||
} else {
|
||||
FilterResult::Forward
|
||||
}
|
||||
FilterResult::Forward
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ impl Layout {
|
|||
|
||||
window.toplevel().with_pending_state(|tl_state| {
|
||||
tl_state.size = Some(state.space.output_geometry(output).unwrap().size);
|
||||
tracing::debug!("only size is {:?}", tl_state.size);
|
||||
});
|
||||
|
||||
let initial_configure_sent =
|
||||
|
@ -83,6 +84,7 @@ impl Layout {
|
|||
let mut size = state.space.output_geometry(output).unwrap().size;
|
||||
size.w /= 2;
|
||||
tl_state.size = Some(size);
|
||||
tracing::debug!("first size is {:?}", tl_state.size);
|
||||
});
|
||||
|
||||
let initial_configure_sent =
|
||||
|
@ -97,6 +99,7 @@ impl Layout {
|
|||
});
|
||||
if initial_configure_sent {
|
||||
WindowState::with_state(first_window, |state| {
|
||||
tracing::debug!("sending resize state");
|
||||
state.resize_state = WindowResizeState::WaitingForAck(
|
||||
first_window.toplevel().send_configure(),
|
||||
output.current_location(),
|
||||
|
@ -122,6 +125,7 @@ impl Layout {
|
|||
// | this is set too low.
|
||||
new_size.h = new_size.h.clamp(40, i32::MAX);
|
||||
state.size = Some(new_size);
|
||||
tracing::debug!("size is {:?}", state.size);
|
||||
});
|
||||
|
||||
let mut new_loc = output.current_location();
|
||||
|
|
Loading…
Reference in a new issue