X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1751226cbf1cbdc37114de04eac5bcd9bf0c8d09..8add533eb22ba0756f5b426f77ee593bc1aa6fcd:/src/unix/utilsx11.cpp?ds=sidebyside diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index 8d400126c6..ec9e3cb1f6 100644 --- a/src/unix/utilsx11.cpp +++ b/src/unix/utilsx11.cpp @@ -65,12 +65,15 @@ static bool IsMapped(Display *display, Window window) // Suspends X11 errors. Used when we expect errors but they are not fatal // for us. +extern "C" { + static int wxX11ErrorsSuspender_handler(Display*, XErrorEvent*) { return 0; } +} class wxX11ErrorsSuspender { public: wxX11ErrorsSuspender(Display *d) : m_display(d) { - m_old = XSetErrorHandler(handler); + m_old = XSetErrorHandler(wxX11ErrorsSuspender_handler); } ~wxX11ErrorsSuspender() { @@ -81,7 +84,6 @@ public: private: Display *m_display; int (*m_old)(Display*, XErrorEvent *); - static int handler(Display *, XErrorEvent *) { return 0; } }; @@ -764,6 +766,9 @@ KeySym wxCharCodeWXToX(int id) bool wxGetKeyState(wxKeyCode key) { + wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key != + WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons")); + #if defined(__WXX11__) Display *pDisplay = (Display*) wxApp::GetDisplay(); #elif defined(__WXGTK__)