-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port both webhelper and markdown to webkit2gtk #677
Conversation
To build, in Fedora linux, with package webkitgtk4-devel
To build, in Fedora linux, with package webkitgtk4-devel Still need rework at least zoom functionalities that was comment out.
This fixes missing favicons in webhelper.
webkit2gtk no longer has the load-status property, so this needs to be updated.
@hyperair I'd like to keep GTK2 support on WebHelper if possible, and I know I've started (but not finished) this somewhere, I'll try to find it, compare with your changes and see if I find it reasonable to have support for both, or if you're right and it would be too much of a hassle. And thanks for your work here, looks promising :) Anyway, it'd be nice to split this PR in 2, one for each plugin, especailly as it's 2 separate maintainers that might have different views on supporting GTK2 or not :) |
@hyperair @b4n rather than making a [expletive deleted] mess of ifdefs, why not just make these separate plugins That way the luddite support is still in its own plugin for backward distros and "advanced" distros like Debian can distribute GTK3 versions 😁 The m4 should prevent the building the GTK2 or GTK3 plugins based on the Geany its building against, and if someone manages to build both versions @b4n has made the version numbering system prevent loading of GTK2 plugins in GTK3 Geany and vice versa. |
markdown/src/viewer.c
Outdated
g_signal_connect_swapped(WEBKIT_WEB_VIEW(self), "notify::load-status", | ||
G_CALLBACK(on_webview_load_status_notify), self); | ||
g_signal_connect_swapped(WEBKIT_WEB_VIEW(self), "notify::is-loading", | ||
G_CALLBACK(on_webview_is_loading_notify), self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the property notification, maybe it should use load-changed
?
markdown/src/viewer.c
Outdated
MarkdownViewer *self) | ||
{ | ||
WebKitLoadEvent load_status; | ||
gboolean load_status; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, instead of using this boolean, to look for WEBKIT_LOAD_FINISHED
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks. Looks like I missed that signal while looking through the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More to come
build/webhelper.m4
Outdated
GP_CHECK_GTK3([webkit_package=webkitgtk-3.0], | ||
[webkit_package=webkit-1.0]) | ||
GP_CHECK_GTK3([webkit_package=webkit2gtk-4.0], | ||
[webkit_package=webkit2gtk-4.0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's wrong, webkit2gtk-4.0 don't work with GTK2
build/markdown.m4
Outdated
GP_CHECK_GTK3([webkit_package=webkitgtk-3.0], | ||
[webkit_package=webkit-1.0]) | ||
GP_CHECK_GTK3([webkit_package=webkit2gtk-4.0], | ||
[webkit_package=webkit2gtk-4.0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same that with WebHelper, webkit2gtk-4.0 is wrong for GTK2
On Wed, Jan 17, 2018 at 09:28:48PM +0000, Colomban Wendling wrote:
@hyperair I'd like to keep GTK2 support on WebHelper if possible, and I know
I've started (but not finished) this somewhere, I'll try to find it, compare
with your changes and see if I find it reasonable to have support for both, or
if you're right and it would be too much of a hassle. Also, if Debian is also
switching to GTK3 Geany, it might suggest no distro is still using the GTK2
one and that it might be time to let go of the most complex GTK2
compatibility. I'll see.
I've already switched the Geany package in Debian to gtk3. Unfortunately, the
new plugins package is still stuck in NEW. I'll update the PPA shortly after I
finish working on this port too.
If you want to keep gtk2 after all, elextr's suggestion of splitting the plugin
into separate gtk2 and gtk3 versions might make sense.
And thanks for your work here, looks promising :)
:) Thanks, good to know.
Anyway, it'd be nice to split this PR in 2, one for each plugin, especailly as
it's 2 separate maintainers that might have different views on supporting GTK2
or not :)
I thought about doing that at first, but I suspect that there may be symbol
clashes between webkitgtk-1.0 and webkit2gtk-4.0, so loading plugins using
different webkit libraries into the same instance of Geany may end badly.
…--
Kind regards,
Loong Jin
|
@hyperair |
On Thu, Jan 18, 2018 at 12:21:03AM -0800, elextr wrote:
> I thought about doing that at first, but I suspect that there may be symbol
clashes between webkitgtk-1.0 and webkit2gtk-4.0, so loading plugins using
different webkit libraries into the same instance of Geany may end badly.
@hyperair luckily it can't happen since the ABI of a GTK2 Geany and a GTK3
Geany will not be the same
[see](https://github.com/geany/geany/blob/65097208df76439f0f059bafad5945624131475b/src/plugindata.h#L66)
Oh yeah, forgot about that. Also it turns out I was wrong about mixing
libraries. It might actually work after all:
https://github.com/hyperair/test-sym-conflict
…--
Kind regards,
Loong Jin
|
Is it means that now I can not build Geany and plugins with GTK3 and |
webkit2gtk-4.0 doesn't exist for gtk2.
We want to know when webkit finishes loading, so this simplifies matters.
On Thu, Jan 18, 2018 at 01:01:40PM +0000, Skif-off wrote:
@hyperair
> I've already switched the Geany package in Debian to gtk3. Unfortunately, the new plugins package is still stuck in NEW. I'll update the PPA shortly after I finish working on this port too.
Is it means that now I can not build Geany and plugins with GTK3 and
```webkitgtk-1.0``` from Debian Git-repository? ```geany_1.32-2``` and
```geany-plugin-*_1.32+dfsg-2``` from
[geany](https://anonscm.debian.org/git/pkg-geany/packages/geany.git)/[geany-plugins](https://anonscm.debian.org/git/pkg-geany/packages/geany-plugins.git).
I wanted to try GTK3-version :)
I'm assuming you meant s/can not/can now/, but yeah you can.
…--
Kind regards,
Loong Jin
|
@hyperair not that I expect you to do it, but the Devhelp plugin also depends on webkit1. |
Oh yeah forgot about that one. groan |
The changes to Markdown look OK by inspection, I haven't tested yet. |
@b4n Did you had a chance to review the latest changes for webhelper? |
if matter doesn't build in Redhat epel7 ( webkitgtk4-2.14.7-3.el7.x86_64.rpm )
|
@sergiomb2 that function was added in 2.18, apparently: |
Just a friendly question: When can I expect merging of the patches for markdown into the master branch? It would be very helpful! |
Looks like it isn't, and webkit2gtk isn't available in msys2 😞
Alright, let's try it. |
Use #ifdef's around the relevant portions that have been changed for webkit2gtk-4.0.
markdown/src/Makefile.am
Outdated
@@ -35,4 +35,7 @@ markdown_la_CFLAGS += $(LIBMARKDOWN_CFLAGS) | |||
markdown_la_LIBADD += $(LIBMARKDOWN_LIBS) | |||
endif | |||
|
|||
if WEBKIT2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be MARKDOWN_WEBKIT2
from the AM_CONDITIONAL
in markdown.m4
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing endif
markdown/src/Makefile.am
Outdated
@@ -35,4 +35,7 @@ markdown_la_CFLAGS += $(LIBMARKDOWN_CFLAGS) | |||
markdown_la_LIBADD += $(LIBMARKDOWN_LIBS) | |||
endif | |||
|
|||
if WEBKIT2 | |||
markdown_la_CFLAGS += -DWEBKIT2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If above is a typo, maybe it would be good to add the MARKDOWN_
prefix for this CPP define too, in case of any kind of conflict with a macro in the Webkit source? I don't care either way, but macros can get nasty when they clash.
With the latest changes to make this backwards compatible, except for the one little potential build system issue I commented on, I'm fine if anyone wants to merge the Markdown parts of this PR. @b4n have you had any time to check out the Webhelper changes yet? |
Also add namespace prefix to new macros to avoid clashing with Webkit (or other) sources.
Markdown plugin changes work for me with the change(s) in hyperair#1 |
Markdown: Fix a typo in the Makefile.am
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Markdown changes are OK, reviewed and tested.
Markdown-specific changes moved to #746. |
Wait… huh? Well, I guess it'll force somebody to fix the small bits on GTK3 [for webhelper] and forget GTK2 ever worked. Sad IMO, but I don't care enough to revert I guess. |
I was kind of expecting #746 to get merged, that's why I split it off so we could get the approved changes for Markdown in without blocking on the rejected changes for Webhelper in this PR. Oh well 🤷♂️ |
So.,... well... This looks like I messed it up. I missunderstood the comments. |
@sergiomb2 I agree. @frlan @b4n want me to revert this PR and merge #746 instead? I'll then update #747 accordingly (plus some changes based on feedback there). Someone can then update this pull request to be only for Webhelper (this PR should've been two PRs anyway). |
You may merge #746 , is just have one little commit , if I'm not wrong. Is not exactly the same thing ? |
@sergiomb2 there's no point merging #746, all of its changes are already merged in this PR. If this PR gets reverted to remove the unapproved Webhelper changes, then it would make sense to merge #746 to pull in the wanted Markdown changes. |
Well... I thnik I will revert this one, and merge #746 |
This is a port of both webhelper and markdown to webkit2gtk (webkit2gtk-4.0). webkitgtk-1.0 is now deprecated, as is webkitgtk-3.0. Unfortunately, this also means that gtk2 is no longer supported for these plugins. This PR also includes changes from #656.
I can reintroduce the old webkitgtk-1.0 code, but it's going to involve quite a bit of ugly #ifdef-ing because quite a number of things have changed (most of the signals have been completely reorganized to have different meanings and function signatures, so a separate set of callbacks for both the old and new ones would need to be included).
@b4n