linuxmint / nemo-extensions

A set of extensions for Nemo
412 stars 150 forks source link

use CENTER_ALWAYS instead of CENTER for better true centering of the nemo-preview window #469

Closed infinitewarp closed 10 months ago

infinitewarp commented 1 year ago

The old CENTER option was putting my nemo-preview windows slightly south-east of center, almost like it was trying to position the north-west corner of the window in the center of the screen instead of the actual center of the window in the center of the screen. Using CENTER_ALWAYS puts the true center of the window in the true center of the screen.

mtwebster commented 1 year ago

CENTER_ALWAYS is super buggy, which is why we don't use it much - try resizing the window :)

I think we'd be better off figuring out which monitor our parent window is on and manually centering the window in the "realize" callback.

You can probably use Gdk.Display.get_default().get_monitor_at_window() then get the geometry of the monitor and adjust the window's position accordingly. That way if it gets resized by the user, it'll at least behave like a normal window.