I send 2 commits first for markdown plugin , which seems to me that can be cherry-picked and the second for webhelper which also use the same webkitgtk but it is not completed ! , please just look for the first commit, first.
Thanks. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/656
-- Commit Summary --
* [markdown] Use webkit2gtk3 (webkit2 API) * [webhelper] Use webkit2gtk3 (webkit2 API)
-- File Changes --
M build/markdown.m4 (4) M build/webhelper.m4 (4) M markdown/src/viewer.c (7) M markdown/src/viewer.h (2) M webhelper/src/gwh-browser.c (74) M webhelper/src/gwh-browser.h (2)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/656.patch https://github.com/geany/geany-plugins/pull/656.diff
I have some early work somewhere for using Webkit2GTK in WebHelper I could probably dig out. Just remember that for now I want to still support GTK2, which has no Webkit2 API, so it's a little trickier.
b4n requested changes on this pull request.
For the WebHelper plugin: I think it's a good idea to get Webkit2 support, but I think this needs more work to be mergeable.
GdkPixbuf *icon;
- - icon = gwh_pixbuf_new_from_uri (icon_uri, NULL); + GtkImage *image; + gtk_image_set_from_surface (image, favicon); + icon = gtk_image_get_pixbuf(image);
does this work? I would be highly surprised if it does, GtkImage is not necessarily (well, I think never) using Pixbuf backed data, and so the `get_pixbuf()` method will probably return `NULL` here, doesn't it?
break;
case GDK_SCROLL_UP: - webkit_web_view_zoom_in (WEBKIT_WEB_VIEW (self->priv->web_view)); + webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW (self->priv->web_view), 1.0);
this doesn't really make any sense, resetting the zoom to 1 when it should zoom in/out
@b4n, just make a new plugin for gtk3, the API number protection will stop the wrong one from being run.
b4n requested changes on this pull request.
Looks close, but for GTK2 support
@@ -49,8 +49,8 @@ AC_DEFUN([GP_CHECK_MARKDOWN],
GTK_VERSION=2.16 WEBKIT_VERSION=1.1.13
- 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])
This won't work for a GTK2 Geany: webkit2gtk is just not available for GTK2
@@ -300,7 +300,7 @@ static void
on_webview_load_status_notify(WebKitWebView *view, GParamSpec *pspec, MarkdownViewer *self) { - WebKitLoadStatus load_status; + WebKitLoadEvent load_status;
g_object_get(view, "load-status", &load_status, NULL);
[webkit2gtk web view](https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html) doesn't ave a `load-status` property.
this should be replaced with [`load-changed`](https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitW...) and/or [`load-failed`](https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitW...) handlers.
Just remember that for now I want to still support GTK2
@b4n, this is a plugin, its not Geany code.
@elextr yes, but I'm author and maintainer of WebHelper, and I would for now like to still support mainstream Geany :)
@b4n where is the latest code of WebHelper ? After looking to webkit2gtk of Debian , we have libwebkit2gtk-4.0-dev with libgtk3-dev and libwebkit2gtk-4.0-37-gtk2 . Or we build geany and geany-plugins with gtk3 or geany and geany-plugins with gtk2, we can't mixup gtk versions, hopefully geany-1.32 with can be build with gtk3 and I may use libwebkit2gtk-4.0 (gtk3) of Fedora (webkitgtk4) which is webkit2 with gkt3 only
@b4n, oops, sorry I thought this was for markdowns use of webkit, not webhelper, never mind carry on.
hyperair commented on this pull request.
@@ -49,8 +49,8 @@ AC_DEFUN([GP_CHECK_MARKDOWN],
GTK_VERSION=2.16 WEBKIT_VERSION=1.1.13
- 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])
Might be time to abandon GTK2 Geany. :trollface:
Just a note: I uploaded gtk3 Geany to Debian recently (1.32-2).
Also, before I realized there was already a PR in progress, I made an attempt at porting it myself: https://github.com/hyperair/geany-plugins/commit/1fd266a97b9fedb0ae463a2cf9a...
It compiles and works, but is missing the context menu at the moment. That needs to be ported to [`WebKitContextMenu`](https://webkitgtk.org/reference/webkit2gtk/stable/WebKitContextMenu.html).
hyperair commented on this pull request.
@@ -300,7 +300,7 @@ static void
on_webview_load_status_notify(WebKitWebView *view, GParamSpec *pspec, MarkdownViewer *self) { - WebKitLoadStatus load_status; + WebKitLoadEvent load_status;
g_object_get(view, "load-status", &load_status, NULL);
There's an implementation of that here: https://github.com/hyperair/geany-plugins/commit/1fd266a97b9fedb0ae463a2cf9a... https://github.com/hyperair/geany-plugins/commit/1fd266a97b9fedb0ae463a2cf9a...
sergiomb2 commented on this pull request.
@@ -49,8 +49,8 @@ AC_DEFUN([GP_CHECK_MARKDOWN],
GTK_VERSION=2.16 WEBKIT_VERSION=1.1.13
- 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])
yes webkit2gtk , only have support for GTK3 , in Fedora Linux is removing webkit1gtk2 from repos (manly because security issues)
Just a note: I uploaded gtk3 Geany to Debian recently (1.32-2).
Also, before I realized there was already a PR in progress, I made an attempt at porting it myself: hyperair/geany-plugins@1fd266a
It compiles and works, but is missing the context menu at the moment. That needs to be ported to WebKitContextMenu.
Cool , maybe you can include https://github.com/geany/geany-plugins/pull/656/commits/c5f410a5040751f8ef53... since my focus is on markdown plugin , I just do some work on webhelper , because both plugins depends on same package (webkitgtk) , so we need migrate both on same time !
Best regards,
please move to https://github.com/geany/geany-plugins/pull/677
Closed #656.
github-comments@lists.geany.org