Merge branch 'main' into api_enhancements

This commit is contained in:
Ottatop 2024-04-18 16:49:23 -05:00 committed by GitHub
commit e0af7743a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 75 additions and 53 deletions

View file

@ -66,6 +66,9 @@ You will need:
- NixOS: There is flake [`flake.nix`](flake.nix) with a devShell. It also - NixOS: There is flake [`flake.nix`](flake.nix) with a devShell. It also
includes the other tools needed for the build and sets up the includes the other tools needed for the build and sets up the
`LD_LIBRARY_PATH` so the dynamically loaded libraries are found. `LD_LIBRARY_PATH` so the dynamically loaded libraries are found.
> [!NOTE]
> Luarocks currently doesn't install the Lua library and its dependencies due to openssh directory
> shenanigans. Fix soon, hopefully. In the meantime you can use the Rust API.
- [protoc](https://grpc.io/docs/protoc-installation/), the Protocol Buffer Compiler, for configuration - [protoc](https://grpc.io/docs/protoc-installation/), the Protocol Buffer Compiler, for configuration
- Arch: - Arch:
```sh ```sh

18
flake.lock generated
View file

@ -8,11 +8,11 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1712816664, "lastModified": 1712903033,
"narHash": "sha256-kPIVs2ATag+gm1CiWCJ+qcVQVR89w2eh/Cg4g1Xph70=", "narHash": "sha256-KcvsEm0h1mIwBHFAzWFBjGihnbf2fxpAaXOdVbUfAI4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "94f8df6a8e52447af72a1a0008eccf4a099b6d25", "rev": "c739f83545e625227f4d0af7fe2a71e69931fa4c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -41,11 +41,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1712741485, "lastModified": 1712867921,
"narHash": "sha256-bCs0+MSTra80oXAsnM6Oq62WsirOIaijQ/BbUY59tR4=", "narHash": "sha256-edTFV4KldkCMdViC/rmpJa7oLIU8SE/S35lh/ukC7bg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b2cf36f43f9ef2ded5711b30b1f393ac423d8f72", "rev": "51651a540816273b67bc4dedea2d37d116c5f7fe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -65,11 +65,11 @@
"rust-analyzer-src": { "rust-analyzer-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1712663608, "lastModified": 1712818880,
"narHash": "sha256-tN9ZL6kGppmHg84lxlpAlaN+kXWNctKK7Yitq/iXDEw=", "narHash": "sha256-VDxsvgj/bNypHq48tQWtc3VRbWvzlFjzKf9ZZIVO10Y=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "a5feb4f05f09adca661c869b1bf2324898cbaa43", "rev": "657b33b0cb9bd49085202e91ad5b4676532c9140",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,5 +1,6 @@
{ {
description = " A WIP Smithay-based Wayland compositor, inspired by AwesomeWM and configured in Lua or Rust"; description =
"A WIP Smithay-based Wayland compositor, inspired by AwesomeWM and configured in Lua or Rust";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
@ -12,48 +13,53 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = outputs = { nixpkgs, flake-utils, fenix, ... }:
{ flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
nixpkgs,
flake-utils,
fenix,
...
}:
flake-utils.lib.eachSystem
[
"x86_64-linux"
"aarch64-linux"
]
(
system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
fenixPkgs = fenix.packages.${system}; fenixPkgs = fenix.packages.${system};
toolchain = fenixPkgs.stable; toolchain = fenixPkgs.stable;
combinedToolchain = toolchain.completeToolchain; combinedToolchain = toolchain.completeToolchain;
in in {
{ formatter = pkgs.nixfmt;
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
buildInputs = [ nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = with pkgs; [
# rust devel tools # rust devel tools
combinedToolchain combinedToolchain
pkgs.rust-analyzer rust-analyzer
pkgs.cargo-outdated cargo-outdated
wayland
# build time stuff # build time stuff
pkgs.pkg-config protobuf
pkgs.protobuf lua54Packages.luarocks
pkgs.luarocks
# libs # libs
pkgs.seatd.dev seatd.dev
pkgs.systemdLibs.dev systemdLibs.dev
pkgs.libxkbcommon libxkbcommon
pkgs.libinput libinput
pkgs.mesa mesa
xwayland
# winit on x11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libX11
]; ];
LD_LIBRARY_PATH = "${pkgs.wayland}/lib:${pkgs.libGL}/lib";
runtimeDependencies = with pkgs; [
wayland
mesa
libglvnd # libEGL
];
LD_LIBRARY_PATH =
"${pkgs.wayland}/lib:${pkgs.libGL}/lib:${pkgs.libxkbcommon}/lib";
}; };
} });
);
} }

View file

@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
use std::collections::{HashMap, HashSet}; use std::{
collections::{HashMap, HashSet},
time::Duration,
};
use pinnacle_api_defs::pinnacle::layout::v0alpha1::{layout_request::Geometries, LayoutResponse}; use pinnacle_api_defs::pinnacle::layout::v0alpha1::{layout_request::Geometries, LayoutResponse};
use smithay::{ use smithay::{
@ -133,6 +136,16 @@ impl State {
self.space.map_element(window, loc, false); self.space.map_element(window, loc, false);
} }
// HACK and FIXME:
// We are sending frames here to get offscreen windows to commit and map.
// Obviously this is a bad way to do this but its a bandaid solution
// until decent transactional layout applications are implemented.
for (win, _serial) in pending_wins {
win.send_frame(output, self.clock.now(), Some(Duration::ZERO), |_, _| {
Some(output.clone())
});
}
self.fixup_z_layering(); self.fixup_z_layering();
} }