Rendering application bar in RTL with Views framework

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Rendering application bar in RTL with Views framework

Postby dcg » Thu Oct 05, 2023 10:04 am

Hello, I am having an issue with the way my application's CEF window renders when Windows is set to an right-to-left (RTL) display language, such as Arabic. I would expect the entire application bar to be reversed (close/maximize/minimize on the left side), but it remains left-to-right.

I am using the Views framework to create the top-level window. CefSettings.locale and CefSettings.accept_language_list are both set to "ar" prior to calling CefInitialize. The main window is being created using CefBrowserView::CreateBrowserView and CefWindow::CreateTopLevelWindow.

Is there some additional setting I am missing to make this work correctly?
dcg
Newbie
 
Posts: 6
Joined: Tue Aug 10, 2021 11:03 am

Re: Rendering application bar in RTL with Views framework

Postby magreenblatt » Thu Oct 05, 2023 11:10 am

How do other applications behave on Windows with RTL configured? Do they show the window buttons in the top-left corner?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering application bar in RTL with Views framework

Postby magreenblatt » Thu Oct 05, 2023 11:12 am

Note that a difference in behavior is expected between RTL Windows installation and RTL language selection (e.g. the window buttons will likely only move with an RTL Windows installation).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering application bar in RTL with Views framework

Postby dcg » Tue Oct 10, 2023 4:00 pm

Thanks for the response, Marshall. Other applications render the window buttons on the left side, as I'd expect for an RTL language. This is originally a US English Windows installation, and I've changed the Windows display language to "Arabic (Saudi Arabia)".

I attached a picture that shows the behavior across four windows: Chromium, Notepad, and two examples of the latest download of the CEF sample app (with and without using the Views framework).
Attachments
cef_rtl.PNG
cef_rtl.PNG (55.42 KiB) Viewed 9770 times
dcg
Newbie
 
Posts: 6
Joined: Tue Aug 10, 2021 11:03 am

Re: Rendering application bar in RTL with Views framework

Postby magreenblatt » Tue Oct 10, 2023 5:48 pm

Can you also test "cefclient --enable-chrome-runtime"? Please add a new bug at https://github.com/chromiumembedded/cef/issues. Thanks.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering application bar in RTL with Views framework

Postby dcg » Thu Oct 12, 2023 8:51 am

Thanks, I created https://github.com/chromiumembedded/cef/issues/3583

Same issue seen with --enable-chrome-runtime (additional screenshot has been added to the bug)
dcg
Newbie
 
Posts: 6
Joined: Tue Aug 10, 2021 11:03 am

Re: Rendering application bar in RTL with Views framework

Postby magreenblatt » Thu Oct 12, 2023 8:57 am

Thanks :)
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering application bar in RTL with Views framework

Postby dcg » Wed Oct 18, 2023 9:47 am

Another update: I came across a flag in the Chromium codebase that allows forcing text direction -- https://chromium.googlesource.com/chrom ... rtl.cc#177

I tried this out with the CEF sample app. The application bar always remains in LTR, but interestingly the menu bar and the various controls (forward/back, address bar, etc) do respect the forced direction. See attached image for details.

cef_rtl_3.PNG
cef_rtl_3.PNG (46.37 KiB) Viewed 9700 times
dcg
Newbie
 
Posts: 6
Joined: Tue Aug 10, 2021 11:03 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 205 guests

cron