Skip to content

Commit

Permalink
Disable inter-layer grouping by default.
Browse files Browse the repository at this point in the history
The grouping inside a single layer is still enabled.
  • Loading branch information
fredizzimo committed May 21, 2024
1 parent a5b5ae6 commit cd3e754
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub struct RendererSettings {
underline_stroke_scale: f32,
text_gamma: f32,
text_contrast: f32,
experimental_layer_grouping: bool,
}

impl Default for RendererSettings {
Expand All @@ -119,6 +120,7 @@ impl Default for RendererSettings {
underline_stroke_scale: 1.,
text_gamma: 0.0,
text_contrast: 0.5,
experimental_layer_grouping: false,
}
}
}
Expand Down Expand Up @@ -207,7 +209,10 @@ impl Renderer {
let default_background = self.grid_renderer.get_default_background();
let grid_scale = self.grid_renderer.grid_scale;

let transparency = { SETTINGS.get::<WindowSettings>().transparency };
let transparency = SETTINGS.get::<WindowSettings>().transparency;
let layer_grouping = SETTINGS
.get::<RendererSettings>()
.experimental_layer_grouping;
root_canvas.clear(default_background.with_a((255.0 * transparency) as u8));
root_canvas.save();
root_canvas.reset_matrix();
Expand Down Expand Up @@ -240,8 +245,15 @@ impl Renderer {
for window in floating_windows {
let zindex = window.anchor_info.as_ref().unwrap().sort_order;
log::debug!("zindex: {}, base: {}", zindex, base_zindex);
// Group floating windows by consecutive z indices
if zindex - last_zindex > 1 && !current_windows.is_empty() {
if layer_grouping {
// Group floating windows by consecutive z indices
if zindex - last_zindex > 1 && !current_windows.is_empty() {
for windows in group_windows(current_windows, grid_scale) {
floating_layers.push(FloatingLayer { windows });
}
current_windows = vec![];
}
} else {
for windows in group_windows(current_windows, grid_scale) {
floating_layers.push(FloatingLayer { windows });
}
Expand Down
20 changes: 20 additions & 0 deletions website/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,26 @@ Set the [`background`](https://neovim.io/doc/user/options.html#'background') opt
starts. Possible values: _light_, _dark_, _auto_. On systems that support it, _auto_ will mirror the
system theme, and will update `background` when the system theme changes.

#### Layer grouping

VimScript:

```vim
let g:experimental_layer_grouping = v:false
```

Lua:

```lua
vim.g.experimental_layer_grouping = false
```

**Available since 0.13.1.**

Group non-emtpy consecutive layers (zindex) together, so that the shadows and blurring is done for
the whole group instead of each individual layer. This can get rid of some shadowing and blending
artifacts, but cause worse problems like [#2574](https://github.com/neovide/neovide/issues/2574).

### Functionality

#### Refresh Rate
Expand Down

0 comments on commit cd3e754

Please sign in to comment.