Skip to content

Commit

Permalink
Nit: fix showWindow (#10003)
Browse files Browse the repository at this point in the history
* Nit: fix showWindow

* format
  • Loading branch information
strseb authored Dec 10, 2024
1 parent c32ad33 commit 144b314
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/qmlengineholder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,22 @@ bool QmlEngineHolder::hasWindow() const {
void QmlEngineHolder::showWindow() {
QWindow* w = window();
Q_ASSERT(w);
if (!w) {
return;
}

w->show();
w->raise();

w->requestActivate();
#ifdef MZ_WINDOWS
auto const windowHandle = (HWND)w->winId();
SetWindowPos(windowHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
SetForegroundWindow(windowHandle);
SetWindowPos(windowHandle, HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE);
#else
w->raise();
#endif
}

void QmlEngineHolder::hideWindow() {
Expand Down

0 comments on commit 144b314

Please sign in to comment.