sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 2 vcl/unx/gtk3/gtk3gtkinst.cxx | 29 ++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-)
New commits: commit faa2e7b7227b6b87379e7e136ea9ab63f37c3fc4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Feb 19 12:35:56 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Feb 19 15:03:54 2020 +0100 Resolves: tdf#130400 reserve ctrl+page_up and ctrl+page_down for notebooks Change-Id: I627298cb844967eeb1e166720e3951be732a4dc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89016 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index bdfe4fe1ced0..fe3cd37ba8af 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -12797,6 +12797,9 @@ private: bool signal_key_press(GdkEventKey* pEvent) { + if (pEvent->state) // only with no modifiers held + return false; + if (pEvent->keyval == GDK_KEY_KP_Up || pEvent->keyval == GDK_KEY_Up || pEvent->keyval == GDK_KEY_KP_Page_Up || pEvent->keyval == GDK_KEY_Page_Up || pEvent->keyval == GDK_KEY_KP_Down || pEvent->keyval == GDK_KEY_Down || pEvent->keyval == GDK_KEY_KP_Page_Down || pEvent->keyval == GDK_KEY_Page_Down) { @@ -13126,6 +13129,31 @@ void ensure_intercept_drawing_area_accessibility() } } +void ensure_disable_ctrl_page_up_down(GType eType) +{ + gpointer pClass = g_type_class_ref(eType); + GtkWidgetClass* pWidgetClass = GTK_WIDGET_CLASS(pClass); + GtkBindingSet* pBindingSet = gtk_binding_set_by_class(pWidgetClass); + gtk_binding_entry_remove(pBindingSet, GDK_KEY_Page_Up, GDK_CONTROL_MASK); + gtk_binding_entry_remove(pBindingSet, GDK_KEY_Page_Up, static_cast<GdkModifierType>(GDK_SHIFT_MASK|GDK_CONTROL_MASK)); + gtk_binding_entry_remove(pBindingSet, GDK_KEY_Page_Down, GDK_CONTROL_MASK); + gtk_binding_entry_remove(pBindingSet, GDK_KEY_Page_Down, static_cast<GdkModifierType>(GDK_SHIFT_MASK|GDK_CONTROL_MASK)); + g_type_class_unref(pClass); +} + +// tdf#130400 disable ctrl+page_up and ctrl+page_down bindings so the +// keystrokes are consumed by the surrounding notebook bindings instead +void ensure_disable_ctrl_page_up_down_bindings() +{ + static bool bDone; + if (!bDone) + { + ensure_disable_ctrl_page_up_down(GTK_TYPE_TREE_VIEW); + ensure_disable_ctrl_page_up_down(GTK_TYPE_SPIN_BUTTON); + bDone = true; + } +} + class GtkInstanceBuilder : public weld::Builder { private: @@ -13333,6 +13361,7 @@ public: , m_xInterimGlue(pInterimGlue) { ensure_intercept_drawing_area_accessibility(); + ensure_disable_ctrl_page_up_down_bindings(); sal_Int32 nIdx = m_sHelpRoot.lastIndexOf('.'); if (nIdx != -1) commit 035a5a419b92bf00973d67755d32126c6a36d6fa Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Feb 19 11:46:50 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Feb 19 15:03:35 2020 +0100 Resolves: tdf#129446 explicitly pass the mouse event window instead of letting it pick the main-window as the event window Change-Id: I953968025717ac5ba6f41e8f2db90c9f4d24800f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89015 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 2c216f8806b3..638b405bdd09 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -363,7 +363,7 @@ bool SlideSorterController::Command ( if (!rEvent.IsMouseEvent()) pDispatcher->ExecutePopup(aPopupId, pWindow, &aMenuLocation); else - pDispatcher->ExecutePopup(aPopupId); + pDispatcher->ExecutePopup(aPopupId, pWindow); mbContextMenuOpen = false; mrSlideSorter.GetView().UpdatePageUnderMouse(); ::rtl::Reference<SelectionFunction> pFunction(GetCurrentSelectionFunction()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits