xou816 / spot

Native Spotify client for the GNOME desktop
MIT License
2.27k stars 119 forks source link

Spot resizes itself every time it is opened (elementaryOS 6) #424

Open AnElementaryUser opened 2 years ago

AnElementaryUser commented 2 years ago

Describe the bug Spot resizes itself every time it is opened.

To Reproduce Steps to reproduce the behavior:

  1. Open Spot
  2. Close it.
  3. Open Spot again.
  4. See that the window is resized.

Expected behavior It will remember the window size.

Screenshots Screen-record-from-2022-01-12

General information:

Stack trace: If applicable, run the application from a terminal and paste relevant log output.

flatpak run --env=RUST_BACKTRACE=full dev.alextren.Spot

Screenshot from 2022-01-12 20 33 12

Additional context Add any other context about the problem here.

AnElementaryUser commented 2 years ago

Latest release (0.3) solved this issue.

xou816 commented 2 years ago

Hi! Thanks for the report. Looks like we are not always saving the window size to gsettings. Do you see values being updated if you do the following?

flatpak --command=sh run dev.alextren.Spot # runs a shell in the flatpak image
spot 
# resize then close spot / ^C
gsettings get dev.alextren.Spot window-width # should log the last recorded width of the window 
xou816 commented 2 years ago

Oops, just a bit late :D I don't remember us fixing anything related to that in the latest version though, so feel free to reopen this issue if you encounter the problem again!

ghost commented 2 years ago

Hi @xou816

Could you please re-open this issue because I am having the same problem but I couldn't find a way to mitigate this?

Thanks.

xou816 commented 2 years ago

Sure! Would you mind trying these steps and reporting your results here?

ghost commented 2 years ago

As you said, I manually resized window then closed it.

$ flatpak --command=sh run dev.alextren.Spot
[📦 dev.alextren.Spot ~]$ spot

(spot:7): Gtk-WARNING **: 16:54:27.935: GtkGizmo 0x561a94554bb0 (highlight) reported min width -2, but sizes must be >= 0
[📦 dev.alextren.Spot ~]$ gsettings get dev.alextren.Spot window-width
1179

Then I launched it again and this time I didn't resize it and the number was up.

[📦 dev.alextren.Spot ~]$ spot

(spot:83): Gtk-WARNING **: 16:55:11.489: GtkGizmo 0x5578f67cdb80 (highlight) reported min width -2, but sizes must be >= 0
[📦 dev.alextren.Spot ~]$ gsettings get dev.alextren.Spot window-width
1207
ghost commented 2 years ago

Hi @xou816

Any news about this? Anything I can help with?

xou816 commented 2 years ago

Hi! Sorry, forgot about this. I sometimes notice this too, especially when making the window narrow -- I guess Gtk sometimes think it needs to have more space than truly needed.

Otherwise saving and restoring the values seems to work! So maybe the window manager is messing with the size here?

I'll still have to fix a little something, right now the sizes are not saved when quitting using Quit/<Ctrl>Q

xou816 commented 2 years ago

Just to be clear, are you observing significant differences in window sizes? I can't tell from OP's gif

ghost commented 2 years ago

saving and restoring the values seems to work

I don't wanna sound dumb but how can I save the values 😅😅

Just to be clear, are you observing significant differences in window sizes? I can't tell from OP's gif

OPs gif is so mysterious 😂 I think there is no proper screen recorder for elementary, that could be why it looks potato.

Back to your question, yes, window sizes change radically between sessions under X11, on wayland not so much. If I force the app to use Adwaita via Flatseal, it doesn't change much. Libadwaita could be causing this but I am out of ideas.

xou816 commented 2 years ago

I don't wanna sound dumb but how can I save the values 😅😅

No worries, I meant the thing we tested where the values were updated in gsettings!

But yeah, if it's down to a Wayland/X11 thing or a DE specific, I fear I won't want to look too hard into it... 😄 I'll push a fix for the size not being persisted when quitting, not closing the window.

xou816 commented 2 years ago

Almost forgot... again... but I pushed the small fix I mentioned

As for the random resizing, I am not really willing to investigate it much further if all it does is get the size wrong by a small amount, especially if it's some tricky Gtk resizing behavior or a DE issue

ghost commented 2 years ago

Whether it is fixed or not, it is a great application. Thank you!

bilelmoussaoui commented 2 years ago

I am pretty sure this is a gtk issue specific to x11