nuttyartist / notes

Fast and beautiful note-taking app written in C++. Write down your thoughts.
https://notes-foss.com
Mozilla Public License 2.0
3.77k stars 333 forks source link

[Regression] [Linux] Window resizing is broken in frameless mode #483

Closed guihkx closed 1 year ago

guihkx commented 1 year ago

Window resizing in v1.5.0 (frameless mode):

https://user-images.githubusercontent.com/626206/219870703-41d77515-b652-43bd-a2e4-1997e93eed0f.mp4


Window resizing in v2.0.0 or dev (frameless mode):

https://user-images.githubusercontent.com/626206/219870792-bab25c1f-5d6c-4e2d-8a7c-4f8ca2db5eda.mp4


As you can see, we can't resize the window in v2.0.0 like we could in v1.5.0.

Because frameless mode is the default experience, we should probably fix this before releasing 2.1.0.

PS: This is unrelated to #454.

nuttyartist commented 1 year ago

Did we remove @theshadowx's code that implemented custom resizing?

guihkx commented 1 year ago

I haven't tried looking at that specifically, but I did try inspecting mouse move events in ui->frame, but for some reason they aren't being fired at all, even though I think they should?

https://github.com/nuttyartist/notes/blob/e7521332f58ae42e013c55732206b849a6ff8f2e/src/mainwindow.cpp#L354

And

https://github.com/nuttyartist/notes/blob/e7521332f58ae42e013c55732206b849a6ff8f2e/src/mainwindow.cpp#L357

guihkx commented 1 year ago

Attempted to run a git bisect between v1.5.0 and v2.0.0:

There are only 'skip'ped commits left to test.
The first bad commit could be any of:

2a12e5f0dd924043443ae63de232f2928b08c630 3008e0c67a2df3d0cfe82864cf2cc3ed24796b2f 851bbaae6d5be627b077a46fdbf189e9182edd67 77df54658eaeb52c0d38f6a67f2779e998db7f90 f5ffee5915ecc43b367e61c58ac8da4f8d8beafe 109a310f8968f982edb89e1bc66b7b7903938ea4 edbf28792caa5d3dae3663964b3d9f2ee65e5896 6a15f426bbfe17fa5ec6ebe6a4dbd68bba2ce43e 755667efe27bd3d996fe12e9652b1ca9eb85d5ed 85c8f0ef39ade4b6b669a066d68c70f09ccfc55a 966e3d24f90fee4837099aa50ae78871c2e50873 ddd79edf077158e0e62cc2b432f669e60a7d9bfb

We cannot bisect more!

I could not build on any of these commits...

guihkx commented 1 year ago

Oh, I think I've got it. After reverting some changes from https://github.com/nuttyartist/notes/commit/ddd79edf077158e0e62cc2b432f669e60a7d9bfb (they were mostly margin-related), I can now resize the window on Linux again (please note that the resizing itself is a bit buggy because the changes from #481 aren't included yet):

https://user-images.githubusercontent.com/626206/219931626-e593b93e-cf25-45dc-9137-e5d766b3c2d1.mp4


It's not immediately obvious to me if reverting those will break something else though, so do you remember exactly the reason behind those changes? I can't seem to find it on the pull request (#295) or the commits itself...

nuttyartist commented 1 year ago

Damn, I can't remember. I should have been more verbose in my commit message 😅. I think the margins made it look weird on some distros or something about the shadow. But I'll have to look again on Linux. I'll spin a Linux machine and test it today in a few hours.