X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1295f134eda53ba87445e227472d6813c924e313..5e60a12a069e1e7e8213d41c8d3243e7d3b0913e:/src/common/popupcmn.cpp?ds=sidebyside diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index 8fc32bcc50..57ba86c0a0 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -151,7 +151,18 @@ void wxPopupWindowBase::Position(const wxPoint& ptOrigin, } // now check left/right too - wxCoord x = ptOrigin.x + size.x; + wxCoord x = ptOrigin.x; + + if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) + { + // shift the window to the left instead of the right. + x -= size.x; + x -= sizeSelf.x; // also shift it by window width. + } + else + x += size.x; + + if ( x + sizeSelf.x > sizeScreen.x ) { // check if there is enough space to the left