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;
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;
}