X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1295f134eda53ba87445e227472d6813c924e313..855f31ebe72bef834a32df2c274b41fb282ad265:/src/common/popupcmn.cpp 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