windisplay: Fix recursive loop in adjust_z_order
Cherry-pick of 639497310e with alteration
to preserve ABI (replacing an unused bool field)
This commit is contained in:
parent
c8c5ae829d
commit
d020b25afe
|
|
@ -1308,6 +1308,11 @@ adjust_z_order() {
|
|||
void WinGraphicsWindow::
|
||||
adjust_z_order(WindowProperties::ZOrder last_z_order,
|
||||
WindowProperties::ZOrder this_z_order) {
|
||||
// Prevent calling this recursively.
|
||||
if (_in_adjust_z_order) {
|
||||
return;
|
||||
}
|
||||
|
||||
HWND order;
|
||||
bool do_change = false;
|
||||
|
||||
|
|
@ -1337,8 +1342,10 @@ adjust_z_order(WindowProperties::ZOrder last_z_order,
|
|||
break;
|
||||
}
|
||||
if (do_change) {
|
||||
_in_adjust_z_order = true;
|
||||
BOOL result = SetWindowPos(_hWnd, order, 0,0,0,0,
|
||||
SWP_NOMOVE | SWP_NOSENDCHANGING | SWP_NOSIZE);
|
||||
_in_adjust_z_order = false;
|
||||
if (!result) {
|
||||
windisplay_cat.warning()
|
||||
<< "SetWindowPos failed.\n";
|
||||
|
|
@ -1630,7 +1637,9 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
|||
if (_hWnd != nullptr) {
|
||||
handle_reshape();
|
||||
}
|
||||
adjust_z_order();
|
||||
if (!_in_adjust_z_order) {
|
||||
adjust_z_order();
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_PAINT:
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ private:
|
|||
bool _ime_open;
|
||||
bool _ime_active;
|
||||
bool _tracking_mouse_leaving;
|
||||
bool _bCursor_in_WindowClientArea;
|
||||
bool _in_adjust_z_order = false;
|
||||
HANDLE _input_device_handle[32];
|
||||
HCURSOR _cursor;
|
||||
DEVMODE _fullscreen_display_mode;
|
||||
|
|
|
|||
Loading…
Reference in New Issue