Viewnior icon indicating copy to clipboard operation
Viewnior copied to clipboard

port to gtk3

Open BwackNinja opened this issue 4 years ago • 15 comments

Fixes #96 and does not retain gtk2 compatibility

BwackNinja avatar Aug 24 '21 01:08 BwackNinja

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

tastytea avatar Aug 24 '21 21:08 tastytea

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

BwackNinja avatar Aug 24 '21 21:08 BwackNinja

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.

BwackNinja avatar Aug 25 '21 14:08 BwackNinja

does not retain gtk2 compatibility

Why not? Would be good for backwards compatibility.

orbea avatar Sep 05 '21 17:09 orbea

@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.

BwackNinja avatar Sep 09 '21 14:09 BwackNinja

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..

ncmprhnsbl avatar Sep 22 '21 05:09 ncmprhnsbl

@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 avatar Sep 22 '21 06:09 BwackNinja

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

BwackNinja avatar Sep 22 '21 06:09 BwackNinja

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

ncmprhnsbl avatar Sep 22 '21 09:09 ncmprhnsbl

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

qarkai avatar Nov 23 '21 13:11 qarkai

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 avatar May 24 '22 10:05 qarkai

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.

qarkai avatar Dec 02 '22 20:12 qarkai

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

BwackNinja avatar Dec 02 '22 20:12 BwackNinja

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

amosonn avatar Nov 04 '23 11:11 amosonn