Skip to content

Commit

Permalink
Upgrade CEF version to 87.1.6 and change cursor handling to match new…
Browse files Browse the repository at this point in the history
… API. Bump version number to 0.9.1.2.
  • Loading branch information
ttalvitie committed Nov 21, 2020
1 parent 385724b commit b7ae8ee
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CXX ?= g++
CFLAGS_COMMON := -std=c++17 -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -fno-strict-aliasing -fPIC -fstack-protector -funwind-tables -fvisibility=hidden --param=ssp-buffer-size=4 -pipe -pthread -Wall -Werror -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -Wno-psabi `pkg-config --cflags pangoft2`
CFLAGS_COMMON := -std=c++17 -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -fno-strict-aliasing -fPIC -fstack-protector -funwind-tables -fvisibility=hidden --param=ssp-buffer-size=4 -pipe -pthread -Wall -Werror -Wno-error=deprecated-declarations -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -Wno-psabi `pkg-config --cflags pangoft2`
CFLAGS_debug := $(CFLAGS_COMMON) -g -O0
CFLAGS_debug_png := $(CFLAGS_COMMON) -g -O3
CFLAGS_release := $(CFLAGS_COMMON) -O3 -DNDEBUG -fdata-sections -ffunction-sections -fno-ident -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The commands for installing the dependencies of the Browservice proxy on various
#### Ubuntu 18.04/20.04, Debian 10 and Raspberry Pi OS

```
sudo apt install cmake g++ pkg-config libxcb1-dev libx11-dev libpoco-dev libjpeg-dev zlib1g-dev libpango1.0-dev libpangoft2-1.0-0 ttf-mscorefonts-installer xvfb xauth libatk-bridge2.0-0 libasound2 libgbm1 libxi6 libcups2 libnss3 libxcursor1 libxrandr2 libxcomposite1 libxss1
sudo apt install wget cmake g++ pkg-config libxcb1-dev libx11-dev libpoco-dev libjpeg-dev zlib1g-dev libpango1.0-dev libpangoft2-1.0-0 ttf-mscorefonts-installer xvfb xauth libatk-bridge2.0-0 libasound2 libgbm1 libxi6 libcups2 libnss3 libxcursor1 libxrandr2 libxcomposite1 libxss1 libxkbcommon0
```

- On Debian, in order to be able to install the `ttf-mscorefonts-installer` package, you need to add the `contrib` APT source by adding `contrib` to the end of each `deb` and `deb-src` line in `/etc/apt/sources.list` and running `sudo apt update`.
Expand All @@ -122,17 +122,17 @@ sudo apt install cmake g++ pkg-config libxcb1-dev libx11-dev libpoco-dev libjpeg
sudo dpkg -i ttf-mscorefonts-installer_3.7_all.deb
```
#### Fedora 32
#### Fedora 33
```
sudo dnf install cmake make g++ pkg-config poco-devel libjpeg-turbo-devel pango-devel Xvfb xauth at-spi2-atk alsa-lib libXScrnSaver libXrandr libgbm libXcomposite libXcursor curl cabextract xorg-x11-font-utils
sudo dnf install wget tar bzip2 cmake make g++ pkg-config poco-devel libjpeg-turbo-devel pango-devel Xvfb xauth at-spi2-atk alsa-lib libXScrnSaver libXrandr libgbm libXcomposite libXcursor curl cabextract xorg-x11-font-utils nss cups-libs
sudo rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
```
#### Arch Linux
```
sudo pacman -S wget cmake make gcc pkgconf poco pango libjpeg-turbo libxcb libx11 python xorg-server-xvfb xorg-xauth fakeroot at-spi2-atk alsa-lib nss libcups libxrandr libxcursor libxss libxcomposite
sudo pacman -S wget cmake make gcc pkgconf poco pango libjpeg-turbo libxcb libx11 python xorg-server-xvfb xorg-xauth fakeroot at-spi2-atk alsa-lib nss libcups libxrandr libxcursor libxss libxcomposite libxkbcommon

# Install MS core fonts from AUR
wget https://aur.archlinux.org/cgit/aur.git/snapshot/ttf-ms-fonts.tar.gz
Expand Down
16 changes: 8 additions & 8 deletions download_cef.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ ARCH=`uname -m`

