mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-02 06:46:29 -04:00
Merge branch 'mangowm:main' into workspace10
This commit is contained in:
commit
3170b01c1d
6 changed files with 53 additions and 54 deletions
46
README.md
46
README.md
|
|
@ -1,6 +1,6 @@
|
||||||
# Mango Wayland Compositor
|
# Mango Wayland Compositor
|
||||||
<div>
|
<div>
|
||||||
<img src="https://github.com/DreamMaoMao/mangowc/blob/main/assets/mango-transparency-256.png" alt="MangoWC Logo" width="120"/>
|
<img src="https://github.com/mangowm/mango/blob/main/assets/mango-transparency-256.png" alt="MangoWM Logo" width="120"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
This project's development is based on [dwl](https://codeberg.org/dwl/dwl/).
|
This project's development is based on [dwl](https://codeberg.org/dwl/dwl/).
|
||||||
|
|
@ -36,7 +36,7 @@ https://github.com/user-attachments/assets/bb83004a-0563-4b48-ad89-6461a9b78b1f
|
||||||
**Mango won't cater to every user preference**: For niche feature requests, I'll take a wait-and-see approach. I'll only consider adding them if they get a significant number of upvotes.
|
**Mango won't cater to every user preference**: For niche feature requests, I'll take a wait-and-see approach. I'll only consider adding them if they get a significant number of upvotes.
|
||||||
|
|
||||||
# Our discord
|
# Our discord
|
||||||
[mangowc](https://discord.gg/CPjbDxesh5)
|
[mangowm](https://discord.gg/CPjbDxesh5)
|
||||||
|
|
||||||
# Supported layouts
|
# Supported layouts
|
||||||
- tile
|
- tile
|
||||||
|
|
@ -52,7 +52,7 @@ https://github.com/user-attachments/assets/bb83004a-0563-4b48-ad89-6461a9b78b1f
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
[](https://repology.org/project/mangowc/versions)
|
[](https://repology.org/project/mangowm/versions)
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
|
@ -71,9 +71,9 @@ https://github.com/user-attachments/assets/bb83004a-0563-4b48-ad89-6461a9b78b1f
|
||||||
- libxcb
|
- libxcb
|
||||||
|
|
||||||
## Arch Linux
|
## Arch Linux
|
||||||
The package is in the Arch User Repository and is available for manual download [here](https://aur.archlinux.org/packages/mangowc-git) or through a AUR helper like yay:
|
The package is in the Arch User Repository and is available for manual download [here](https://aur.archlinux.org/packages/mangowm-git) or through a AUR helper like yay:
|
||||||
```bash
|
```bash
|
||||||
yay -S mangowc-git
|
yay -S mangowm-git
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -87,12 +87,12 @@ eselect repository enable guru
|
||||||
emerge --sync guru
|
emerge --sync guru
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, add `gui-libs/scenefx` and `gui-wm/mangowc` to the `package.accept_keywords`.
|
Then, add `gui-libs/scenefx` and `gui-wm/mangowm` to the `package.accept_keywords`.
|
||||||
|
|
||||||
Finally, install the package:
|
Finally, install the package:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
emerge --ask --verbose gui-wm/mangowc
|
emerge --ask --verbose gui-wm/mangowm
|
||||||
```
|
```
|
||||||
|
|
||||||
## Fedora Linux
|
## Fedora Linux
|
||||||
|
|
@ -102,32 +102,32 @@ First, add the [Terra Repository](https://terra.fyralabs.com/).
|
||||||
Then, install the package:
|
Then, install the package:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dnf install mangowc
|
dnf install mangowm
|
||||||
```
|
```
|
||||||
|
|
||||||
## Guix System
|
## Guix System
|
||||||
The package definition is described in the source repository.
|
The package definition is described in the source repository.
|
||||||
First, add `mangowc` channel to `channels.scm` file:
|
First, add `mangowm` channel to `channels.scm` file:
|
||||||
|
|
||||||
```scheme
|
```scheme
|
||||||
;; In $HOME/.config/guix/channels.scm
|
;; In $HOME/.config/guix/channels.scm
|
||||||
(cons (channel
|
(cons (channel
|
||||||
(name 'mangowc)
|
(name 'mangowm)
|
||||||
(url "https://github.com/DreamMaoMao/mangowc.git")
|
(url "https://github.com/mangowm/mango.git")
|
||||||
(branch "main"))
|
(branch "main"))
|
||||||
... ;; Your other channels
|
... ;; Your other channels
|
||||||
%default-channels)
|
%default-channels)
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, run `guix pull` and after update you can either run
|
Then, run `guix pull` and after update you can either run
|
||||||
`guix install mangowc` or add it to your configuration via:
|
`guix install mangowm` or add it to your configuration via:
|
||||||
|
|
||||||
```scheme
|
```scheme
|
||||||
(use-modules (mangowc)) ;; Add mangowc module
|
(use-modules (mangowm)) ;; Add mangowm module
|
||||||
|
|
||||||
;; Add mangowc to packages list
|
;; Add mangowm to packages list
|
||||||
(packages (cons*
|
(packages (cons*
|
||||||
mangowc-git
|
mangowm-git
|
||||||
... ;; Other packages you specified
|
... ;; Other packages you specified
|
||||||
%base-packages))
|
%base-packages))
|
||||||
```
|
```
|
||||||
|
|
@ -147,8 +147,8 @@ cd scenefx
|
||||||
meson build -Dprefix=/usr
|
meson build -Dprefix=/usr
|
||||||
sudo ninja -C build install
|
sudo ninja -C build install
|
||||||
|
|
||||||
git clone https://github.com/DreamMaoMao/mangowc.git
|
git clone https://github.com/mangowm/mango.git
|
||||||
cd mangowc
|
cd mangowm
|
||||||
meson build -Dprefix=/usr
|
meson build -Dprefix=/usr
|
||||||
sudo ninja -C build install
|
sudo ninja -C build install
|
||||||
```
|
```
|
||||||
|
|
@ -206,9 +206,9 @@ git clone https://github.com/DreamMaoMao/mango-config.git ~/.config/mango
|
||||||
|
|
||||||
## Config Documentation
|
## Config Documentation
|
||||||
|
|
||||||
Refer to the repo wiki [wiki](https://github.com/DreamMaoMao/mango/wiki/)
|
Refer to the repo wiki [wiki](https://github.com/mangowm/mango/wiki/)
|
||||||
|
|
||||||
or the website docs [docs](https://mangowc.vercel.app/docs)
|
or the website docs [docs](https://mangowm.github.io/)
|
||||||
|
|
||||||
# NixOS + Home-manager
|
# NixOS + Home-manager
|
||||||
|
|
||||||
|
|
@ -228,7 +228,7 @@ Here's an example of using the modules in a flake:
|
||||||
};
|
};
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
mango = {
|
mango = {
|
||||||
url = "github:DreamMaoMao/mango";
|
url = "github:mangowm/mango";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -290,9 +290,9 @@ Here's an example of using the modules in a flake:
|
||||||
|
|
||||||
To package mango for other distributions, you can check the reference setup for:
|
To package mango for other distributions, you can check the reference setup for:
|
||||||
|
|
||||||
- [nix](https://github.com/DreamMaoMao/mangowc/blob/main/nix/default.nix)
|
- [nix](https://github.com/mangowm/mango/blob/main/nix/default.nix)
|
||||||
- [arch](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mangowc-git).
|
- [arch](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mangowm-git).
|
||||||
- [gentoo](https://data.gpo.zugaina.org/guru/gui-wm/mangowc)
|
- [gentoo](https://data.gpo.zugaina.org/guru/gui-wm/mangowm)
|
||||||
|
|
||||||
You might need to package `scenefx` for your distribution, check availability [here](https://github.com/wlrfx/scenefx.git).
|
You might need to package `scenefx` for your distribution, check availability [here](https://github.com/wlrfx/scenefx.git).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
(define-module (mangowc)
|
(define-module (mangowm)
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
#:use-module (guix git-download)
|
#:use-module (guix git-download)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
|
|
@ -18,11 +18,11 @@
|
||||||
#:use-module (guix licenses))
|
#:use-module (guix licenses))
|
||||||
|
|
||||||
|
|
||||||
(define-public mangowc-git
|
(define-public mangowm-git
|
||||||
(package
|
(package
|
||||||
(name "mangowc")
|
(name "mangowm")
|
||||||
(version "git")
|
(version "git")
|
||||||
(source (local-file "." "mangowc-checkout"
|
(source (local-file "." "mangowm-checkout"
|
||||||
#:recursive? #t
|
#:recursive? #t
|
||||||
#:select? (or (git-predicate (current-source-directory))
|
#:select? (or (git-predicate (current-source-directory))
|
||||||
(const #t))))
|
(const #t))))
|
||||||
|
|
@ -55,10 +55,10 @@
|
||||||
wlroots
|
wlroots
|
||||||
scenefx))
|
scenefx))
|
||||||
(native-inputs (list pkg-config wayland-protocols))
|
(native-inputs (list pkg-config wayland-protocols))
|
||||||
(home-page "https://github.com/DreamMaoMao/mangowc")
|
(home-page "https://github.com/DreamMaoMao/mangowm")
|
||||||
(synopsis "Wayland compositor based on wlroots and scenefx")
|
(synopsis "Wayland compositor based on wlroots and scenefx")
|
||||||
(description "A Wayland compositor based on wlroots and scenefx,
|
(description "A Wayland compositor based on wlroots and scenefx,
|
||||||
inspired by dwl but aiming to be more feature-rich.")
|
inspired by dwl but aiming to be more feature-rich.")
|
||||||
(license gpl3)))
|
(license gpl3)))
|
||||||
|
|
||||||
mangowc-git
|
mangowm-git
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
project('mango', ['c', 'cpp'],
|
project('mango', ['c', 'cpp'],
|
||||||
version : '0.12.4',
|
version : '0.12.5',
|
||||||
)
|
)
|
||||||
|
|
||||||
subdir('protocols')
|
subdir('protocols')
|
||||||
|
|
|
||||||
|
|
@ -500,7 +500,7 @@ static const struct wl_registry_listener registry_listener = {
|
||||||
|
|
||||||
static void usage(void) {
|
static void usage(void) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"mmsg - MangoWC IPC\n"
|
"mmsg - MangoWM IPC\n"
|
||||||
"\n"
|
"\n"
|
||||||
"SYNOPSIS:\n"
|
"SYNOPSIS:\n"
|
||||||
"\tmmsg [-OTLq]\n"
|
"\tmmsg [-OTLq]\n"
|
||||||
|
|
@ -517,7 +517,7 @@ static void usage(void) {
|
||||||
"\t-O Get all output (monitor) information\n"
|
"\t-O Get all output (monitor) information\n"
|
||||||
"\t-T Get number of tags\n"
|
"\t-T Get number of tags\n"
|
||||||
"\t-L Get all available layouts\n"
|
"\t-L Get all available layouts\n"
|
||||||
"\t-q Quit MangoWC\n"
|
"\t-q Quit mango\n"
|
||||||
"\t-o <output> Select output (monitor)\n"
|
"\t-o <output> Select output (monitor)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"GET OPTIONS (used with -g or -w):\n"
|
"GET OPTIONS (used with -g or -w):\n"
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,6 @@ in {
|
||||||
options = {
|
options = {
|
||||||
programs.mango = {
|
programs.mango = {
|
||||||
enable = lib.mkEnableOption "mango, a wayland compositor based on dwl";
|
enable = lib.mkEnableOption "mango, a wayland compositor based on dwl";
|
||||||
addLoginEntry = lib.mkEnableOption {
|
|
||||||
default = true;
|
|
||||||
description = "Whether to add a login entry to the display manager for mango";
|
|
||||||
};
|
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
default = self.packages.${pkgs.stdenv.hostPlatform.system}.mango;
|
default = self.packages.${pkgs.stdenv.hostPlatform.system}.mango;
|
||||||
|
|
@ -59,7 +55,7 @@ in {
|
||||||
programs.xwayland.enable = lib.mkDefault true;
|
programs.xwayland.enable = lib.mkDefault true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
displayManager.sessionPackages = lib.mkIf cfg.addLoginEntry [ cfg.package ];
|
displayManager.sessionPackages = [cfg.package];
|
||||||
|
|
||||||
graphical-desktop.enable = lib.mkDefault true;
|
graphical-desktop.enable = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
37
src/mango.c
37
src/mango.c
|
|
@ -1693,6 +1693,7 @@ void focuslayer(LayerSurface *l) {
|
||||||
void reset_exclusive_layer(Monitor *m) {
|
void reset_exclusive_layer(Monitor *m) {
|
||||||
LayerSurface *l = NULL;
|
LayerSurface *l = NULL;
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
bool neet_change_focus_to_client = false;
|
||||||
uint32_t layers_above_shell[] = {
|
uint32_t layers_above_shell[] = {
|
||||||
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
|
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
|
||||||
ZWLR_LAYER_SHELL_V1_LAYER_TOP,
|
ZWLR_LAYER_SHELL_V1_LAYER_TOP,
|
||||||
|
|
@ -1706,13 +1707,19 @@ void reset_exclusive_layer(Monitor *m) {
|
||||||
wl_list_for_each_reverse(l, &m->layers[layers_above_shell[i]], link) {
|
wl_list_for_each_reverse(l, &m->layers[layers_above_shell[i]], link) {
|
||||||
if (l == exclusive_focus &&
|
if (l == exclusive_focus &&
|
||||||
l->layer_surface->current.keyboard_interactive !=
|
l->layer_surface->current.keyboard_interactive !=
|
||||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE)
|
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE) {
|
||||||
|
|
||||||
exclusive_focus = NULL;
|
exclusive_focus = NULL;
|
||||||
|
|
||||||
|
neet_change_focus_to_client = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (l->layer_surface->current.keyboard_interactive ==
|
if (l->layer_surface->current.keyboard_interactive ==
|
||||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE &&
|
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE &&
|
||||||
l->layer_surface->surface ==
|
l->layer_surface->surface ==
|
||||||
seat->keyboard_state.focused_surface)
|
seat->keyboard_state.focused_surface) {
|
||||||
focusclient(focustop(selmon), 1);
|
neet_change_focus_to_client = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (locked ||
|
if (locked ||
|
||||||
l->layer_surface->current.keyboard_interactive !=
|
l->layer_surface->current.keyboard_interactive !=
|
||||||
|
|
@ -1725,6 +1732,10 @@ void reset_exclusive_layer(Monitor *m) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (neet_change_focus_to_client) {
|
||||||
|
focusclient(focustop(selmon), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void arrangelayers(Monitor *m) {
|
void arrangelayers(Monitor *m) {
|
||||||
|
|
@ -2384,13 +2395,6 @@ void maplayersurfacenotify(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
// 刷新布局,让窗口能感应到exclude_zone变化以及设置独占表面
|
// 刷新布局,让窗口能感应到exclude_zone变化以及设置独占表面
|
||||||
arrangelayers(l->mon);
|
arrangelayers(l->mon);
|
||||||
|
|
||||||
// 按需交互layer需要像正常窗口一样抢占非独占layer的焦点
|
|
||||||
if (!exclusive_focus &&
|
|
||||||
l->layer_surface->current.keyboard_interactive ==
|
|
||||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND) {
|
|
||||||
focuslayer(l);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void commitlayersurfacenotify(struct wl_listener *listener, void *data) {
|
void commitlayersurfacenotify(struct wl_listener *listener, void *data) {
|
||||||
|
|
@ -2411,6 +2415,12 @@ void commitlayersurfacenotify(struct wl_listener *listener, void *data) {
|
||||||
arrangelayers(l->mon);
|
arrangelayers(l->mon);
|
||||||
l->layer_surface->current = old_state;
|
l->layer_surface->current = old_state;
|
||||||
|
|
||||||
|
// 按需交互layer只在map之前设置焦点
|
||||||
|
if (!exclusive_focus &&
|
||||||
|
l->layer_surface->current.keyboard_interactive ==
|
||||||
|
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND) {
|
||||||
|
focuslayer(l);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2455,11 +2465,6 @@ void commitlayersurfacenotify(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
layer_flush_blur_background(l);
|
layer_flush_blur_background(l);
|
||||||
|
|
||||||
if (layer_surface == exclusive_focus &&
|
|
||||||
layer_surface->current.keyboard_interactive !=
|
|
||||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE)
|
|
||||||
exclusive_focus = NULL;
|
|
||||||
|
|
||||||
if (layer_surface->current.committed == 0 &&
|
if (layer_surface->current.committed == 0 &&
|
||||||
l->mapped == layer_surface->surface->mapped)
|
l->mapped == layer_surface->surface->mapped)
|
||||||
return;
|
return;
|
||||||
|
|
@ -3335,7 +3340,6 @@ void destroylocksurface(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
if (lock_surface->surface != seat->keyboard_state.focused_surface) {
|
if (lock_surface->surface != seat->keyboard_state.focused_surface) {
|
||||||
if (exclusive_focus && !locked) {
|
if (exclusive_focus && !locked) {
|
||||||
exclusive_focus = NULL;
|
|
||||||
reset_exclusive_layer(m);
|
reset_exclusive_layer(m);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -3345,7 +3349,6 @@ void destroylocksurface(struct wl_listener *listener, void *data) {
|
||||||
surface = wl_container_of(cur_lock->surfaces.next, surface, link);
|
surface = wl_container_of(cur_lock->surfaces.next, surface, link);
|
||||||
client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
|
client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
|
||||||
} else if (!locked) {
|
} else if (!locked) {
|
||||||
exclusive_focus = NULL;
|
|
||||||
reset_exclusive_layer(selmon);
|
reset_exclusive_layer(selmon);
|
||||||
focusclient(focustop(selmon), 1);
|
focusclient(focustop(selmon), 1);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue