-
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
Changes from 10 commits
c5f410a
1d5665e
1fd266a
ba6142e
6baf793
4cff846
336ac2e
35736fb
1b354aa
181029d
2c7aaa8
630bba7
cd19ee2
1c97b5d
1b84e29
b9c0252
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ AC_DEFUN([GP_CHECK_WEBHELPER], | |
fi | ||
fi | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. that's wrong, webkit2gtk-4.0 don't work with GTK2 |
||
GP_CHECK_PLUGIN_DEPS([WebHelper], [WEBHELPER], | ||
[$GP_GTK_PACKAGE >= ${GTK_VERSION} | ||
glib-2.0 >= ${GLIB_VERSION} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
#include "config.h" | ||
#include <string.h> | ||
#include <gtk/gtk.h> | ||
#include <webkit/webkitwebview.h> | ||
#include <webkit2/webkit2.h> | ||
#include <geanyplugin.h> | ||
#ifndef FULL_PRICE | ||
# include <mkdio.h> | ||
|
@@ -297,15 +297,15 @@ pop_scroll_pos(MarkdownViewer *self) | |
} | ||
|
||
static void | ||
on_webview_load_status_notify(WebKitWebView *view, GParamSpec *pspec, | ||
on_webview_is_loading_notify(WebKitWebView *view, GParamSpec *pspec, | ||
MarkdownViewer *self) | ||
{ | ||
WebKitLoadStatus load_status; | ||
gboolean load_status; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, instead of using this boolean, to look for There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
g_object_get(view, "load-status", &load_status, NULL); | ||
g_object_get(view, "is-loading", &load_status, NULL); | ||
|
||
/* When the webkit is done loading, reset the scroll position. */ | ||
if (load_status == WEBKIT_LOAD_FINISHED) { | ||
if (!load_status) { | ||
pop_scroll_pos(self); | ||
} | ||
} | ||
|
@@ -389,12 +389,11 @@ markdown_viewer_update_view(MarkdownViewer *self) | |
* position once the webview is reloaded. */ | ||
if (self->priv->load_handle == 0) { | ||
self->priv->load_handle = | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Instead of the property notification, maybe it should use |
||
} | ||
|
||
webkit_web_view_load_string(WEBKIT_WEB_VIEW(self), html, "text/html", | ||
self->priv->enc, base_uri); | ||
webkit_web_view_load_html(WEBKIT_WEB_VIEW(self), html, base_uri); | ||
|
||
g_free(base_uri); | ||
g_free(html); | ||
|
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