ohos: reset refused sub window maximize state


QWindow::setWindowStates() stores the requested state after passing
it to the platform window, whether or not the platform acts on it. So
when the plugin refuses showMaximized() or showFullScreen() on a sub
window, Qt reports a maximized or full screen window while the system
keeps it floating.

This breaks later calls. showMaximized() does nothing because Qt
thinks the window is maximized already, and showNormal() calls
window.recover() on a floating window, which fails with "Repeated
operation".

When the plugin refuses the request, drop the maximized and full
screen flags and report the state back to Qt, with the refused state
as the old one. The report is asynchronous, so it arrives after
QWindow has stored the requested state, and windowStateChanged() is
emitted twice, with the requested state and then with the real one.

Task-number: QTBUG-151677
Change-Id: I528aaa896b39fc32bb3dcc0ccfb918710a202345
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
commit78d3f16824158fe503ab7805c2effb28e6f67517
parentbdf35b93c9098c57a9af39624e4e34310da09cab
authorShawn Luo <shaohua.luo@qt.io>
committerZbigniew Chyla <zbigniew.chyla@qt.io>
commit timeTue, 20 Oct 2026 10:41:23 +0000