Clean up stuff and update README

This commit is contained in:
Ottatop 2023-08-02 19:45:56 -05:00
parent ad30f4668b
commit 74646d4fc9
3 changed files with 25 additions and 13 deletions

View file

@ -11,10 +11,8 @@
A very, VERY WIP Smithay-based wayland compositor
</div>
## API Documentation
There is a preliminary [doc website](https://ottatop.github.io/pinnacle/main) generated with LDoc. Do note that there are some missing things like the `Keys` table and `Layout` enum as well as any function overloads, but these should be autocompleted through the language server.
Documentation for other branches can be reached at `https://ottatop.github.io/pinnacle/<branch name>`.
## News
- We now have XWayland support as of [#34](https://github.com/Ottatop/pinnacle/pull/34)! It's currently not that polished right now because I got bored of working on it and I want to work on other aspects of Pinnacle, but it should be at least *usable*.
## Features
- [x] Winit backend
@ -25,7 +23,8 @@ Documentation for other branches can be reached at `https://ottatop.github.io/pi
- [x] Left master stack, corner, dwindle, spiral layouts
- [ ] Other three master stack directions, floating, magnifier, maximized, and fullscreen layouts
- [ ] Resizable layouts
- [ ] XWayland support [(#34)](https://github.com/Ottatop/pinnacle/pull/34)
- [x] XWayland support
- This is currently somewhat buggy. If you find a problem that's not already listed in GitHub issues, feel free to submit it!
- [ ] Layer-shell support
- [ ] Server-side decorations
- [ ] Animations and blur and all that pizazz
@ -97,6 +96,11 @@ The following will use the example config file in [`api/lua`](api/lua):
PINNACLE_CONFIG="./api/lua/example_config.lua" cargo run -- --<backend>
```
### API Documentation
There is a preliminary [doc website](https://ottatop.github.io/pinnacle/main) generated with LDoc. Do note that there are some missing things like the `Keys` table and `Layout` enum as well as any function overloads, but these should be autocompleted through the language server.
Documentation for other branches can be reached at `https://ottatop.github.io/pinnacle/<branch name>`.
### Autocomplete and that cool stuff
It is *highly* recommended to use the [Lua language server](https://github.com/LuaLS/lua-language-server) and set it up to have the [`api/lua`](api/lua) directory as a library, as I'll be using its doc comments to provide autocomplete and error checking.

View file

@ -44,14 +44,12 @@ impl<B: Backend> XwmHandler for CalloopData<B> {
tracing::trace!("map_window_request");
let win_type = window.window_type();
tracing::debug!("window type is {win_type:?}");
// tracing::debug!("new x11 window from map_window_request");
// tracing::debug!("window popup is {}", window.is_popup());
// INFO: This check is here because it happened while launching Ori and the Will of the Wisps
if window.is_override_redirect() {
tracing::warn!("Dealt with override redirect window in map_window_request");
let loc = window.geometry().loc;
let window = WindowElement::X11(window);
// tracing::debug!("mapped_override_redirect_window to loc {loc:?}");
self.state.space.map_element(window, loc, true);
return;
}
@ -198,6 +196,7 @@ impl<B: Backend> XwmHandler for CalloopData<B> {
// Schedule the popup to raise when all windows have committed after having
// their blockers cleared
// FIXME: I've seen one instance where this didn't work, figure that out
crate::state::schedule_on_commit(data, windows_on_output, move |dt| {
let WindowElement::X11(surface) = &clone else { unreachable!() };
if should_float(surface) {
@ -401,7 +400,7 @@ impl<B: Backend> XwmHandler for CalloopData<B> {
fn send_selection(
&mut self,
xwm: XwmId,
_xwm: XwmId,
selection: SelectionType,
mime_type: String,
fd: std::os::fd::OwnedFd,
@ -429,7 +428,7 @@ impl<B: Backend> XwmHandler for CalloopData<B> {
}
}
fn new_selection(&mut self, xwm: XwmId, selection: SelectionType, mime_types: Vec<String>) {
fn new_selection(&mut self, _xwm: XwmId, selection: SelectionType, mime_types: Vec<String>) {
match selection {
SelectionType::Clipboard => {
set_data_device_selection(
@ -445,7 +444,7 @@ impl<B: Backend> XwmHandler for CalloopData<B> {
}
}
fn cleared_selection(&mut self, xwm: XwmId, selection: SelectionType) {
fn cleared_selection(&mut self, _xwm: XwmId, selection: SelectionType) {
match selection {
SelectionType::Clipboard => {
if current_data_device_selection_userdata(&self.state.seat).is_some() {

View file

@ -627,6 +627,14 @@ impl<B: Backend> State<B> {
}
pub fn re_layout(&mut self, output: &Output) {
for win in self.windows.iter() {
if win.is_wayland() {
win.with_state(|state| {
tracing::debug!("{:?}", state.resize_state);
})
}
}
let windows = self
.windows
.iter()
@ -685,8 +693,9 @@ impl<B: Backend> State<B> {
Float::Floating(loc) => Some((win, loc)),
}
}) {
// TODO: store location in state
tracing::debug!("------MAPPING FLOATING TO {loc:?}");
if let WindowElement::X11(surface) = &win {
surface.set_mapped(true).expect("failed to map x11 win");
}
dt.state.space.map_element(win, loc, false);
}
});