kando icon indicating copy to clipboard operation
kando copied to clipboard

Stage Manager on macOS causes the window to be wrongly sized/placed

Open lyra56k opened this issue 9 months ago • 4 comments

Short Summary

On macOS, when you have Stage Manager enabled, the OS likes making new windows avoid about an inch on each side of the screen. This causes both the editor and the menu windows to be offset an inch from the left, and clip off the right of the screen by the same amount. I think there needs to be a way to hardcode the windows to appear starting at the left edge.

Steps to Reproduce the Issue

  1. Turn on macOS's Stage Manager from the Control Center
  2. Trigger Kando to open any UI

Kando Version

v1.7.0

Installation Method

Via a portable zip archive downloaded from a release on GitHub

Desktop Environment

macOS

Environment Version

macOS Sequoia 15.3.1

Additional Information

No response

lyra56k avatar Mar 03 '25 17:03 lyra56k

Thanks for the report! However, I am afraid that the only mac book I have for testing is too old to reproduce this 😅

So I guess we have to find some volunteer to debug this. If anybody wants to look into that, the relevant code for the window placement is around here. Maybe the workarea returned by electron is not correct?

Schneegans avatar Mar 03 '25 20:03 Schneegans

I don't know how much of this has to do with Electron vs macOS.

Thinking of other Electron apps such as Discord, they do have the 1-inch inset on the left initially, but also match that on the right side. If you manually make the window full-width then hide it and show it again, it returns to the inset borders.

The one exception to this is if you maximize the window by dragging it to the Menu Bar (new window management feature in macOS Sequoia). If you hide and show the window after that it remains full-width. But as the windows for Kando don't have a title bar you can't drag them. I think the best way to do this would be to tell the window to maximize after drawing it, because somewhere during the process of showing a window seems to be where macOS decides to resize it.

lyra56k avatar Mar 03 '25 20:03 lyra56k

So I was able to test this (kind of) and it seems that the shift only happens for me on the first launch of Kando. If I don't quit the service and re-open the menu the window seems to be calculated properly with stage manager. See the photos attached.

Specs (bare metal):

  • Apple Silicon M1
  • MacOS Sequioa 15.3.2
  • Kando v1.7.0 (.dmg from release) and v1.8.0 (running from source)

First Launch:

Image

Subsequent launches:

Image

@lyra56k Are you seeing the same behavior or is it persistent on all uses of the Kando menu?

jonthemonke avatar Mar 27 '25 22:03 jonthemonke

@jonthemonke For me, the issue persists no matter how often I open or restart Kando. I haven't found a way to resolve it other than disabling Stage Manager.

chickenborn avatar Nov 06 '25 09:11 chickenborn