Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.10.0, 5.15.7
-
AGL 5.0(EE) on R-Car M3
Description
Qt apps on AGL platform freeze when they are running in background and their visibility in IVI-Shell is set to false. They can not receive any notification from D-Bus or WebSockets until visibility is set to true.
How to reproduce?
- Build AGL platform for R-Car M3 Starter Kit
- Build the example app attached
- Install the app
- Run the app
- Run another app to hide the app
- check journal log to see if the timer in the app is running or not
How Qt reads wayland events today?
// http://code.qt.io/cgit/qt/qtwayland.git/tree/src/client/qwaylanddisplay.cpp#n184 void QWaylandDisplay::flushRequests() { if (wl_display_prepare_read(mDisplay) == 0) { wl_display_read_events(mDisplay); // <- this doesn't return } if (wl_display_dispatch_pending(mDisplay) < 0) { checkError(); exitWithError(); } wl_display_flush(mDisplay); }
wl_display_read_events sometimes doesn't return because someone in the same process is doing something with wayland in other thread(i.e. drawing contents in rendering thread with EGL whose driver also does something with wayland).
How it should be?
wl_display_prepare_read_queue - Prepare to read events from the display's file descriptor to a queue. says that to be thread safe, the code will be something like this.
while (wl_display_prepare_read_queue(display, queue) != 0) wl_display_dispatch_queue_pending(display, queue); wl_display_flush(display); ret = poll(fds, nfds, -1); if (has_error(ret)) wl_display_cancel_read(display); else wl_display_read_events(display); wl_display_dispatch_queue_pending(display, queue);
IIRC, current QPA architecture doesn't allow to run code right before poll(2), so some trick may be needed.
Attachments
Issue Links
- relates to
-
QTBUG-66997 Application terminates when mouse is moved over busy (blocked) GUI
- Closed
-
QTBUG-69077 Qt Wayland blocks in frame callback
- Closed