Bad result from GetAllDisplays after display disconnect

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.

Bad result from GetAllDisplays after display disconnect

Postby natonicfp » Mon May 02, 2022 11:46 pm

I tried to start using CefDisplay::GetAllDisplays recently to detect the current monitor layout on the RHEL8.4 machine where my app is running. The list of displays appears correct immediately after application launch, but after one of my external displays (a 4k display) is disconnected, a new call to GetAllDisplays (with a new empty vector to hold the result) still reports the disconnected display. Even more strangely, when the display is reconnected, GetAllDisplays starts reporting three displays where the reconnected display is reported in the list twice. Subsequent disconnects/reconnects do not make the problem worse, but they do not resolve the phantom display entry being returned.

I added a call to GetDisplayCount and found that it too is reporting an incorrect number of displays consistent with the number returned by GetAllDisplays.

I was able to duplicate this problem by starting a thread at the end of SimpleHandler::OnAfterCreated that periodically posts a task to the UI thread which calls GetAllDisplays (or GetDisplayCount) and logs the result. Same strange behavior.

I'm currently running CEF 4896. Duplicated this issue on two different RHEL8.4 laptops.
natonicfp
Techie
 
Posts: 20
Joined: Mon Mar 22, 2021 4:16 pm

Re: Bad result from GetAllDisplays after display disconnect

Postby natonicfp » Mon May 16, 2022 5:26 pm

I am following up on this issue since I've had a chance to investigate further. I used the code in this SO answer as a basis for bypassing the GetAllDisplays code: https://stackoverflow.com/a/64494888. While this largely solved my problem, I did run into some strange behavior when identifying the primary display. I realized after further testing that I was only experiencing these problems (with my X11 code as well as when using CefDisplay::GetAllDisplays) on systems where Wayland was enabled. I disabled Wayland and the problem no longer occurs.

Using Wayland is not critical for my application right now, but I had thought CEF now supported Wayland. Not sure if this particular problem is CEF-specific or is a Views problem in Chromium itself, but I imagine at some point I'd need to support Wayland.
natonicfp
Techie
 
Posts: 20
Joined: Mon Mar 22, 2021 4:16 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 53 guests