Refresh

This website lore-kernel.gnuweeb.org/all/8d662e1969be4a9a89c0b38991986ebe@xiaomi.com/ is currently offline. Cloudflare\'s Always Online™ shows a snapshot of this web page from the Internet Archive\'s Wayback Machine. To check for the live version, click Refresh.

All of lore.kernel.org
 help / color / mirror / Atom feed
From: "荣义昌 via qemu development" <qemu-devel@nongnu.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"marcandre.lureau@redhat.com" <marcandre.lureau@redhat.com>,
	"armbru@redhat.com" <armbru@redhat.com>,
	"eblake@redhat.com" <eblake@redhat.com>
Subject: 答复: [External Mail]Re: [PATCH qemu] ui/sdl2: add grab-on-tablet option for absolute input devices
Date: Sat, 6 Jun 2026 03:01:13 +0000	[thread overview]
Message-ID: <8d662e1969be4a9a89c0b38991986ebe@xiaomi.com> (raw)
In-Reply-To: <f54a2b09-f144-abc3-6163-563908c336a3@eik.bme.hu>

[-- Attachment #1: Type: text/plain, Size: 3589 bytes --]

Hi,

Thanks for the review.

If we use a generic name like "click-to-grab" (not tablet-specific),
should we also consider the reverse direction ― i.e., allowing relative
(mouse) devices to use the tablet-style edge-ungrab/regrab behavior
via something like "click-to-grab=off"?

Currently relative devices always use click-to-grab, and absolute
devices always use edge-based auto-grab. If we make this a generic
toggle, the semantics would be:

  -display sdl,click-to-grab=on   → both device types use click-to-grab
  -display sdl,click-to-grab=off  → both device types use edge-ungrab

However, edge-ungrab doesn't really work for relative (mouse) devices,
because once the mouse escapes the window, SDL stops delivering motion
events and the guest cursor becomes uncontrollable.

So in practice, this option can only meaningfully change behavior for
absolute devices. That's why I chose a tablet-specific name ― to make
it clear that it only affects absolute coordinate devices.

That said, I'm open to "click-to-grab=on|off" if you prefer a more
generic name. The implementation would remain the same (only affecting
absolute devices), just with a more general name.

What do you think?

Best regards,
Yichang


________________________________
发件人: BALATON Zoltan <balaton@eik.bme.hu>
发送时间: 2026年6月6日 0:47:00
收件人: 荣义昌
抄送: qemu-devel@nongnu.org; marcandre.lureau@redhat.com; armbru@redhat.com; eblake@redhat.com
主题: [External Mail]Re: [PATCH qemu] ui/sdl2: add grab-on-tablet option for absolute input devices

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给misec@xiaomi.com进行反馈

On Fri, 5 Jun 2026, ~rongyichang wrote:
> From: rongyichang <rongyichang@xiaomi.com>
>
> When using absolute coordinate input devices (e.g. virtio-tablet-device),
> the SDL display backend implements a "soft grab" where the mouse is
> automatically grabbed when it enters the window interior and ungrabbed
> when it hits the window edge. This edge-ungrab behavior causes problems
> in embedded emulation scenarios:
>
> 1. Mouse escapes the SDL window at edges
> 2. SDL does not deliver BUTTONUP events for the escaped mouse
> 3. The guest gets stuck in a pressed/touch-down state
> 4. First click back into the window is silently dropped
>
> This issue is confirmed as a known SDL limitation (SDL issue #5301).
>
> Add a new -display sdl,grab-on-tablet=on option that makes absolute
> coordinate devices use the same grab behavior as relative (mouse)
> devices: user must click to grab, Ctrl+Alt+G to release, and no
> automatic grab on window enter or edge-based ungrab/regrab.

Maybe it's better to name the option click-to-grab or grab-on-click or
something similar as that's what it changes and not specific to tablets.

Regards.
BALATON Zoltan
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

[-- Attachment #2: Type: text/html, Size: 5233 bytes --]

  reply	other threads:[~2026-06-06 13:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05  9:53 [PATCH qemu] ui/sdl2: add grab-on-tablet option for absolute input devices ~rongyichang
2026-06-05 16:47 ` BALATON Zoltan
2026-06-06  3:01   ` 荣义昌 via qemu development [this message]
2026-06-18 12:56     ` 答复: [External Mail]Re: " BALATON Zoltan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d662e1969be4a9a89c0b38991986ebe@xiaomi.com \
    --to=qemu-devel@nongnu.org \
    --cc=armbru@redhat.com \
    --cc=balaton@eik.bme.hu \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=rongyichang@xiaomi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.