Skip to content

Instantly share code, notes, and snippets.

@jhakonen
jhakonen / touch-events.patch
Created August 18, 2020 19:26
Added touch event handling for viewer element + logging
diff --git a/src/assets/epub-viewer.js b/src/assets/epub-viewer.js
index 90ec9fb..dd1a944 100644
--- a/src/assets/epub-viewer.js
+++ b/src/assets/epub-viewer.js
@@ -565,20 +565,45 @@ const setupRendition = () => {
type: 'selection',
payload: {
position: getRect(range, frame),
text: selection.toString(),
cfi: new ePub.CFI(range, contents.cfiBase).toString(),
@jhakonen
jhakonen / extension.js.patch
Created June 22, 2019 12:16
Debug logging for "Put Windows" gnome extension
diff --git a/extension.js b/extension.js
index 485e604..f500894 100644
--- a/extension.js
+++ b/extension.js
@@ -481,58 +481,60 @@ MoveWindow.prototype = {
// no special handling for first time move
if (ignoreCornerSettings || !this._utils.changeCornerFirstTime()) {
// window was moved to an other corner
if ((!keepHeight && !keepWidth) && (!sameWidth || !sameHeight)) {
@jhakonen
jhakonen / fix-zim-84-non-normalize-casefold.patch
Created April 6, 2019 09:57
Possible fixes for zim issue #84
diff --git a/zim/gui/widgets.py b/zim/gui/widgets.py
index 1c81e538..4d36cbd2 100644
--- a/zim/gui/widgets.py
+++ b/zim/gui/widgets.py
@@ -1664,6 +1664,8 @@ def gtk_entry_completion_match_func(completion, key, iter, column):
model = completion.get_model()
text = model.get_value(iter, column)
+ # Use non-normalized and non-casefolded key instead for comparison
+ key = completion.get_entry().get_text().lower()