caprine icon indicating copy to clipboard operation
caprine copied to clipboard

[FEATURE REQUEST] Windows version - remember window location/snap

Open swebervna opened this issue 2 years ago • 3 comments

Loving Caprine! I use it on Linux and it's amazing, although I noticed that if I snap Caprine to the right of my screen (on Windows), and close the app, restart it, it appears back in the center of the screen unsnapped and resized. Could you please consider making Caprine on Windows remember it's location/size/snap? I prefer Caprine snapped on the right-side of my monitor in a long rectangle-like shape: image

Thanks!

swebervna avatar Nov 12 '21 18:11 swebervna

Caprine should remember the window size when you resize the window. When starting Caprine up again, it should try to open the window in the same location and to the same size. It can also remember if the window was maximized, however it is not possible to see if the window had been "snapped" to one side of the screen. (The underlying Electron API does not have this support.) There are sometimes issues when users have more than one display and try to reopen it with a different screen configuration.

You can view the saved data in %APPDATA%\Caprine\config.json, the relevant part should look like the below snippet. These values are saved whenever the window is resized or moved.

"lastWindowState": {
	"x": 1193,
	"y": 0,
	"width": 414,
	"height": 867,
	"isMaximized": false
}

mquevill avatar Nov 13 '21 23:11 mquevill

Ahh, gotcha! I moved my window to the side manually, without snapping it, and resized it to what I wanted, now Caprine opens it in the same spot and same size. That must mean that Caprine isn't remembering it if it was "snapped" in Windows.

I'm on Windows 11, in case this is only happening here and not on Windows 10.

swebervna avatar Nov 15 '21 14:11 swebervna

As it's already said, this is the job of electron. I'm putting here some issues that are on the electron page so we could track this better, https://github.com/electron/electron/issues/11554 https://github.com/electron/electron/issues/25359

dusansimic avatar May 06 '23 08:05 dusansimic