cinnyapp / cinny-desktop

Yet another matrix client for desktop
GNU Affero General Public License v3.0
381 stars 41 forks source link

Feature Request: Remember window size when closing app #125

Open meequrox opened 1 year ago

meequrox commented 1 year ago

Describe the problem

By default, a 1024x724 window opens every time Cinny is started. The app doesn't remember window size when closing.

Describe the solution you'd like

Before the application closes, it remembers the current window size. On the next app launch the window will have this size.

For example, I installed Cinny for the first time and opened it. The window will have some default size. I clicked "Maximize Window" and the window resized to 1920x1058. Then I closed the app and reopened it. The size of the window should now be 1920x1058.

Alternatives considered

No response

Additional context

No response

meequrox commented 1 year ago

I am not familiar with Rust and haven't looked into the proper ways to store such parameters, but at first glance I think it might be implemented in main.rs:main() something like this:

let mut context = tauri::generate_context!();
context.config_mut().tauri.windows[0].width = GET_SAVED_WIDTH();
context.config_mut().tauri.windows[0].height = GET_SAVED_HEIGHT();

builder
  .run(context)
  .expect("error while running tauri application");
dillfrescott commented 1 year ago

Searched for this issue and I'm glad its already here. This is an annoying problem for me, that it resets back to the default size upon every boot.

varjolintu commented 1 year ago

I built something similar to lievo (using Tauri WRY), and storing the values with confy. Maybe something similar could be done cinny-desktop? I have to admit I had some problems with the window title bar. Seems it's not calculated to the actual window size.