hellosiyan / Viewnior

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

port to gtk3 #108

Open BwackNinja opened 3 years ago

BwackNinja commented 3 years ago

Fixes #96 and does not retain gtk2 compatibility

tastytea commented 3 years ago

Commit c84708939bf350cfa12cc14f05ac8b39af68fd50 + this patch compiles and works mostly fine for me on Linux, GCC-10.3, GTK-3.24.

But I found 2 bugs: The credits view seems to miss the “interpret this as pango”-bit.

Screenshot of credits view with pango code visible.

Image → Crop… does not work, I get this error message. Edit: With “does not work” I mean the crop-window does not show up.

** (viewnior:24376): WARNING **: 23:11:48.957: /usr/share/viewnior/vnr-crop-dialog.ui:12:37 Invalid property: GtkDialog.has_separator
BwackNinja commented 3 years ago

Fixed those bugs along with broken dark background mode and some minor style issues.

BwackNinja commented 3 years ago

Fixed bugs I had introduced with fullscreen and the crop rectangle.

I tested whatever else that I could think of, and it looks like everything works.

orbea commented 2 years ago

does not retain gtk2 compatibility

Why not? Would be good for backwards compatibility.

BwackNinja commented 2 years ago

@orbea Backwards compatibility with what? Gtk2 is end of life and gtk3 has been available for over 10 years. Even xfce4's gtk3 port was finished over 3 years ago.

It's doable, and I've done that with older gtk3 ports like SpaceFM when gtk3 was still controversial, but unless there is a good example of where using gtk2 is preferable, or if Viewnior's maintainer requests gtk2 support, I don't see how keeping gtk2 compatibility would be more than a maintenance burden.

ncmprhnsbl commented 2 years ago

Seems to be an issue with the 'open image..' dialog, if selecting multiple images (ctrl+click) ...first image opens okay, but navigating to the second(and more) there's just : Fail to open file:<looks like recent clipboard history and/or random junk>:no such file or directory . Then navigating back to the first image also fails.
Opening single image(ie the entire folder) is ok. Open multiple images from a filemanager is ok.

Using arch, gtk3-3.24.30+62+g8d04980f38 and building from your fork..

BwackNinja commented 2 years ago

@ncmprhnsbl This doesn't seem to be a gtk3 issue as I can reproduce the same with gtk2. It is probably a use-after-free issue. I'll see if I can resolve it regardless, but it would be best to open up a separate bug report to track that issue.

BwackNinja commented 2 years ago

That's what it was. I'll make a pull request to fix it in the next few days, but for now here's a patch:

fix-use-after-free-multi-file.patch.txt

ncmprhnsbl commented 2 years ago

ah, yes, didn't think to check that.. issue #111 done..

qarkai commented 2 years ago

I believe GTK+3 migration should be removed from TODO in this PR.

qarkai commented 2 years ago

Glade files data/vnr-*-dialog.ui still use gtk+ 2.12. I suggest to update them to at least gtk+ 3.16 (labels on vnr-preferences-dialog.ui have xalign property which was introduced in 3.16) and fix deprecation warnings.

qarkai commented 1 year ago

There is difference in fullscreen mode. Gtk2 has gray background, Gtk3 has black background. In window mode both versions have same gray background. @BwackNinja Could you fix this difference? Upd. Ristretto has same behavior: gray background in window mode changes to black background in fullscreen. Probably it's Gtk3 feature. Background color could depend on chosen Gtk theme.

BwackNinja commented 1 year ago

Sure. I'll take a look. It should be simple.

amosonn commented 9 months ago

Any news on this? Can I help in some way?