Skip to content

Commit

Permalink
fix: viewport always on top (#1848)
Browse files Browse the repository at this point in the history
* Fix for 1716

* Fix für 1795

* Fix for Issue 1848

Co-authored-by: mstuder <[email protected]>
  • Loading branch information
Mstpyt and mstuder authored Oct 22, 2022
1 parent 1798ae1 commit 8a822b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mvViewport_win32.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "mvWindowsSpecifics.h"


static BYTE gprevious_ime_char;
static WORD glang_id;

Expand Down Expand Up @@ -69,7 +70,7 @@ mvPrerender(mvViewport& viewport)
}

SetWindowLongPtr(viewportData->handle, GWL_STYLE, viewportData->modes);
SetWindowPos(viewportData->handle, viewport.alwaysOnTop ? HWND_TOPMOST : HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
SetWindowPos(viewportData->handle, viewport.alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
viewport.modesDirty = false;
}

Expand All @@ -88,6 +89,9 @@ mvPrerender(mvViewport& viewport)
if(GContext->IO.waitForInput)
::WaitMessage();

if (GContext->IO.waitForEventTimeout > 0)
::PostMessageW(NULL, NULL, 0, 0);

if (::PeekMessage(&viewportData->msg, nullptr, 0U, 0U, PM_REMOVE))
{
::TranslateMessage(&viewportData->msg);
Expand Down

0 comments on commit 8a822b4

Please sign in to comment.