Skip to content

Conversation

@barrulus
Copy link

@barrulus barrulus commented Jan 4, 2026

Summary

  • Add zoom-presets, min-zoom, max-zoom, zoom-step config options for overview
  • Add overview-zoom-cycle, overview-zoom-in, overview-zoom-out, overview-set-zoom actions
  • Zoom changes apply instantly (no animation)
  • Zoom resets to config default when overview closes

This allows users to dynamically adjust the overview zoom level to see more or fewer workspaces at once.

Design alignment

This implementation follows niri's design principles:

  • Actions apply immediately: Zoom changes take effect instantly with no animation, keeping the compositor responsive and predictable.
  • No performance impact when unused: If zoom-presets is not configured, overview-zoom-cycle is a no-op. The runtime zoom state is minimal (one f64 per monitor).
  • Mindful of invisible state: The zoom level resets to the config default when closing the overview, so reopening it always starts from a predictable state. Users won't be surprised by a forgotten zoom level from a previous overview session.

Example config

overview {
    zoom 0.5
    zoom-presets 0.5 0.25 0.1
    min-zoom 0.05
    max-zoom 0.75
    zoom-step 0.1
}

binds {
    Mod+Z { overview-zoom-cycle; }
    Ctrl+WheelScrollUp cooldown-ms=150 { overview-zoom-in; }
    Ctrl+WheelScrollDown cooldown-ms=150 { overview-zoom-out; }
}

Test plan

  • Enter overview → should use config zoom value
  • Press zoom cycle key → should cycle through presets instantly
  • Ctrl+Scroll → should adjust zoom within min/max bounds
  • Close overview → zoom should reset to config default
  • Re-enter overview → should start at config default again
  • No presets configured → overview-zoom-cycle should no-op

Closes: discussion #3047

This code has been created with LLM assistance

Add configurable zoom presets and bounds to the overview configuration:
- zoom_presets: optional list of zoom levels for cycling
- min_zoom: minimum zoom level (default: 0.05)
- max_zoom: maximum zoom level (default: 0.75)
- zoom_step: step size for zoom adjustments (default: 0.1)

Config syntax:
  overview {
      zoom-presets 0.5 0.25 0.1
      min-zoom 0.05
      max-zoom 0.75
      zoom-step 0.1
  }
Add new actions for controlling overview zoom level:
- OverviewZoomCycle: cycle through configured zoom presets
- OverviewZoomIn: increase zoom (optional step parameter)
- OverviewZoomOut: decrease zoom (optional step parameter)
- OverviewSetZoom: set specific zoom level
Add per-monitor runtime zoom state for dynamic overview zoom:
- overview_zoom: current zoom level (may differ from config)
- overview_zoom_preset_idx: index for cycling through presets

Add helper methods on Monitor:
- reset_overview_zoom(): reset to config default
- cycle_overview_zoom(): cycle through presets
- adjust_overview_zoom(): adjust by delta with bounds
- set_overview_zoom(): set specific level with bounds

Update compute_overview_zoom() to accept target zoom parameter.
Add handlers for the new overview zoom actions:
- OverviewZoomCycle: cycle through configured zoom presets
- OverviewZoomIn: increase zoom by step amount
- OverviewZoomOut: decrease zoom by step amount
- OverviewSetZoom: set specific zoom level

All actions are no-op when overview is not open.
Zoom changes apply to all monitors and trigger redraw.
Document the new overview zoom controls:
- zoom-presets, min-zoom, max-zoom, zoom-step config options
- overview-zoom-cycle, overview-zoom-in, overview-zoom-out,
  overview-set-zoom actions

This code has been created with LLM assistance
@barrulus barrulus force-pushed the feature/dynamic-overview-zoom branch from 8fd71b8 to 92d0452 Compare January 4, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant