summaryrefslogtreecommitdiff
path: root/mozilla-1468670.patch
diff options
context:
space:
mode:
authorOndrej Zoder <ozoder@redhat.com>2018-07-17 08:56:42 +0200
committerOndrej Zoder <ozoder@redhat.com>2018-07-17 08:56:42 +0200
commite963c8683d45c7702621537ebf76ced87f5219fd (patch)
treea72e6dc6a6957996577a4bf717158708c0fafc55 /mozilla-1468670.patch
parentMerge branch 'master' into f27 (diff)
downloadlibrewolf-fedora-ff-e963c8683d45c7702621537ebf76ced87f5219fd.tar.gz
librewolf-fedora-ff-e963c8683d45c7702621537ebf76ced87f5219fd.tar.bz2
librewolf-fedora-ff-e963c8683d45c7702621537ebf76ced87f5219fd.zip
Added wayland patches
Diffstat (limited to 'mozilla-1468670.patch')
-rw-r--r--mozilla-1468670.patch102
1 files changed, 102 insertions, 0 deletions
diff --git a/mozilla-1468670.patch b/mozilla-1468670.patch
new file mode 100644
index 0000000..42a05e2
--- /dev/null
+++ b/mozilla-1468670.patch
@@ -0,0 +1,102 @@
+diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h
+--- a/widget/gtk/nsGtkKeyUtils.h
++++ b/widget/gtk/nsGtkKeyUtils.h
+@@ -169,17 +169,20 @@ protected:
+
+ bool mInitialized;
+
+ /**
+ * Initializing methods.
+ */
+ void Init();
+ void InitXKBExtension();
+- void InitBySystemSettings();
++ void InitBySystemSettingsX11();
++#ifdef MOZ_WAYLAND
++ void InitBySystemSettingsWayland();
++#endif
+
+ /**
+ * mModifierKeys stores each hardware key information.
+ */
+ struct ModifierKey {
+ guint mHardwareKeycode;
+ guint mMask;
+
+
+diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp
+--- a/widget/gtk/nsGtkKeyUtils.cpp
++++ b/widget/gtk/nsGtkKeyUtils.cpp
+@@ -190,17 +190,21 @@ KeymapWrapper::Init()
+ MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
+ ("%p Init, mGdkKeymap=%p",
+ this, mGdkKeymap));
+
+ mModifierKeys.Clear();
+ memset(mModifierMasks, 0, sizeof(mModifierMasks));
+
+ if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
+- InitBySystemSettings();
++ InitBySystemSettingsX11();
++#ifdef MOZ_WAYLAND
++ else
++ InitBySystemSettingsWayland();
++#endif
+
+ gdk_window_add_filter(nullptr, FilterEvents, this);
+
+ MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
+ ("%p Init, CapsLock=0x%X, NumLock=0x%X, "
+ "ScrollLock=0x%X, Level3=0x%X, Level5=0x%X, "
+ "Shift=0x%X, Ctrl=0x%X, Alt=0x%X, Meta=0x%X, Super=0x%X, Hyper=0x%X",
+ this,
+@@ -270,20 +274,20 @@ KeymapWrapper::InitXKBExtension()
+ return;
+ }
+
+ MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
+ ("%p InitXKBExtension, Succeeded", this));
+ }
+
+ void
+-KeymapWrapper::InitBySystemSettings()
++KeymapWrapper::InitBySystemSettingsX11()
+ {
+ MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
+- ("%p InitBySystemSettings, mGdkKeymap=%p",
++ ("%p InitBySystemSettingsX11, mGdkKeymap=%p",
+ this, mGdkKeymap));
+
+ Display* display =
+ gdk_x11_display_get_xdisplay(gdk_display_get_default());
+
+ int min_keycode = 0;
+ int max_keycode = 0;
+ XDisplayKeycodes(display, &min_keycode, &max_keycode);
+@@ -434,16 +438,26 @@ KeymapWrapper::InitBySystemSettings()
+ }
+ }
+ }
+
+ XFreeModifiermap(xmodmap);
+ XFree(xkeymap);
+ }
+
++#ifdef MOZ_WAYLAND
++void
++KeymapWrapper::InitBySystemSettingsWayland()
++{
++ // Not implemented yet, but at least Alt modifier should be handled to save
++ // popular usage.
++ mModifierMasks[INDEX_ALT] = 1 << 3;
++}
++#endif
++
+ KeymapWrapper::~KeymapWrapper()
+ {
+ gdk_window_remove_filter(nullptr, FilterEvents, this);
+ g_signal_handlers_disconnect_by_func(mGdkKeymap,
+ FuncToGpointer(OnKeysChanged), this);
+ g_signal_handlers_disconnect_by_func(mGdkKeymap,
+ FuncToGpointer(OnDirectionChanged), this);
+ g_object_unref(mGdkKeymap);
bgstack15