the back key: one C++ path, so a dialog closes too
A phone's back key did not close the settings dialog. A window-level QML Shortcut never sees the key while a modal popup is up, and a desktop run says so plainly: with the dialog open, Back left backLayer() at "settings", while invokeMethod(win, "stepBack") closed it on the spot and Escape -- the popup's own CloseOnEscape -- closed it too. So the key reaches the popup and never reaches the shortcut map, which is why the drawer (no popup) closed fine and hid the problem on a phone. A Keys handler on the window's root item is no help either: nothing reached it, the focused TextField keeps the key. So the key is read in C++, on the application object but only for this window's events -- a filter installed on the window itself was never called once, while the same key closed the drawer through the shortcut, hence the application object. With a layer open, the window's own backLayer() names it and stepBack() closes it, press and release both taken; with nothing open the key is passed on untouched, which is what leaves the window on a phone and does nothing on a desktop. Main.qml keeps only those two functions: the Shortcut and backHasLayer are gone, --uitest installs the same handler main() does, and the back checks now drive the code the phone runs instead of a shortcut only the test had. The last check asks the phone's own question and can end the run without the closing line -- the activity leaving takes the process with it, and every line is flushed as it is written. Desktop: 106 ok, 0 FAIL. Phone: 104 ok, 0 FAIL (two clipboard checks are skipped on Android), and "after the last back: window visible 0".
This commit is contained in:
@@ -106,6 +106,7 @@ if(CST_APP_GUI)
|
||||
src/ui/UiTest.cpp
|
||||
src/ui/ThemeIcons.cpp
|
||||
src/ui/SessionImages.cpp
|
||||
src/ui/BackKey.cpp
|
||||
${CST_APP_PLATFORM_SRC})
|
||||
target_include_directories(cst-agent-app PRIVATE
|
||||
src "${CMAKE_CURRENT_SOURCE_DIR}/../include")
|
||||
|
||||
Reference in New Issue
Block a user