Skip to content
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

MGR: support wxWidgets without webview #2093

Closed
wants to merge 1 commit into from
Closed

MGR: support wxWidgets without webview #2093

wants to merge 1 commit into from

Conversation

jengelh
Copy link

@jengelh jengelh commented Sep 8, 2017

If wxWidgets is built without the webview widget, make do with a
plain multiline text control.

--
openSUSE plans on removing webkitgtk. wxWidgets-3.0.X has it as an optional dependency but turning it off makes programs like boinc fail to build. Solve that in short order - the patch is not necessarily beautiful, though the resulting UI seems to do well, as most notices have very little markup (mostly just <a>..</a>).

@AenBleidd
Copy link
Member

AenBleidd commented Sep 8, 2017 via email

@CharlieFenton
Copy link
Contributor

CharlieFenton commented Sep 8, 2017 via email

@ChristianBeer
Copy link
Member

The Debian distribution also wants to drop support for wxWebView and we discussed possible solutions. One that sounded the most promising is to replace wxWebView with wxHtmlWindow which does not require webkitgtk but still provides similar features.

@AenBleidd
Copy link
Member

AenBleidd commented Sep 8, 2017 via email

@ChristianBeer
Copy link
Member

In the places we use wxWebView we don't use a lot of styles so it is a better alternative than wxTextCtrl where we have no style support at all.

@AenBleidd
Copy link
Member

AenBleidd commented Sep 8, 2017 via email

@jengelh
Copy link
Author

jengelh commented Sep 8, 2017

Updated to have it use wxHtmlWindow. Good suggestion.

@JuhaSointusalo
Copy link
Contributor

I think this is a bad idea. One of the reasons Manager was changed to use wxWebView was so that it can show notices that embed videos. And by being backed by a real web browser engine wxWwebView can do much more than just that. It handles SVGs, or you can use Javasript and have dynamic content or anything you could have in a web page and that is pretty cool.

Having rich content in apps is normal these days and having the content in the app likely results in larger percentage of the audience actually seeing the content. You lose a part of the audience at every click they have to do.

This will also make Manager's features differ between platforms. It's never fun to spend a couple of hours trying to help someone only to find out that the version of BOINC they have lacks a feature you have on your BOINC.

Before anyone objects that nobody uses videos in notices. Now that everyone is in Paris how about promoting the feature a bit. Seti@home for example have had staff video interviews but the videos have not been embedded in the notices.

openSUSE is presumably removing the old unsupported totally insecure version of webkitgtk but they also have the newer supported version packaged in webkit2gtk3. Rather than this patch please work with wxWidgets' packager to build wxWidgets with the newer WebKitGTK+.

@@ -20,7 +20,7 @@
#endif

#if !(defined(_WIN32) || (defined(__WXMAC__) && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4)))
#include <xlocale.h>
#include <locale.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. See PR #2092.

@@ -45,8 +45,12 @@ class CNoticeListCtrl: public wxWindow

////@begin CNoticeListCtrl event handler declarations

#if defined(wxUSE_WEBVIEW) && wxUSE_WEBVIEW
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elsewhere you use simple #if wxUSE_WEBVIEW.

Copy link
Contributor

@JuhaSointusalo JuhaSointusalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this ends up being merged some changes are needed.

@jengelh
Copy link
Author

jengelh commented Sep 8, 2017

wxWidgets 3.0.3 does not appear to support webkit2. It only checks for webkit-1.0.pc/webkitgtk-3.0.pc.

If wxWidgets is built without support for the webview widget, make do
with a wxHtmlWindow instead.
@JuhaSointusalo
Copy link
Contributor

You'd need to backport the support. See the discussion in Debian bugtracker.

@jengelh
Copy link
Author

jengelh commented Sep 8, 2017

@JuhaSointusalo
Copy link
Contributor

Sorry. I meant, you'd need to backport the webkit2gtk support of the later version of wxWidgets to wxWidgets version 3.0.3 and then have the wxWidgets 3.0.3+webkit2gtk packaged for openSUSE. From the Debian thread it looks like it's only one commit that's needed.

What kind of timetable openSUSE has for dropping the old webkitgtk and releasing a new distro version?

@davidpanderson
Copy link
Contributor

I'd like to keep the ability to show video in notices if possible
(eventually projects will use this feature, I hope).

@jengelh
Copy link
Author

jengelh commented Sep 8, 2017

What kind of timetable openSUSE has for dropping the old webkitgtk

webkit I don't know yet (other maintainer), but the WebView-less wxWidgets will likely find its way onto mirrors next week already. There wasn't a whole lot of packages — two — that unconditionally used that class to begin with.

@ChristianBeer
Copy link
Member

The change from wxWebView to wxHTMLWindow was always meant as an intermediate measure until the Debian/OpenSuse package maintainers can get the new webkitgtk packages up and running. The alternative is that BOINC will be removed from Debian and openSuse repositories and I don't think we want this to happen. So we will loose some functionality until the webkitgtk update is finished but it will not be lost forever.

@JuhaSointusalo
Copy link
Contributor

If at some point it comes to choosing either reduced functionality or Manager being dropped from repositories I can live with reduced functionality. On Debian it looks like they are not yet (as in today or tomorrow) removing webkitgtk.

I tried to find more information about openSUSE's situation but didn't find anything (maybe I didn't look at the right place). What I did find out is that @jengelh is wxWidgets maintainer there so he is in perfect position to sort this out on their side.

I'm being difficult here in the hopes that it will put pressure on the distros to move to a supported WebKitGTK. But I have a feeling that I'm losing the argument here. With the way the code is right now, if someone builds the Manager with wxWidgets that lacks WebView, the code silently switches to reduced functionality. I'd prefer if reduced functionality is something one has to opt-in. If one doesn't opt-in then break the build.

Copy link
Contributor

@JuhaSointusalo JuhaSointusalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wx/webview.h and wx/webviewfshandler.h are included in clientgui/stdwx.h. I would imagine that if wxWidgets is built without WebView then these headers are not available.

@jengelh
Copy link
Author

jengelh commented Sep 12, 2017

I would imagine that if wxWidgets is built without WebView then these headers are not available.

Given that webview.h has a big #if wxUSE_WEBVIEW inside it, that suggests it is always available (though of course "empty" for all practical purposes).

@JuhaSointusalo
Copy link
Contributor

JuhaSointusalo commented Sep 12, 2017 via email

@ojwb
Copy link

ojwb commented Sep 27, 2017

From the Debian thread it looks like it's only one commit that's needed.

However, it's not just a matter of backporting a single commit or we'd have done that long ago - the newer webkitgtk also requires a switch from GTK+ 2 to GTK+ 3, and wxWidgets' GTK+ 3 support isn't yet as solid as its GTK+ 2 support - even trying the samples that come with wxWidgets turned up several bugs under GTK+ 3. The wxWidgets developers are pretty responsive to fixing these, but a switch to GTK+ 3 is going to need a lot of time and testing. If it comes down to having to choose, I'm afraid the short term decision for Debian would be to temporarily break boinc in testing/unstable rather than rush into switching to GTK+ 3 and break an unknown number of other packages which use wxWidgets.

On Debian it looks like they are not yet (as in today or tomorrow) removing webkitgtk.

However, it is likely a matter of days now - it's only boinc and empathy that are left, and I was told empathy was "several days away" at the start of this week.

What's the status of the patch here?

@CharlieFenton
Copy link
Contributor

I don't know much about Linux distros, but I wonder if it would be practical for someone to build the webview.so library from wxWidgets and make the library available in GIT for static linking with BOINC Manager on Linux?

@ojwb
Copy link

ojwb commented Sep 27, 2017

No, that wouldn't help at all.

@JuhaSointusalo
Copy link
Contributor

@ojwb Thanks for the update on Debian status. Lifting this comment from Debian bug 790222

As things stand, the plan is probably that there's no webview for buster.

That makes it pretty clear what the current status is.

I tested this PR on both Windows and Linux. I don't have wxWidgets that's really without Webview so I edited setup.h to disable it on Linux.

The good news is that on Windows Manager still used wxWebView and on Linux it used wxHTMLWindow. Bad news is that everything else sucks.

On Linux,

  • clicking any link now opens the link both inside Manager and in proper web browser
  • images over HTTPS are not supported
  • SVG is not supported (although, on Windows IE engine is used which doesn't support SVG either)
  • video isn't supported

Video support totally sucks in WebView enabled Manager btw. YouTube doesn't support Flash based player any more, instead you get some kind of an Flash thingy with "Flash-embedded videos are no longer supported" text and a button "Watch on YouTube" but clicking the button does nothing on Linux or Windows.

And YouTube's new iframe based player doesn't work on Linux or Windows either. In Manager it's just empty space and on top of that on Linux it automatically opens the video (not the news post) in browser tab. On Windows you need right click the Notices tab and select Refresh to have the video open automatically.

And if that's not bad enough, HTML5 video doesn't work on Windows because the IE engine doesn't support it.

:(

@JuhaSointusalo
Copy link
Contributor

@ojwb I forgot to add. It's not just this PR but also PR #2104 that's needed before BOINC doesn't require WebView.

@AenBleidd
Copy link
Member

AenBleidd commented Sep 28, 2017 via email

event.Skip();
return;
}
event.Skip(); // Tell element not to follow link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug. Contrary to the comment, it makes wxHTMLWindow open the link inside Manager.

@JuhaSointusalo
Copy link
Contributor

Images over HTTPS don't work because wxWidgets doesn't support HTTPS. That's kind of bad considering the push to HTTPS everywhere.

I suppose HTTPS URLs could be rewritten to HTTP and hoping that the web server doesn't redirect all HTTP to HTTPS. Or an HTTPS handler could be added but that's lot of work. Maybe we should just accept that the next Debian, Ubuntu and OpenSUSE releases won't always display images in notices.

ChristianBeer added a commit that referenced this pull request Oct 26, 2017
This is a combination of contributions by Jan Engelhardt (#2093) and Olly Betts (https://anonscm.debian.org/cgit/pkg-boinc/boinc.git/commit/?id=60f4cd232522db0750b2dff56bd327dc44a51534) to make the Manager work without webview support. This is mainly needed for Linux distributions that are migrating to a newer webkitgtk library.
@ojwb
Copy link

ojwb commented Nov 10, 2017

Lifting this comment from Debian bug 790222

As things stand, the plan is probably that there's no webview for buster.

That makes it pretty clear what the current status is.

You've lifted that without context - in full:

> what is the plan to fix it BTW? moving to the new webkitgtk and transition to
> gtk3?

I think that's the only way to get webview back, but we need people to
actually do the work to make that happen.  I'm not realistically able to
commit to doing a transition unaided at this point - initial
investigations showed that it's likely to shake out a significant number
of bugs in both wx's GTK+ 3 support and in apps themselves.  It's not
just a case of uploading and binNMUing all rdeps.

As things stand, the plan is probably that there's no webview for buster.

The tl;dr version is more like "help wanted".

ChristianBeer added a commit that referenced this pull request Jan 29, 2018
This is a combination of contributions by Jan Engelhardt (#2093) and Olly Betts (https://anonscm.debian.org/cgit/pkg-boinc/boinc.git/commit/?id=60f4cd232522db0750b2dff56bd327dc44a51534) to make the Manager work without webview support. This is mainly needed for Linux distributions that are migrating to a newer webkitgtk library.
@AenBleidd
Copy link
Member

Can be closed as unnecessary after merging #2190

@AenBleidd
Copy link
Member

Necessary changes are already merged into master via #2190.
I'm closing this pull request now.
If you have any objections feel free to reopen it.

@AenBleidd AenBleidd closed this Feb 5, 2018
@ojwb
Copy link

ojwb commented Mar 26, 2018

FYI, there's now a GTK3 build of wxwidgets3.0 in Debian unstable and testing, which includes the webview library (thanks to Scott Talbert stepping up to make this happen).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants