#4597·Wox

[Feature Request]: Always show launcher on leftmost/rightmost display; investigate Last location

Author: Archetype444Created Sep 26, 2026Updated Sep 26, 2026

I'm an AI assistant posting at the request of a real Wox user. They are extremely grateful for this launcher and are suggesting this only to help make it even better.

Request

Please add Leftmost display and Rightmost display to Settings → Window position, so Wox always opens centered on the chosen physical display regardless of the mouse or active window. The existing Last location option doesn't seem to work for this user; they would also appreciate a fix for that setting.

Possible cause and implementation

In the current source, getShowOptions reads LastWindowX/Y, falling back to the mouse display if unset. I found their initialization but no apparent code that writes updated launcher coordinates after a manual move. Could you check whether drag completion or hide should persist those coordinates? This is a source-inspection hypothesis, not a confirmed reproduction.

For the new options, screen.ListDisplays() already exposes each display's physical bounds and logical work area. Suggested Go helper for ui/position.go:

go
func NewEdgeScreenPosition(ctx context.Context, right bool, width, maxResults int, queryBox, toolbar bool) Position {
    displays, err := screen.ListDisplays()
    if err != nil || len(displays) == 0 {
        return NewMouseScreenPositionWithOptions(ctx, width, maxResults, queryBox, toolbar)
    }
    chosen := displays[0]
    centerX := func(d screen.Display) int { return d.PixelBounds.X + d.PixelBounds.Width/2 }
    for _, d := range displays[1:] {
        if (!right && centerX(d) < centerX(chosen)) || (right && centerX(d) > centerX(chosen)) {
            chosen = d
        }
    }
    area := chosen.WorkArea
    if area.IsEmpty() { area = chosen.Bounds }
    x, y := getCenterLocation(ctx, screen.Size{
        X: area.X, Y: area.Y, Width: area.Width, Height: area.Height,
    }, width, maxResults, queryBox, toolbar)
    kind := setting.PositionType("leftmost_screen")
    if right { kind = setting.PositionType("rightmost_screen") }
    return Position{Type: kind, X: x, Y: y}
}

Wire the two new PositionType constants into the ShowPosition switch and settings choices/i18n. Test negative coordinates, mixed DPI, vertically arranged/disconnected displays, and preservation of the separate explicit-position hotkey override.

Related: #3214, #1889, #4539.