if [ "$ARCH" == "x86_64" ]
then
wget "http://opensource.spotify.com/cefbuilds/cef_binary_84.4.1%2Bgfdc7504%2Bchromium-84.0.4147.105_linux64.tar.bz2" -O cef_unverified.tar.bz2
SHA1="cb80a7786eb94a5f88081339cbca1f44be5d6ff1"
wget "https://cef-builds.spotifycdn.com/cef_binary_87.1.6%2Bg315d248%2Bchromium-87.0.4280.66_linux64.tar.bz2" -O cef_unverified.tar.bz2
SHA1="d683d27b42237b43004578db84d48d37c6ef4511"
elif [[ "$ARCH" =~ ^i[3-7]86$ ]]
then
wget "http://opensource.spotify.com/cefbuilds/cef_binary_84.4.1%2Bgfdc7504%2Bchromium-84.0.4147.105_linux32.tar.bz2" -O cef_unverified.tar.bz2
SHA1="a699923b00fb774f4018bad792b04d5b27ae9ce5"
wget "https://cef-builds.spotifycdn.com/cef_binary_87.1.6%2Bg315d248%2Bchromium-87.0.4280.66_linux32.tar.bz2" -O cef_unverified.tar.bz2
SHA1="1502c2cc41c144a70a0bd7c9b1a4347bfc48fd3a"
elif [ "$ARCH" == "armv7l" ]
then
wget "http://opensource.spotify.com/cefbuilds/cef_binary_84.4.1%2Bgfdc7504%2Bchromium-84.0.4147.105_linuxarm.tar.bz2" -O cef_unverified.tar.bz2
SHA1="727e67d246d5ec91fd417dfbbbd4b0d75976707a"
wget "https://cef-builds.spotifycdn.com/cef_binary_87.1.6%2Bg315d248%2Bchromium-87.0.4280.66_linuxarm.tar.bz2" -O cef_unverified.tar.bz2
SHA1="c5b5e1883cf9e56c7c391d0fcfd33edaff868856"
elif [ "$ARCH" == "aarch64" ]
then
wget "http://opensource.spotify.com/cefbuilds/cef_binary_84.4.1%2Bgfdc7504%2Bchromium-84.0.4147.105_linuxarm64.tar.bz2" -O cef_unverified.tar.bz2
SHA1="07bf5bcaea805af7809b3e05db243ad5879faae9"
wget "https://cef-builds.spotifycdn.com/cef_binary_87.1.6%2Bg315d248%2Bchromium-87.0.4280.66_linuxarm64.tar.bz2" -O cef_unverified.tar.bz2
SHA1="f4db8498f6d5799512277359ebae62b0f7930a52"
else
echo "Unsupported architecture"
exit 1
Expand Down
20 changes: 5 additions & 15 deletions src/browser_area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,21 +234,6 @@ class BrowserArea::RenderHandler : public CefRenderHandler {
}
}

virtual void OnCursorChange(
CefRefPtr<CefBrowser> browser,
CefCursorHandle cursorHandle,
CefRenderHandler::CursorType type,
const CefCursorInfo& customCursorInfo
) override {
REQUIRE_UI_THREAD();

int cursor = NormalCursor;
if(type == CT_HAND) cursor = HandCursor;
if(type == CT_IBEAM) cursor = TextCursor;

browserArea_->setCursor_(cursor);
}

private:
shared_ptr<BrowserArea> browserArea_;

Expand Down Expand Up @@ -321,6 +306,11 @@ void BrowserArea::clearError() {
}
}

void BrowserArea::setCursor(int cursor) {
REQUIRE_UI_THREAD();
setCursor_(cursor);
}

void BrowserArea::widgetViewportUpdated_() {
REQUIRE_UI_THREAD();

Expand Down
3 changes: 3 additions & 0 deletions src/browser_area.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ SHARED_ONLY_CLASS(BrowserArea);
void showError(string message);
void clearError();

// Notify the browser area that the browser has changed the cursor type.
void setCursor(int cursor);

private:
class RenderHandler;

Expand Down
2 changes: 1 addition & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <Poco/Net/HTTPServer.h>

const char* BrowserviceVersion = "0.9.1.1";
const char* BrowserviceVersion = "0.9.1.2";

namespace {

Expand Down
16 changes: 16 additions & 0 deletions src/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,22 @@ class Session::Client :
session_->updateSecurityStatus_();
}

virtual bool OnCursorChange(
CefRefPtr<CefBrowser> browser,
CefCursorHandle cursorHandle,
cef_cursor_type_t type,
const CefCursorInfo& customCursorInfo
) override {
REQUIRE_UI_THREAD();

int cursor = NormalCursor;
if(type == CT_HAND) cursor = HandCursor;
if(type == CT_IBEAM) cursor = TextCursor;

session_->rootWidget_->browserArea()->setCursor(cursor);
return true;
}

// CefRequestHandler:
virtual CefRefPtr<CefResourceRequestHandler> GetResourceRequestHandler(
CefRefPtr<CefBrowser> browser,
Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1>Browservice test procedure</h1>
<li>Click <a href="file.bin">this link</a>. A Download button should appear in the control bar. Press it. After this, your browser should get a native file download of a file with name "file.bin". Download it, and check that the size of the downloaded file is exactly 64 kilobytes (65536 bytes).
<li>Cycle through the full range of available qualities using the Quality selector in the control bar. The range should include numbers from 10 to 100 and PNG as the highest value. The page should be visible and somewhat legible on all quality values. On 16-bit versions of Internet Explorer that do not support PNG, the PNG option should be missing.
<li>Check that the YouTube video below starts playing when clicked, and that you can pause, seek and start playing again. While playing and mouse is moved outside the video, the video controls should disappear. Fullscreen mode does not need to work.<br>
<iframe width="560" height="315" src="https://www.youtube.com/embed/omLgv9lJ9jE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/oI6wJbMKjoQ" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</ul>
</body>
</html>

0 comments on commit b7ae8ee

Please sign in to comment.