Bugzilla – Attachment 179264 Details for
Bug 148258
Allow customization of Alt+<key> on gtk3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated patch
bug-148258-take2.patch.txt (text/plain), 7.53 KB, created by
Vince
on 2022-04-02 03:07:17 UTC
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Vince
Created:
2022-04-02 03:07:17 UTC
Size:
7.53 KB
patch
obsolete
>diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx >index feaacb1bdfea..2f53ca293d27 100644 >--- a/sw/source/uibase/docvw/edtwin.cxx >+++ b/sw/source/uibase/docvw/edtwin.cxx >@@ -151,6 +151,11 @@ > #include <txtfrm.hxx> > #include <strings.hrc> > >+#include <bitset> >+ >+#define SW_KEY_TRACE >+#define KEY_TRACE_MSG_PREFIX "Writer:Keyboard: edtwin.cxx: KeyInput: " >+ > using namespace sw::mark; > using namespace ::com::sun::star; > >@@ -1636,6 +1641,15 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) > case SwKeyState::CheckKey: > eKeyState = SwKeyState::KeyToView; // default forward to View > >+ #ifdef SW_KEY_TRACE >+ if ( getenv("SW_KEY_TRACE") ) >+ std::cerr << std::endl << KEY_TRACE_MSG_PREFIX >+ << " [ Keycode=" << rKEvt.GetKeyCode().GetCode() >+ << " Shifted=" << std::bitset<4>(rKEvt.GetKeyCode().GetModifier()>>12) >+ << " Charcode=" << aCh << " ]" >+ << std::endl ; >+ #endif >+ > if (!comphelper::LibreOfficeKit::isActive() && > !rKeyCode.IsMod2() && '=' == aCh && > !rSh.IsTableMode() && rSh.GetTableFormat() && >@@ -1743,6 +1757,28 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) > goto KEYINPUT_CHECKTABLE; > > KEYINPUT_CHECKTABLE: >+ // Resolve bugs 49091, 53190, 93402 and >+ // https://bz.apache.org/ooo/show_bug.cgi?id=113502 >+ // but provide an option for restoring interactive >+ // table sizing functionality when needed. >+ if ( >+ ! (Window::GetIndicatorState() & KeyIndicatorState::CAPSLOCK) >+ && m_rView.KeyInput( aKeyEvent ) >+ ) >+ { >+ if ( getenv("SW_KEY_TRACE") ) >+ std::cerr << KEY_TRACE_MSG_PREFIX >+ << "CheckKey: Table sizing function overridden by keyboard customization" >+ << " [ Keycode=" << rKEvt.GetKeyCode().GetCode() >+ << " Shifted=" << std::bitset<4>(rKEvt.GetKeyCode().GetModifier()>>12) >+ << " ]" >+ << std::endl; >+ bFlushBuffer = true; >+ bNormalChar = false; >+ eKeyState = SwKeyState::End; >+ break ; >+ } >+ > if( rSh.IsTableMode() || !rSh.GetTableFormat() ) > { > if(!pFlyFormat && SwKeyState::KeyToView != eFlyState && >@@ -2197,8 +2233,15 @@ KEYINPUT_CHECKTABLE_INSDEL: > } > break; > } >+ #ifdef SW_KEY_TRACE >+ if ( getenv("SW_KEY_TRACE") && ( eKeyState != SwKeyState::KeyToView ) ) >+ std::cerr << KEY_TRACE_MSG_PREFIX >+ << "CheckKey: Key processed internally" >+ << std::endl; >+ #endif > } > break; >+ > case SwKeyState::CheckDocReadOnlyKeys: > { > eKeyState = SwKeyState::KeyToView; >@@ -2273,6 +2316,7 @@ KEYINPUT_CHECKTABLE_INSDEL: > > case SwKeyState::KeyToView: > { >+ > eKeyState = SwKeyState::End; > bNormalChar = > !rKeyCode.IsMod2() && >@@ -2298,6 +2342,12 @@ KEYINPUT_CHECKTABLE_INSDEL: > } > else if( m_rView.KeyInput( aKeyEvent ) ) > { >+ #ifdef SW_KEY_TRACE >+ if ( getenv("SW_KEY_TRACE") ) >+ std::cerr << KEY_TRACE_MSG_PREFIX >+ << "KeyToView: Keyboard customization function triggered" >+ << std::endl; >+ #endif > bFlushBuffer = true; > bNormalChar = false; > } >@@ -2311,6 +2361,12 @@ KEYINPUT_CHECKTABLE_INSDEL: > > if( !bIsDocReadOnly && bNormalChar ) > { >+ #ifdef SW_KEY_TRACE >+ if ( getenv("SW_KEY_TRACE") ) >+ std::cerr << KEY_TRACE_MSG_PREFIX >+ << "KeyToView: Normal character key processed internally" >+ << std::endl; >+ #endif > const SelectionType nSelectionType = rSh.GetSelectionType(); > const bool bDrawObject = (nSelectionType & SelectionType::DrawObject) && > !(nSelectionType & SelectionType::DrawObjectEditMode) && >@@ -2345,12 +2401,19 @@ KEYINPUT_CHECKTABLE_INSDEL: > } > else > { >+ #ifdef SW_KEY_TRACE >+ if ( getenv("SW_KEY_TRACE") ) >+ std::cerr << KEY_TRACE_MSG_PREFIX >+ << "KeyToView: Key passed to window" >+ << std::endl; >+ #endif > bNormalChar = false; > Window::KeyInput( aKeyEvent ); > } > } > } > break; >+ > case SwKeyState::LaunchOLEObject: > { > rSh.LaunchOLEObj(); >@@ -2400,6 +2463,7 @@ KEYINPUT_CHECKTABLE_INSDEL: > } > aCh = '\t'; > [[fallthrough]]; >+ > case SwKeyState::InsChar: > if (rSh.GetChar(false)==CH_TXT_ATR_FORMELEMENT) > { >diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx >index 29d6c00f78d7..ec8435864888 100644 >--- a/vcl/unx/gtk3/gtkframe.cxx >+++ b/vcl/unx/gtk3/gtkframe.cxx >@@ -3899,12 +3899,6 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe > > if (GTK_IS_WINDOW(pThis->m_pWindow)) > { >- // tdf#144846 If this is registered as a menubar mnemonic then ensure >- // that any other widget won't be considered as a candidate by taking >- // over the task of launch the menubar menu outself >- if (pThis->HandleMenubarMnemonic(pEvent->state, pEvent->keyval)) >- return true; >- > GtkWidget* pFocusWindow = gtk_window_get_focus(GTK_WINDOW(pThis->m_pWindow)); > bFocusInAnotherGtkWidget = pFocusWindow && pFocusWindow != GTK_WIDGET(pThis->m_pFixedContainer); > if (bFocusInAnotherGtkWidget) >@@ -4056,6 +4050,22 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe > sal_Unicode(gdk_keyval_to_unicode( pEvent->keyval )), > (pEvent->type == GDK_KEY_PRESS), > false); >+ >+ // tdf#144846 If this is registered as a menubar mnemonic then ensure >+ // that any other widget won't be considered as a candidate by taking >+ // over the task of launch the menubar menu outself >+ // The code was moved here from its original position at beginning >+ // of this function in order to resolve bug # 146174. >+ if ( >+ ! bStopProcessingKey && >+ GTK_IS_WINDOW(pThis->m_pWindow) && >+ pEvent->type == GDK_KEY_PRESS && >+ pThis->HandleMenubarMnemonic(pEvent->state, pEvent->keyval) >+ ) { >+ std::cerr<<"Avoiding mnemonics collision "<<std::endl; >+ return true; >+ } >+ > if (!aDel.isDeleted()) > { > pThis->m_nKeyModifiers = ModKeyFlags::NONE;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 148258
:
179196
|
179197
| 179264