On Fri May 23 04:23:45 2025 +0000, Alex Henrie wrote:
> Linux has only three [DVD
> ioctls](https://docs.kernel.org/userspace-api/ioctl/cdrom.html):
> DVD_READ_STRUCT, DVD_WRITE_STRUCT, and DVD_AUTH. It has no blu-ray
> ioctls. Of the three DVD ioctls, only DVD_READ_STRUCT would be suitable
> for disc type detection.
> DVD_READ_STRUCT can read five kinds of information: DVD_STRUCT_PHYSICAL,
> DVD_STRUCT_COPYRIGHT, DVD_STRUCT_DISCKEY, DVD_STRUCT_BCA, and
> DVD_STRUCT_MANUFACT. Of those five, only DVD_STRUCT_PHYSICAL would be
> suitable for disc type detection.
> At least on my LG WH16NS40 drive, DVD_STRUCT_PHYSICAL succeeds when
> there is a DVD in the drive, but it fails when there is a CD or a
> blu-ray in the drive. That means that we could use DVD_STRUCT_PHYSICAL
> to accurately detect whether there is a DVD in the drive, but we would
> still need another way to detect blu-rays.
> Is there another ioctl that you had in mind, or something else that I
> missed? Do you want to try DVD_STRUCT_PHYSICAL first and fall back to
> guessing based on the data size if it fails? Please let me know how to proceed.
Any chance it could be a driver bug?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7747#note_104478
eric pouech (@epo) commented about programs/cmd/wcmdmain.c:
> +
> + /* Calculate cursor position at beginning of prompt, accounting for lines scrolled
> + * due to length of input.
> + */
> + GetConsoleScreenBufferInfo(hOutput, ¤tConsoleInfo);
> + currentConsoleInfo.dwCursorPosition.X = startConsoleInfo.dwCursorPosition.X;
> + len2 -= (currentConsoleInfo.dwSize.X - currentConsoleInfo.dwCursorPosition.X);
> + if (len2 > 0) {
> + currentConsoleInfo.dwCursorPosition.Y -= ((len2 / currentConsoleInfo.dwSize.X) + 1);
> + }
> + SetConsoleCursorPosition(hOutput, currentConsoleInfo.dwCursorPosition);
> +
> + WriteConsoleW(hOutput, inputBuffer, len, &numWritten, NULL);
> + if (maxLen > len) {
> + clear_console_characters(hOutput, maxLen - len, lastConsoleInfo.dwSize.X); /* width at time of last console update */
> + }
and likely you could do 'maxLen = len;' here: as screen is "cleared" after 'len' position, there's no need to clear it again (unless a wider string is needed, but you'll catch that later)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7843#note_104474
eric pouech (@epo) commented about programs/cmd/wcmdmain.c:
> + len = lstrlenW(inputBuffer);
> + len2 = len;
> +
> + /* Update current input display in console */
> + set_cursor_visible(hOutput, FALSE);
> +
> + /* Calculate cursor position at beginning of prompt, accounting for lines scrolled
> + * due to length of input.
> + */
> + GetConsoleScreenBufferInfo(hOutput, ¤tConsoleInfo);
> + currentConsoleInfo.dwCursorPosition.X = startConsoleInfo.dwCursorPosition.X;
> + len2 -= (currentConsoleInfo.dwSize.X - currentConsoleInfo.dwCursorPosition.X);
> + if (len2 > 0) {
> + currentConsoleInfo.dwCursorPosition.Y -= ((len2 / currentConsoleInfo.dwSize.X) + 1);
> + }
> + SetConsoleCursorPosition(hOutput, currentConsoleInfo.dwCursorPosition);
did you try just reusing startConsoleInfo.dwCursorPosition here instead of recomputing the initial cursor position?
Actually I'm worried that we have to convert between cursor position from/to number of characters
- this makes assumptions about how the string is layed out (one vs multiple lines, one string character == one cell == one glyph on screen (this is not the case for CJK characters; if we support them one day))
- anyway, I don't see a simple straightforward way to do it (ReadConsole doesn't return the farthest cursor point where it has written to, and since it can be on multiple lines...).
- but the less code that does it, the better
the pain here comes from conhost wrapping the strings (in WriteConsole) larger than screen buffer width onto different lines... native use an unbounded line length and wraps it depending on window size.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7843#note_104473
On Sun May 25 15:34:38 2025 +0000, Alexandros Frantzis wrote:
> Hi @yurih, from what I understand the reason alt(-tab) is problematic is
> because the alt menu mode is enabled when the key is released. However,
> avoiding the release just for this behavior doesn't seem like a viable
> way forward, since other applications may treat alt differently or may
> also require treating other keys the same way.
> I was experimenting a bit and sending WM_CANCELMODE (which winex11 does
> already) seems to help with the alt(-tab) menu situation in my tests.
> Could you try the following and let me know if it helps with your use case:
> ```patch
> --- a/dlls/winewayland.drv/wayland_keyboard.c
> +++ b/dlls/winewayland.drv/wayland_keyboard.c
> @@ -800,6 +800,11 @@ static void keyboard_handle_leave(void *data,
> struct wl_keyboard *wl_keyboard,
> * and for any key repetition to stop. */
> release_all_keys(hwnd);
>
> + if (hwnd == NtUserGetForegroundWindow())
> + {
> + if (!(NtUserGetWindowLongW(hwnd, GWL_STYLE) & WS_MINIMIZE))
> + send_message(hwnd, WM_CANCELMODE, 0, 0);
> + }
> /* FIXME: update foreground window as well */
> }
> ```
Yes it does indeed fix the alt menu mode without my patch. Though I don't think I understood clearly what you meant, as Alt is already filtered (VK_MENU), I just added the left and right keys as they are among the returned keyboard state and are not filtered, making Alt released anyway. You plan to remove the modifier's filtering altogether ?
Also, there's issues with extended scan code (for example my keyboard arrows) that aren't released, though it also happens with winex11.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6199#note_104470