Skip to content

Commit

Permalink
Disable hardware acceleration unconditionally
Browse files Browse the repository at this point in the history
Riot works just fine without it, and the application will work better
for people using binary drivers (i.e. NVidia) with Flatpak builds. As
a side effect, the memory consumption is slightly lower.

Tested both with WebKitGTK+ 2.14.5 and 2.15.92

Fixes #29
  • Loading branch information
aperezdc committed Mar 17, 2017
1 parent 10d7644 commit be236e1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions revolt/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ def __init__(self, application, saved_state):
websettings.set_javascript_can_access_clipboard(True)
websettings.set_minimum_font_size(12) # TODO: Make it a setting
websettings.set_property("enable-mediasource", True)

# This makes Revolt lighter, and makes things work for people using
# binary drivers (i.e. NVidia) with Flatpak build. See issue #29.
if hasattr(websettings, "set_hardware_acceleration_policy"):
websettings.set_hardware_acceleration_policy(WebKit2.HardwareAccelerationPolicy.NEVER)
else:
import os
os.environ["WEBKIT_DISABLE_COMPOSITING_MODE"] = "1"

self._webview.show_all()
self.add(self._webview)
self.__connect_widgets()
Expand Down

0 comments on commit be236e1

Please sign in to comment.