This is an early draft of an implementation of key auto-repeat in wineserver to get some feedback. Some open questions:
1. queue_keyboard_message requires a `current` thread, but we don't get one in timeout callbacks. At the moment I am manually setting `current` to the foreground thread, but I am wondering if that's acceptable or we should explore other ways forward (also see TODO in code).
2. This draft introduces a new server request to configure auto-repeat (`enable/delay/period`). I am thinking that for more straightforward integration with the keyboard repeat SPI parameters, the request should only support the `enable` flag and the server should query the SPI registry values to get `delay` and `period` when needed. I am wondering if there any caveats here since I don't see other code in the server querying registry values (well, except to implement the registry requests themselves).
Also, I would hope that opening and caching the `HKCU\Control Panel\Keyboard` hkey would remove most of the cost of performing this operation (if that's even a concern at all).
--
v5: win32u: Implement keyboard auto-repeat using new server request.
server: Implement key auto-repeat request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5741
This is an early draft of an implementation of key auto-repeat in wineserver to get some feedback. Some open questions:
1. queue_keyboard_message requires a `current` thread, but we don't get one in timeout callbacks. At the moment I am manually setting `current` to the foreground thread, but I am wondering if that's acceptable or we should explore other ways forward (also see TODO in code).
2. This draft introduces a new server request to configure auto-repeat (`enable/delay/period`). I am thinking that for more straightforward integration with the keyboard repeat SPI parameters, the request should only support the `enable` flag and the server should query the SPI registry values to get `delay` and `period` when needed. I am wondering if there any caveats here since I don't see other code in the server querying registry values (well, except to implement the registry requests themselves).
Also, I would hope that opening and caching the `HKCU\Control Panel\Keyboard` hkey would remove most of the cost of performing this operation (if that's even a concern at all).
--
v6: win32u: Implement keyboard auto-repeat using new server request.
server: Implement key auto-repeat request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5741
--
v3: win32u: Pass the rect DPI to NtUserIsWindowRectFullScreen.
win32u: Introduce a new get_monitor_rect helper.
win32u: Pass desired DPI to NtUserGet(Client|Window)Rect.
win32u: Introduce NtUserAdjustWindowRect call for AdjustWindowRect*.
win32u: Introduce new helpers to convert server rectangle_t.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5776
It looks better, thanks. In addition to minor comments, please split it. Additional `NETCON_set_timeout` fix is a separate fix from setting/getting options. Maybe also separate `NETCON_set_timeout` for send and receive.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3518#note_72542
Jacek Caban (@jacek) commented about dlls/wininet/http.c:
>
> if (maxlen == -1) maxlen = sizeof(req->read_buf);
>
> + NETCON_set_timeout(req->netconn, FALSE, req->hdr.receive_timeout);
Setting the timeout on the socket is quite expensive (requires a wineserver call). Maybe we could store the last set timeout separate from configure timeout and update socket timeout only when they don't match?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3518#note_72541
Jacek Caban (@jacek) commented about dlls/wininet/internet.c:
> + if (!lpwhh)
> + {
> + SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
> + return FALSE;
> + }
> + if (!lpBuffer || dwBufferLength != sizeof(ULONG))
> + {
> + SetLastError(ERROR_INVALID_PARAMETER);
> + ret = FALSE;
> + }
> + else
> + {
> + lpwhh->connect_timeout = *(ULONG *)lpBuffer;
> + }
> + break;
> + }
Do we still need it? I think that with implementation in both `set_global_option` and `INET_SetOption`, we could simply remove those cases from `InternetSetOptionW` fallback.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3518#note_72540