diff --git a/src/Draw/Draw_BasicCommands.cxx b/src/Draw/Draw_BasicCommands.cxx index 0f8dd40da0..d8d0bb0c69 100644 --- a/src/Draw/Draw_BasicCommands.cxx +++ b/src/Draw/Draw_BasicCommands.cxx @@ -636,15 +636,21 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const rlimit rlp; rlp.rlim_max = RLIM_INFINITY; if (n <= 1) + { rlp.rlim_cur = RLIM_INFINITY; + } else + { rlp.rlim_cur = GetCpuLimit (a[1]); - CPU_LIMIT = rlp.rlim_cur; + } - int status; - status=setrlimit(RLIMIT_CPU,&rlp); - if (status !=0) - di << "status cpulimit setrlimit : " << status << "\n"; + CPU_LIMIT = (clock_t )rlp.rlim_cur; + + int aStatus = setrlimit (RLIMIT_CPU, &rlp); + if (aStatus != 0) + { + di << "status cpulimit setrlimit : " << aStatus << "\n"; + } // set signal handler to print a message before death struct sigaction act, oact; diff --git a/src/Wasm/Wasm_Window.cxx b/src/Wasm/Wasm_Window.cxx index 985333b634..71e44783d7 100644 --- a/src/Wasm/Wasm_Window.cxx +++ b/src/Wasm/Wasm_Window.cxx @@ -276,14 +276,19 @@ bool Wasm_Window::ProcessMouseEvent (Aspect_WindowInputListener& theListener, if (theEvent->metaKey == EM_TRUE) { aFlags |= Aspect_VKeyFlags_META; } const bool isEmulated = false; - const Aspect_VKeyMouse aButtons = Wasm_Window::MouseButtonsFromNative (theEvent->buttons); + const Aspect_VKeyMouse aButtonsOld = theListener.PressedMouseButtons(); + Aspect_VKeyMouse aButtons = Wasm_Window::MouseButtonsFromNative (theEvent->buttons); + if (theEventType != EMSCRIPTEN_EVENT_MOUSEDOWN) + { + aButtons &= aButtonsOld; // filter out unexpected buttons + } switch (theEventType) { case EMSCRIPTEN_EVENT_MOUSEMOVE: { if ((aNewPos2i.x() < 0 || aNewPos2i.x() > mySize.x() || aNewPos2i.y() < 0 || aNewPos2i.y() > mySize.y()) - && theListener.PressedMouseButtons() == Aspect_VKeyMouse_NONE) + && aButtonsOld == Aspect_VKeyMouse_NONE) { return false; }