hellosiyan / Viewnior

Elegant Image Viewer
https://siyanpanayotov.com/project/viewnior/
GNU General Public License v3.0
319 stars 55 forks source link

After resizing the window, places it in the center #90

Closed fnix2 closed 2 years ago

fnix2 commented 3 years ago

When the "Adjust window size" checkbox is checked, positions the window in the center when scrolling through images

ghost commented 3 years ago

Nice work, and good to see that there are still people caring about and contributing PRs to Viewnior :)

On my system (Arch Linux, openbox), the behavior with this patch is very buggy. If I move the window towards the side of the screen and start to resize it, it will jump between the center of the screen and back to where it was. It continues to flicker back and forth for as long as I keep resizing it. It might be that the behavior is different on other systems, but on this machine, the patch does not play nice with the system.

biopsin commented 3 years ago

While it works, it does conflict for me with preference : Fit to window mode, or applied patch : Best fit The issue is when changing to next/prev image the window scales back to original image size, instead of maintaining my prefered window size.

hellosiyan commented 3 years ago

On my system (Gnome 40 on Wayland) the PR works well until I try resizing - the window start moving around as @sjoblomjsqueed describes. I played around looking for a simple fix, but couldn't find anything stable enough - adding gtk_window_move, gtk_window_set_gravity, gtk_window_set_position, and gtk_main_iteration in various constellations does not work every time. So I think unless a heavier "machinery" is implemented to listen to resizes, redraws, etc and position the window accordingly, then centering the window would be buggy/unreliable. At this point I think the feature is not worth the effort :thinking:

hellosiyan commented 2 years ago

@fnix2 Thanks for the PR. If you can resolve the issues above and update accordingly I can take a look at this again :+1:

fnix2 commented 2 years ago

Ok. If I succeed.