From a5bac3dd85fde102ba782e32913c1040b402ee96 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Mon, 2 Sep 2024 11:30:40 +0400 Subject: [PATCH 1/4] Bump the flake lock this is to fix the issue with a non buildable riscv target. Signed-off-by: Brian McGillion --- flake.lock | 141 ++++++++++++++++++++++------------------------------- flake.nix | 6 +-- 2 files changed, 62 insertions(+), 85 deletions(-) diff --git a/flake.lock b/flake.lock index 5dbcd3305..61ce978d2 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,11 @@ ] }, "locked": { - "lastModified": 1723080788, - "narHash": "sha256-C5LbM5VMdcolt9zHeLQ0bYMRjUL+N+AL5pK7/tVTdes=", + "lastModified": 1727359191, + "narHash": "sha256-5PltTychnExFwzpEnY3WhOywaMV/M6NxYI/y3oXuUtw=", "owner": "nix-community", "repo": "disko", - "rev": "ffc1f95f6c28e1c6d1e587b51a2147027a3e45ed", + "rev": "67dc29be3036cc888f0b9d4f0a788ee0f6768700", "type": "github" }, "original": { @@ -82,28 +82,6 @@ "type": "github" } }, - "fenix": { - "inputs": { - "nixpkgs": [ - "microvm", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1722580276, - "narHash": "sha256-VaNcSh7n8OaFW/DJsR6Fm23V+EGpSei0DyF71RKB+90=", - "owner": "nix-community", - "repo": "fenix", - "rev": "286f371b3cfeaa5c856c8e6dfb893018e86cc947", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -127,11 +105,11 @@ ] }, "locked": { - "lastModified": 1722555600, - "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "lastModified": 1726153070, + "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", "type": "github" }, "original": { @@ -142,11 +120,11 @@ }, "flake-root": { "locked": { - "lastModified": 1713493429, - "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", + "lastModified": 1723604017, + "narHash": "sha256-rBtQ8gg+Dn4Sx/s+pvjdq3CB2wQNzx9XGFq/JVGCB6k=", "owner": "srid", "repo": "flake-root", - "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", + "rev": "b759a56851e10cb13f6b8e5698af7b59c44be26e", "type": "github" }, "original": { @@ -177,11 +155,11 @@ ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -210,11 +188,11 @@ ] }, "locked": { - "lastModified": 1724328564, - "narHash": "sha256-dx3lpB8YRPtbFSKNAx2ngYXrfPciYxLNBzhnssdWoxg=", + "lastModified": 1727356580, + "narHash": "sha256-uHqg8YpJWZEyANmdmE5wkTdiVzZ4qhFvVF00QdsISJo=", "owner": "tiiuae", "repo": "ghafpkgs", - "rev": "e41e2306eed51f0bdb915b2120006466456a87db", + "rev": "83a954a50d04d376f143660b1434c0019e8a31b5", "type": "github" }, "original": { @@ -277,16 +255,17 @@ "original": { "owner": "tiiuae", "repo": "ghaf-givc", + "rev": "ff9f60e3059f940fad610c27393b4d101bf6693d", "type": "github" } }, "impermanence": { "locked": { - "lastModified": 1717932370, - "narHash": "sha256-7C5lCpiWiyPoIACOcu2mukn/1JRtz6HC/1aEMhUdcw0=", + "lastModified": 1727198257, + "narHash": "sha256-/qMVI+SG9zvhLbQFOnqb4y4BH6DdK3DQHZU5qGptehc=", "owner": "nix-community", "repo": "impermanence", - "rev": "27979f1c3a0d3b9617a3563e2839114ba7d48d3f", + "rev": "8514fff0f048557723021ffeb31ca55f69b67de3", "type": "github" }, "original": { @@ -353,7 +332,6 @@ }, "microvm": { "inputs": { - "fenix": "fenix", "flake-utils": [ "flake-utils" ], @@ -363,11 +341,11 @@ "spectrum": "spectrum" }, "locked": { - "lastModified": 1723407630, - "narHash": "sha256-iBvdy5KAYWew4sAIVbrqrNL7jCMWFoB5hObocCXkHiY=", + "lastModified": 1726161490, + "narHash": "sha256-tzGcRRhhK5lAuBtlHl3D/TR2V3egPLV4BBcN2+4CyY0=", "owner": "astro", "repo": "microvm.nix", - "rev": "802ef1704f6a050f272bed5e226d0e86fa3e8c39", + "rev": "af604aa08ac9a4ae585beaf1a3482897a27ab67e", "type": "github" }, "original": { @@ -404,11 +382,11 @@ }, "nixlib": { "locked": { - "lastModified": 1722732880, - "narHash": "sha256-do2Mfm3T6SR7a5A804RhjQ+JTsF5hk4JTPGjCTRM/m8=", + "lastModified": 1726966855, + "narHash": "sha256-25ByioeOBFcnitO5lM/Mufnv/u7YtHEHEM8QFuiS40k=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "8bebd4c74f368aacb047f0141db09ec6b339733c", + "rev": "575704ff85d3a41dc5bfef7b55380cbc7b87f3c2", "type": "github" }, "original": { @@ -425,11 +403,11 @@ ] }, "locked": { - "lastModified": 1723078345, - "narHash": "sha256-HSxOQEKNZXiJe9aWnckTTCThOhcRCabwHa32IduDKLk=", + "lastModified": 1727312535, + "narHash": "sha256-exnTgS6OBYvEa8v5x8UsLQK2ERdDFwXNFQHoT2cqycY=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "d6c5d29f58acc10ea82afff1de2b28f038f572bd", + "rev": "f31447cd3f8e54674bd1675969e97e6043a309bc", "type": "github" }, "original": { @@ -440,11 +418,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1723149858, - "narHash": "sha256-3u51s7jdhavmEL1ggtd8wqrTH2clTy5yaZmhLvAXTqc=", + "lastModified": 1727040444, + "narHash": "sha256-19FNN5QT9Z11ZUMfftRplyNN+2PgcHKb3oq8KMW/hDA=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "107bb46eef1f05e86fc485ee8af9b637e5157988", + "rev": "d0cb432a9d28218df11cbd77d984a2a46caeb5ac", "type": "github" }, "original": { @@ -455,16 +433,32 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722593986, - "narHash": "sha256-JeH0R7hlzEWCFkQLnUxFm8hfcQMsXzdl4jCIejU6vzs=", - "owner": "tiiuae", + "lastModified": 1718208800, + "narHash": "sha256-US1tAChvPxT52RV8GksWZS415tTS7PV42KTc2PNDBmc=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "c488d21b64527c6f4fb4a6ce686112b238791ec6", + "rev": "cc54fb41d13736e92229c21627ea4f22199fee6b", "type": "github" }, "original": { - "owner": "tiiuae", - "ref": "nixos-unstable-texinfo", + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1727122398, + "narHash": "sha256-o8VBeCWHBxGd4kVMceIayf5GApqTavJbTa44Xcg5Rrk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "30439d93eb8b19861ccbe3e581abf97bdc91b093", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -483,11 +477,11 @@ ] }, "locked": { - "lastModified": 1723056346, - "narHash": "sha256-YpzywjTAUHRRHcO8zz9x2gYqJ0JmZlcB9+RaUvD89qM=", + "lastModified": 1726745158, + "narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "3c977f1c9930f54066c085305b4b2291385e7a73", + "rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", "type": "github" }, "original": { @@ -519,23 +513,6 @@ "treefmt-nix": "treefmt-nix" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1722521768, - "narHash": "sha256-FvJ4FaMy1kJbZ3Iw1RyvuiUAsbHJXoU2HwylzaFzj1o=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "f149dc5029d8406fae8b2c541603bcac06e30deb", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "rust-overlay": { "inputs": { "flake-utils": [ @@ -599,11 +576,11 @@ ] }, "locked": { - "lastModified": 1722330636, - "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", + "lastModified": 1727252110, + "narHash": "sha256-3O7RWiXpvqBcCl84Mvqa8dXudZ1Bol1ubNdSmQt7nF4=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", + "rev": "1bff2ba6ec22bc90e9ad3f7e94cca0d37870afa3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index fca1afd18..bf05155ce 100644 --- a/flake.nix +++ b/flake.nix @@ -29,8 +29,8 @@ inputs = { #TODO: clean this up before merging to main - nixpkgs.url = "github:tiiuae/nixpkgs/nixos-unstable-texinfo"; # "flake:mylocalnixpkgs"; # - #nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + #nixpkgs.url = "github:tiiuae/nixpkgs/nixos-unstable-texinfo"; # "flake:mylocalnixpkgs"; # + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; ghafpkgs = { url = "github:tiiuae/ghafpkgs"; @@ -145,7 +145,7 @@ }; givc = { - url = "github:tiiuae/ghaf-givc"; + url = "github:tiiuae/ghaf-givc/ff9f60e3059f940fad610c27393b4d101bf6693d"; inputs = { nixpkgs.follows = "nixpkgs"; flake-parts.follows = "flake-parts"; From b71a43e4de3b93d0a084740d6932cee8dbcb69ae Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Mon, 2 Sep 2024 18:57:24 +0400 Subject: [PATCH 2/4] Use the version of nixpkgs defined by anduril there is another breaking change upstream for patching the edk2 and that requires that we are pinned to the same version for now as the overlay would be quite heavyily patched. Signed-off-by: Brian McGillion --- flake.lock | 6 ++---- flake.nix | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 61ce978d2..1979c1173 100644 --- a/flake.lock +++ b/flake.lock @@ -276,9 +276,7 @@ }, "jetpack-nixos": { "inputs": { - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1718600161, @@ -507,7 +505,7 @@ "nix-fast-build": "nix-fast-build", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "systems": "systems", "treefmt-nix": "treefmt-nix" diff --git a/flake.nix b/flake.nix index bf05155ce..23e29256b 100644 --- a/flake.nix +++ b/flake.nix @@ -117,8 +117,9 @@ nixos-hardware.url = "github:NixOS/nixos-hardware"; jetpack-nixos = { + #url = "github:anduril/jetpack-nixos"; url = "github:anduril/jetpack-nixos/793716c1ca29a1be6d9bea84296a933c4acdddc1"; - inputs.nixpkgs.follows = "nixpkgs"; + # inputs.nixpkgs.follows = "nixpkgs"; }; disko = { From 5530c1dcf855e1f7bcff1b6b632e36935de59903 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Mon, 2 Sep 2024 13:01:21 +0400 Subject: [PATCH 3/4] jitsi meet has some depricated crypto this is a tmp patch to allow the deprecated version of jitsi to still build while waiting for an upstream fix. Signed-off-by: Brian McGillion --- modules/hardware/x86_64-generic/x86_64-linux.nix | 7 ++++++- nix/nixpkgs.nix | 3 +++ targets/nvidia-jetson-orin/flake-module.nix | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/hardware/x86_64-generic/x86_64-linux.nix b/modules/hardware/x86_64-generic/x86_64-linux.nix index 8b80b3739..edfb8d9e6 100644 --- a/modules/hardware/x86_64-generic/x86_64-linux.nix +++ b/modules/hardware/x86_64-generic/x86_64-linux.nix @@ -14,7 +14,12 @@ in # Increase the support for different devices by allowing the use # of proprietary drivers from the respective vendors - nixpkgs.config.allowUnfree = true; + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "jitsi-meet-1.0.8043" + ]; + }; # Add this for x86_64 hosts to be able to more generically support hardware. # For example Intel NUC 11's graphics card needs this in order to be able to diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix index fecabf1a0..87e099472 100644 --- a/nix/nixpkgs.nix +++ b/nix/nixpkgs.nix @@ -10,6 +10,9 @@ inherit system inputs; config = { allowUnfree = true; + permittedInsecurePackages = [ + "jitsi-meet-1.0.8043" + ]; }; }; # make custom top-level lib available to all `perSystem` functions diff --git a/targets/nvidia-jetson-orin/flake-module.nix b/targets/nvidia-jetson-orin/flake-module.nix index a4a55d0ec..b98b244f8 100644 --- a/targets/nvidia-jetson-orin/flake-module.nix +++ b/targets/nvidia-jetson-orin/flake-module.nix @@ -101,6 +101,14 @@ let # To enable screen locking set to true graphics.labwc.autolock.enable = false; }; + + #TODO: move to a central place for all platforms + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "jitsi-meet-1.0.8043" + ]; + }; } (import ./optee.nix { }) From 219794f31b6cc0ff370f55869638216691ff7185 Mon Sep 17 00:00:00 2001 From: Humaid Alqasimi Date: Mon, 2 Sep 2024 13:40:55 +0400 Subject: [PATCH 4/4] labwc: rebase patches from 0.7.2 -> 0.8.0 Signed-off-by: Humaid Alqasimi --- .../labwc/labwc-colored-borders.patch | 537 ++++++++++++++++-- 1 file changed, 483 insertions(+), 54 deletions(-) diff --git a/overlays/custom-packages/labwc/labwc-colored-borders.patch b/overlays/custom-packages/labwc/labwc-colored-borders.patch index 833e4e719..b29fdedb6 100644 --- a/overlays/custom-packages/labwc/labwc-colored-borders.patch +++ b/overlays/custom-packages/labwc/labwc-colored-borders.patch @@ -1,4 +1,4 @@ -From a89bc92a032d6c4fc50d711de92b068a0ed0a636 Mon Sep 17 00:00:00 2001 +From f410340a9726885414c80974cdd8809998cced22 Mon Sep 17 00:00:00 2001 From: Humaid Alqasimi Date: Thu, 2 May 2024 10:02:56 +0400 Subject: [PATCH] Add colored borders @@ -15,17 +15,17 @@ labwc/labwc#1092. Co-authored-by: dmitry-erin Signed-off-by: Humaid Alqasimi --- - include/ssd-internal.h | 5 +++-- - include/theme.h | 10 ++++++++++ - include/window-rules.h | 17 +++++++++++++++++ - src/config/rcxml.c | 12 ++++++++++++ - src/ssd/ssd-border.c | 21 ++++++++++++++++----- - src/ssd/ssd-part.c | 2 +- - src/ssd/ssd-titlebar.c | 30 ++++++++++++++++++++++++++---- - src/ssd/ssd.c | 9 ++++++--- - src/theme.c | 34 ++++++++++++++++++++++++++++++++-- - src/window-rules.c | 25 +++++++++++++++++++++++++ - 10 files changed, 148 insertions(+), 17 deletions(-) + include/ssd-internal.h | 5 +- + include/theme.h | 10 ++ + include/window-rules.h | 17 +++ + src/config/rcxml.c | 12 ++ + src/ssd/ssd-border.c | 21 ++- + src/ssd/ssd-part.c | 2 +- + src/ssd/ssd-titlebar.c | 294 +++++++++++++++++++++++++++-------------- + src/ssd/ssd.c | 9 +- + src/theme.c | 34 ++++- + src/window-rules.c | 25 ++++ + 10 files changed, 318 insertions(+), 111 deletions(-) diff --git a/include/ssd-internal.h b/include/ssd-internal.h index fda196e..b0e0cac 100644 @@ -44,10 +44,10 @@ index fda196e..b0e0cac 100644 /* SSD internal helpers */ struct ssd_part *ssd_get_part( diff --git a/include/theme.h b/include/theme.h -index 50a69f6..7a0f976 100644 +index 3993184..d4ab7ed 100644 --- a/include/theme.h +++ b/include/theme.h -@@ -162,4 +162,14 @@ void theme_init(struct theme *theme, struct server *server, const char *theme_na +@@ -165,4 +165,14 @@ void theme_init(struct theme *theme, struct server *server, const char *theme_na */ void theme_finish(struct theme *theme); @@ -103,7 +103,7 @@ index b93bc36..066cc7f 100644 + #endif /* LABWC_WINDOW_RULES_H */ diff --git a/src/config/rcxml.c b/src/config/rcxml.c -index 84c117b..daab831 100644 +index da0bbde..4a77d34 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -35,6 +35,7 @@ @@ -147,7 +147,7 @@ index 84c117b..daab831 100644 } else if (!strcmp(nodename, "name.action")) { current_window_rule_action = action_create(content); diff --git a/src/ssd/ssd-border.c b/src/ssd/ssd-border.c -index 06ce55c..6e2fc06 100644 +index fb1ac28..338cc53 100644 --- a/src/ssd/ssd-border.c +++ b/src/ssd/ssd-border.c @@ -6,6 +6,7 @@ @@ -187,7 +187,7 @@ index 06ce55c..6e2fc06 100644 add_scene_rect(&subtree->parts, LAB_SSD_PART_LEFT, parent, theme->border_width, height, 0, 0, color); diff --git a/src/ssd/ssd-part.c b/src/ssd/ssd-part.c -index 3933cd1..8889c9e 100644 +index 5c90360..6cdb442 100644 --- a/src/ssd/ssd-part.c +++ b/src/ssd/ssd-part.c @@ -80,7 +80,7 @@ add_scene_buffer(struct wl_list *list, enum ssd_part_type type, @@ -200,34 +200,144 @@ index 3933cd1..8889c9e 100644 struct wlr_buffer *hover_buffer, int x, struct view *view) { diff --git a/src/ssd/ssd-titlebar.c b/src/ssd/ssd-titlebar.c -index 32d6131..d183e52 100644 +index 70d9ca6..e5a3ed0 100644 --- a/src/ssd/ssd-titlebar.c +++ b/src/ssd/ssd-titlebar.c -@@ -26,6 +26,15 @@ ssd_titlebar_create(struct ssd *ssd) +@@ -1,8 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-only + + #define _POSIX_C_SOURCE 200809L +-#include +-#include + #include "buffer.h" + #include "common/mem.h" + #include "common/scaled-font-buffer.h" +@@ -13,10 +11,11 @@ + #include "ssd-internal.h" + #include "theme.h" + #include "view.h" ++#include ++#include + +-#define FOR_EACH_STATE(ssd, tmp) FOR_EACH(tmp, \ +- &(ssd)->titlebar.active, \ +- &(ssd)->titlebar.inactive) ++#define FOR_EACH_STATE(ssd, tmp) \ ++ FOR_EACH(tmp, &(ssd)->titlebar.active, &(ssd)->titlebar.inactive) + + static void set_squared_corners(struct ssd *ssd, bool enable); + static void set_maximize_alt_icon(struct ssd *ssd, bool enable); +@@ -26,6 +25,16 @@ ssd_titlebar_create(struct ssd *ssd) { struct view *view = ssd->view; struct theme *theme = view->server->theme; + + /* Here the whole theme changing is more preferable */ -+ struct theme custom_theme = { 0 }; ++ struct theme custom_theme = {0}; + float customColor[4]; + if (window_rules_get_custom_border_color(view, customColor)) { -+ theme_customize_with_border_color(&custom_theme, view->server, customColor); ++ theme_customize_with_border_color( ++ &custom_theme, view->server, customColor); + theme = &custom_theme; + } + int width = view->current.width; float *color; -@@ -52,6 +61,7 @@ ssd_titlebar_create(struct ssd *ssd) +@@ -48,72 +57,108 @@ ssd_titlebar_create(struct ssd *ssd) + ssd->titlebar.tree = wlr_scene_tree_create(ssd->tree); + + struct ssd_sub_tree *subtree; +- FOR_EACH_STATE(ssd, subtree) { ++ FOR_EACH_STATE(ssd, subtree) ++ { subtree->tree = wlr_scene_tree_create(ssd->titlebar.tree); parent = subtree->tree; - wlr_scene_node_set_position(&parent->node, 0, -theme->title_height); +- wlr_scene_node_set_position(&parent->node, 0, -theme->title_height); ++ wlr_scene_node_set_position( ++ &parent->node, 0, -theme->title_height); + if (subtree == &ssd->titlebar.active) { color = theme->window_active_title_bg_color; - corner_top_left = &theme->corner_top_left_active_normal->base; -@@ -86,6 +96,7 @@ ssd_titlebar_create(struct ssd *ssd) +- corner_top_left = &theme->corner_top_left_active_normal->base; +- corner_top_right = &theme->corner_top_right_active_normal->base; +- menu_button_unpressed = &theme->button_menu_active_unpressed->base; +- iconify_button_unpressed = &theme->button_iconify_active_unpressed->base; +- close_button_unpressed = &theme->button_close_active_unpressed->base; +- maximize_button_unpressed = &theme->button_maximize_active_unpressed->base; +- restore_button_unpressed = &theme->button_restore_active_unpressed->base; +- +- menu_button_hover = &theme->button_menu_active_hover->base; +- iconify_button_hover = &theme->button_iconify_active_hover->base; +- close_button_hover = &theme->button_close_active_hover->base; +- maximize_button_hover = &theme->button_maximize_active_hover->base; +- restore_button_hover = &theme->button_restore_active_hover->base; ++ corner_top_left = ++ &theme->corner_top_left_active_normal->base; ++ corner_top_right = ++ &theme->corner_top_right_active_normal->base; ++ menu_button_unpressed = ++ &theme->button_menu_active_unpressed->base; ++ iconify_button_unpressed = ++ &theme->button_iconify_active_unpressed->base; ++ close_button_unpressed = ++ &theme->button_close_active_unpressed->base; ++ maximize_button_unpressed = ++ &theme->button_maximize_active_unpressed->base; ++ restore_button_unpressed = ++ &theme->button_restore_active_unpressed->base; ++ ++ menu_button_hover = ++ &theme->button_menu_active_hover->base; ++ iconify_button_hover = ++ &theme->button_iconify_active_hover->base; ++ close_button_hover = ++ &theme->button_close_active_hover->base; ++ maximize_button_hover = ++ &theme->button_maximize_active_hover->base; ++ restore_button_hover = ++ &theme->button_restore_active_hover->base; + } else { + color = theme->window_inactive_title_bg_color; +- corner_top_left = &theme->corner_top_left_inactive_normal->base; +- corner_top_right = &theme->corner_top_right_inactive_normal->base; +- menu_button_unpressed = &theme->button_menu_inactive_unpressed->base; +- iconify_button_unpressed = &theme->button_iconify_inactive_unpressed->base; ++ corner_top_left = ++ &theme->corner_top_left_inactive_normal->base; ++ corner_top_right = ++ &theme->corner_top_right_inactive_normal->base; ++ menu_button_unpressed = ++ &theme->button_menu_inactive_unpressed->base; ++ iconify_button_unpressed = ++ &theme->button_iconify_inactive_unpressed->base; + maximize_button_unpressed = +- &theme->button_maximize_inactive_unpressed->base; +- restore_button_unpressed = &theme->button_restore_inactive_unpressed->base; +- close_button_unpressed = &theme->button_close_inactive_unpressed->base; +- +- menu_button_hover = &theme->button_menu_inactive_hover->base; +- iconify_button_hover = &theme->button_iconify_inactive_hover->base; +- close_button_hover = &theme->button_close_inactive_hover->base; +- maximize_button_hover = &theme->button_maximize_inactive_hover->base; +- restore_button_hover = &theme->button_restore_inactive_hover->base; ++ &theme->button_maximize_inactive_unpressed ++ ->base; ++ restore_button_unpressed = ++ &theme->button_restore_inactive_unpressed->base; ++ close_button_unpressed = ++ &theme->button_close_inactive_unpressed->base; ++ ++ menu_button_hover = ++ &theme->button_menu_inactive_hover->base; ++ iconify_button_hover = ++ &theme->button_iconify_inactive_hover->base; ++ close_button_hover = ++ &theme->button_close_inactive_hover->base; ++ maximize_button_hover = ++ &theme->button_maximize_inactive_hover->base; ++ restore_button_hover = ++ &theme->button_restore_inactive_hover->base; wlr_scene_node_set_enabled(&parent->node, false); } @@ -235,60 +345,379 @@ index 32d6131..d183e52 100644 wl_list_init(&subtree->parts); /* Title */ -@@ -95,7 +106,7 @@ ssd_titlebar_create(struct ssd *ssd) + add_scene_rect(&subtree->parts, LAB_SSD_PART_TITLEBAR, parent, + width - theme->window_button_width * SSD_BUTTON_COUNT, +- theme->title_height, theme->window_button_width, 0, color); ++ theme->title_height, theme->window_button_width, 0, ++ color); /* Buttons */ add_scene_button_corner(&subtree->parts, - LAB_SSD_BUTTON_WINDOW_MENU, LAB_SSD_PART_CORNER_TOP_LEFT, parent, +- LAB_SSD_BUTTON_WINDOW_MENU, LAB_SSD_PART_CORNER_TOP_LEFT, parent, - corner_top_left, menu_button_unpressed, menu_button_hover, 0, view); -+ color, corner_top_left, menu_button_unpressed, menu_button_hover, 0, view); - add_scene_button(&subtree->parts, LAB_SSD_BUTTON_ICONIFY, parent, - color, iconify_button_unpressed, iconify_button_hover, - width - SSD_BUTTON_WIDTH * 3, view); -@@ -111,7 +122,7 @@ ssd_titlebar_create(struct ssd *ssd) +- add_scene_button(&subtree->parts, LAB_SSD_BUTTON_ICONIFY, parent, +- color, iconify_button_unpressed, iconify_button_hover, ++ LAB_SSD_BUTTON_WINDOW_MENU, ++ LAB_SSD_PART_CORNER_TOP_LEFT, parent, color, ++ corner_top_left, menu_button_unpressed, ++ menu_button_hover, 0, view); ++ add_scene_button(&subtree->parts, LAB_SSD_BUTTON_ICONIFY, ++ parent, color, iconify_button_unpressed, ++ iconify_button_hover, + width - theme->window_button_width * 3, view); - add_scene_button_corner(&subtree->parts, - LAB_SSD_BUTTON_CLOSE, LAB_SSD_PART_CORNER_TOP_RIGHT, parent, + /* Maximize button has an alternate state when maximized */ + struct ssd_part *btn_max_root = add_scene_button( +- &subtree->parts, LAB_SSD_BUTTON_MAXIMIZE, parent, +- color, maximize_button_unpressed, maximize_button_hover, ++ &subtree->parts, LAB_SSD_BUTTON_MAXIMIZE, parent, color, ++ maximize_button_unpressed, maximize_button_hover, + width - theme->window_button_width * 2, view); +- struct ssd_button *btn_max = node_ssd_button_from_node(btn_max_root->node); +- add_toggled_icon(btn_max, &subtree->parts, LAB_SSD_BUTTON_MAXIMIZE, +- restore_button_unpressed, restore_button_hover); +- +- add_scene_button_corner(&subtree->parts, +- LAB_SSD_BUTTON_CLOSE, LAB_SSD_PART_CORNER_TOP_RIGHT, parent, - corner_top_right, close_button_unpressed, close_button_hover, -+ color, corner_top_right, close_button_unpressed, close_button_hover, - width - SSD_BUTTON_WIDTH * 1, view); - } FOR_EACH_END ++ struct ssd_button *btn_max = ++ node_ssd_button_from_node(btn_max_root->node); ++ add_toggled_icon(btn_max, &subtree->parts, ++ LAB_SSD_BUTTON_MAXIMIZE, restore_button_unpressed, ++ restore_button_hover); ++ ++ add_scene_button_corner(&subtree->parts, LAB_SSD_BUTTON_CLOSE, ++ LAB_SSD_PART_CORNER_TOP_RIGHT, parent, color, ++ corner_top_right, close_button_unpressed, ++ close_button_hover, + width - theme->window_button_width * 1, view); +- } FOR_EACH_END ++ } ++ FOR_EACH_END -@@ -149,10 +160,13 @@ set_squared_corners(struct ssd *ssd, bool enable) + ssd_update_title(ssd); + +@@ -140,26 +185,40 @@ set_squared_corners(struct ssd *ssd, bool enable) + { + struct ssd_part *part; + struct ssd_sub_tree *subtree; +- enum ssd_part_type ssd_type[2] = { LAB_SSD_BUTTON_WINDOW_MENU, LAB_SSD_BUTTON_CLOSE }; ++ enum ssd_part_type ssd_type[2] = { ++ LAB_SSD_BUTTON_WINDOW_MENU, LAB_SSD_BUTTON_CLOSE}; - /* Toggle background between invisible and titlebar background color */ - struct wlr_scene_rect *rect = wlr_scene_rect_from_node(button->background); +- FOR_EACH_STATE(ssd, subtree) { ++ FOR_EACH_STATE(ssd, subtree) ++ { + for (size_t i = 0; i < ARRAY_SIZE(ssd_type); i++) { + part = ssd_get_part(&subtree->parts, ssd_type[i]); +- struct ssd_button *button = node_ssd_button_from_node(part->node); +- +- /* Toggle background between invisible and titlebar background color */ +- struct wlr_scene_rect *rect = wlr_scene_rect_from_node(button->background); - wlr_scene_rect_set_color(rect, !enable ? (float[4]) {0, 0, 0, 0} : ( +- subtree == &ssd->titlebar.active +- ? rc.theme->window_active_title_bg_color +- : rc.theme->window_inactive_title_bg_color)); ++ struct ssd_button *button = ++ node_ssd_button_from_node(part->node); ++ ++ /* Toggle background between invisible and titlebar ++ * background color */ ++ struct wlr_scene_rect *rect = ++ wlr_scene_rect_from_node(button->background); + /*Check for custom color as well*/ + float customColor[4]; -+ bool isCustomColorAvailable = window_rules_get_custom_border_color(ssd->view, customColor); -+ wlr_scene_rect_set_color(rect, isCustomColorAvailable ? customColor : (!enable ? (float[4]) {0, 0, 0, 0} : ( - subtree == &ssd->titlebar.active - ? rc.theme->window_active_title_bg_color -- : rc.theme->window_inactive_title_bg_color)); -+ : rc.theme->window_inactive_title_bg_color))); ++ bool isCustomColorAvailable = ++ window_rules_get_custom_border_color( ++ ssd->view, customColor); ++ wlr_scene_rect_set_color(rect, ++ isCustomColorAvailable ++ ? customColor ++ : (!enable ? (float[4]){0, 0, 0, 0} ++ : (subtree == &ssd->titlebar.active ++ ? rc.theme->window_active_title_bg_color ++ : rc.theme->window_inactive_title_bg_color))); /* Toggle rounded corner image itself */ - struct wlr_scene_node *rounded_corner = -@@ -348,6 +362,14 @@ ssd_update_title(struct ssd *ssd) +- struct wlr_scene_node *rounded_corner = +- wl_container_of(part->node->link.prev, rounded_corner, link); ++ struct wlr_scene_node *rounded_corner = wl_container_of( ++ part->node->link.prev, rounded_corner, link); + wlr_scene_node_set_enabled(rounded_corner, !enable); + } +- } FOR_EACH_END ++ } ++ FOR_EACH_END + } + + static void +@@ -169,7 +228,8 @@ set_maximize_alt_icon(struct ssd *ssd, bool enable) + struct ssd_button *button; + struct ssd_sub_tree *subtree; + +- FOR_EACH_STATE(ssd, subtree) { ++ FOR_EACH_STATE(ssd, subtree) ++ { + part = ssd_get_part(&subtree->parts, LAB_SSD_BUTTON_MAXIMIZE); + button = node_ssd_button_from_node(part->node); + +@@ -179,10 +239,12 @@ set_maximize_alt_icon(struct ssd *ssd, bool enable) + } + + if (button->toggled_hover) { +- wlr_scene_node_set_enabled(button->toggled_hover, enable); ++ wlr_scene_node_set_enabled( ++ button->toggled_hover, enable); + wlr_scene_node_set_enabled(button->hover, !enable); + } +- } FOR_EACH_END ++ } ++ FOR_EACH_END + } + + void +@@ -193,11 +255,11 @@ ssd_titlebar_update(struct ssd *ssd) + struct theme *theme = view->server->theme; + + bool maximized = view->maximized == VIEW_AXIS_BOTH; +- bool tiled_not_maximized = view_is_tiled_and_notify_tiled(ssd->view) +- && !maximized; ++ bool tiled_not_maximized = ++ view_is_tiled_and_notify_tiled(ssd->view) && !maximized; + + if (ssd->state.was_maximized != maximized +- || ssd->state.was_tiled_not_maximized != tiled_not_maximized) { ++ || ssd->state.was_tiled_not_maximized != tiled_not_maximized) { + set_squared_corners(ssd, maximized || tiled_not_maximized); + if (ssd->state.was_maximized != maximized) { + set_maximize_alt_icon(ssd, maximized); +@@ -212,38 +274,51 @@ ssd_titlebar_update(struct ssd *ssd) + + struct ssd_part *part; + struct ssd_sub_tree *subtree; +- FOR_EACH_STATE(ssd, subtree) { ++ FOR_EACH_STATE(ssd, subtree) ++ { + wl_list_for_each(part, &subtree->parts, link) { + switch (part->type) { + case LAB_SSD_PART_TITLEBAR: + wlr_scene_rect_set_size( + wlr_scene_rect_from_node(part->node), +- width - theme->window_button_width * SSD_BUTTON_COUNT, ++ width ++ - theme->window_button_width ++ * SSD_BUTTON_COUNT, + theme->title_height); + continue; + case LAB_SSD_BUTTON_ICONIFY: + if (is_direct_child(part->node, subtree)) { + wlr_scene_node_set_position(part->node, +- width - theme->window_button_width * 3, 0); ++ width ++ - theme->window_button_width ++ * 3, ++ 0); + } + continue; + case LAB_SSD_BUTTON_MAXIMIZE: + if (is_direct_child(part->node, subtree)) { + wlr_scene_node_set_position(part->node, +- width - theme->window_button_width * 2, 0); ++ width ++ - theme->window_button_width ++ * 2, ++ 0); + } + continue; + case LAB_SSD_PART_CORNER_TOP_RIGHT: + if (is_direct_child(part->node, subtree)) { + wlr_scene_node_set_position(part->node, +- width - theme->window_button_width * 1, 0); ++ width ++ - theme->window_button_width ++ * 1, ++ 0); + } + continue; + default: + continue; + } + } +- } FOR_EACH_END ++ } ++ FOR_EACH_END + ssd_update_title(ssd); + } + +@@ -255,11 +330,13 @@ ssd_titlebar_destroy(struct ssd *ssd) + } + + struct ssd_sub_tree *subtree; +- FOR_EACH_STATE(ssd, subtree) { ++ FOR_EACH_STATE(ssd, subtree) ++ { + ssd_destroy_parts(&subtree->parts); + wlr_scene_node_destroy(&subtree->tree->node); + subtree->tree = NULL; +- } FOR_EACH_END ++ } ++ FOR_EACH_END + + if (ssd->state.title.text) { + free(ssd->state.title.text); +@@ -288,17 +365,20 @@ ssd_update_title_positions(struct ssd *ssd) + struct view *view = ssd->view; + struct theme *theme = view->server->theme; + int width = view->current.width; +- int title_bg_width = width - theme->window_button_width * SSD_BUTTON_COUNT; ++ int title_bg_width = ++ width - theme->window_button_width * SSD_BUTTON_COUNT; + + int x, y; + int buffer_height, buffer_width; + struct ssd_part *part; + struct ssd_sub_tree *subtree; +- FOR_EACH_STATE(ssd, subtree) { ++ FOR_EACH_STATE(ssd, subtree) ++ { + part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLE); + if (!part || !part->node) { + /* view->surface never been mapped */ +- /* Or we somehow failed to allocate a scaled titlebar buffer */ ++ /* Or we somehow failed to allocate a scaled titlebar ++ * buffer */ + continue; + } + +@@ -314,24 +394,29 @@ ssd_update_title_positions(struct ssd *ssd) + wlr_scene_node_set_enabled(part->node, true); + + if (theme->window_label_text_justify == LAB_JUSTIFY_CENTER) { +- if (buffer_width + theme->window_button_width * 2 <= title_bg_width) { ++ if (buffer_width + theme->window_button_width * 2 ++ <= title_bg_width) { + /* Center based on the full width */ + x = (width - buffer_width) / 2; + } else { + /* +- * Center based on the width between the buttons. +- * Title jumps around once this is hit but its still +- * better than to hide behind the buttons on the right. ++ * Center based on the width between the ++ * buttons. Title jumps around once this is hit ++ * but its still better than to hide behind the ++ * buttons on the right. + */ + x += (title_bg_width - buffer_width) / 2; + } +- } else if (theme->window_label_text_justify == LAB_JUSTIFY_RIGHT) { ++ } else if (theme->window_label_text_justify ++ == LAB_JUSTIFY_RIGHT) { + x += title_bg_width - buffer_width; +- } else if (theme->window_label_text_justify == LAB_JUSTIFY_LEFT) { ++ } else if (theme->window_label_text_justify ++ == LAB_JUSTIFY_LEFT) { + /* TODO: maybe add some theme x padding here? */ + } + wlr_scene_node_set_position(part->node, x, y); +- } FOR_EACH_END ++ } ++ FOR_EACH_END + } + + void +@@ -348,6 +433,15 @@ ssd_update_title(struct ssd *ssd) } struct theme *theme = view->server->theme; + + /* Here the whole theme changing is more preferable */ -+ struct theme custom_theme = { 0 }; ++ struct theme custom_theme = {0}; + float customColor[4]; + if (window_rules_get_custom_border_color(view, customColor)) { -+ theme_customize_with_border_color(&custom_theme, view->server, customColor); ++ theme_customize_with_border_color( ++ &custom_theme, view->server, customColor); + theme = &custom_theme; + } struct ssd_state_title *state = &ssd->state.title; bool title_unchanged = state->text && !strcmp(title, state->text); +@@ -358,9 +452,10 @@ ssd_update_title(struct ssd *ssd) + struct ssd_sub_tree *subtree; + struct ssd_state_title_width *dstate; + int title_bg_width = view->current.width +- - theme->window_button_width * SSD_BUTTON_COUNT; ++ - theme->window_button_width * SSD_BUTTON_COUNT; + +- FOR_EACH_STATE(ssd, subtree) { ++ FOR_EACH_STATE(ssd, subtree) ++ { + if (subtree == &ssd->titlebar.active) { + dstate = &state->active; + text_color = theme->window_active_label_text_color; +@@ -378,35 +473,38 @@ ssd_update_title(struct ssd *ssd) + continue; + } + +- if (title_unchanged +- && !dstate->truncated && dstate->width < title_bg_width) { ++ if (title_unchanged && !dstate->truncated ++ && dstate->width < title_bg_width) { + /* title the same + we don't need to resize title */ + continue; + } + + part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLE); + if (!part) { +- /* Initialize part and wlr_scene_buffer without attaching a buffer */ +- part = add_scene_part(&subtree->parts, LAB_SSD_PART_TITLE); ++ /* Initialize part and wlr_scene_buffer without ++ * attaching a buffer */ ++ part = add_scene_part( ++ &subtree->parts, LAB_SSD_PART_TITLE); + part->buffer = scaled_font_buffer_create(subtree->tree); + if (part->buffer) { + part->node = &part->buffer->scene_buffer->node; + } else { +- wlr_log(WLR_ERROR, "Failed to create title node"); ++ wlr_log(WLR_ERROR, ++ "Failed to create title node"); + } + } + + if (part->buffer) { + scaled_font_buffer_update(part->buffer, title, +- title_bg_width, font, +- text_color, bg_color, NULL); ++ title_bg_width, font, text_color, bg_color, ++ NULL); + } + + /* And finally update the cache */ + dstate->width = part->buffer ? part->buffer->width : 0; + dstate->truncated = title_bg_width <= dstate->width; +- +- } FOR_EACH_END ++ } ++ FOR_EACH_END + + if (!title_unchanged) { + if (state->text) { +@@ -426,8 +524,8 @@ ssd_button_set_hover(struct ssd_button *button, bool enabled) + } + + void +-ssd_update_button_hover(struct wlr_scene_node *node, +- struct ssd_hover_state *hover_state) ++ssd_update_button_hover( ++ struct wlr_scene_node *node, struct ssd_hover_state *hover_state) + { + struct ssd_button *button = NULL; + if (!node || !node->data) { diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c -index 70b1b0d..9dcc797 100644 +index a8c3e17..cb4079c 100644 --- a/src/ssd/ssd.c +++ b/src/ssd/ssd.c -@@ -411,9 +411,12 @@ ssd_enable_keybind_inhibit_indicator(struct ssd *ssd, bool enable) +@@ -412,9 +412,12 @@ ssd_enable_keybind_inhibit_indicator(struct ssd *ssd, bool enable) return; } @@ -305,7 +734,7 @@ index 70b1b0d..9dcc797 100644 struct ssd_part *part = ssd_get_part(&ssd->border.active.parts, LAB_SSD_PART_TOP); struct wlr_scene_rect *rect = wlr_scene_rect_from_node(part->node); diff --git a/src/theme.c b/src/theme.c -index 248a352..6f47bba 100644 +index d699773..be0e48e 100644 --- a/src/theme.c +++ b/src/theme.c @@ -401,7 +401,7 @@ hex_to_dec(char c) @@ -326,7 +755,7 @@ index 248a352..6f47bba 100644 theme->padding_height = 3; theme->title_height = INT_MIN; theme->menu_overlap_x = 0; -@@ -1433,3 +1433,33 @@ theme_finish(struct theme *theme) +@@ -1444,3 +1444,33 @@ theme_finish(struct theme *theme) zdrop(&theme->shadow_corner_bottom_inactive); zdrop(&theme->shadow_edge_inactive); }