X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6655c15632371f272d9d1536ef0e5558e1437c27..dde4740fe1dddbb2738a0afd054f493cb0dd67d1:/src/unix/utilsx11.cpp diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index 1f62bea9e9..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,8 +766,11 @@ 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 = wxApp::GetDisplay(); + Display *pDisplay = (Display*) wxApp::GetDisplay(); #elif defined(__WXGTK__) Display *pDisplay = GDK_DISPLAY(); #elif defined(__WXMOTIF__)