Use winrct instead of sizex/y as recommended by its docstring. The winrct accounts for UI scale, just like event->mval.