From 8b5be08a09b190d97df6b8938d4e56bf6284a263 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 13 Sep 2002 13:12:46 +0000 Subject: [PATCH] Applied patch [ 608850 ] wxX11 menu accelerators need toupper Olly Betts Letter menu accelerators (with and probably without modifiers) don't work unless you have capslock on. Adding a call to toupper() to the appropriate spot fixes this (wxGtk does toupper in this case already). Applied patch [ 608530 ] wxX11 doesn't set argv[argc] to NULL Olly Betts The code which creates argv under wxX11 doesn't add a terminating element with value NULL - user code which expects this (it's true for C/C++ argv) will fail. Here's a patch to correct this. I've checked the other versions of app.cpp and they all get this right. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/x11/app.cpp | 5 +++-- src/x11/window.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/x11/app.cpp b/src/x11/app.cpp index b42979accb..74fb19c9af 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -204,7 +204,7 @@ int wxEntryStart( int& argc, char *argv[] ) // We can't use wxCmdLineParser or OnInitCmdLine and friends because // we have to create the Display earlier. If we can find a way to // use the wxAppBase API then I'll be quite happy to change it. - g_newArgv = new wxChar*[argc]; + g_newArgv = new wxChar*[argc + 1]; g_newArgc = 0; int i; for (i = 0; i < argc; i++) @@ -253,7 +253,8 @@ int wxEntryStart( int& argc, char *argv[] ) g_newArgv[g_newArgc] = argv[i]; g_newArgc ++; } - + g_newArgv[g_newArgc] = NULL; + Display* xdisplay = NULL; if (displayName.IsEmpty()) xdisplay = XOpenDisplay(NULL); diff --git a/src/x11/window.cpp b/src/x11/window.cpp index ad5607f4d2..1df4868f14 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -1480,7 +1480,7 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win wxevent.m_altDown = XKeyEventAltIsDown(xevent); wxevent.m_metaDown = XKeyEventMetaIsDown(xevent); wxevent.SetEventObject(win); - wxevent.m_keyCode = id; + wxevent.m_keyCode = toupper(id); wxevent.SetTimestamp(XKeyEventGetTime(xevent)); wxevent.m_x = XKeyEventGetX(xevent); -- 2.45.2