qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ui/gtk: fix cursor moved to lower-left corner
@ 2023-03-20 11:47 marcandre.lureau
  2023-03-20 12:20 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: marcandre.lureau @ 2023-03-20 11:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, shentey, Marc-André Lureau, Gerd Hoffmann

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Do not attempt to move the pointer if the widget is not yet realized.
(this is reproducible with X11)

Fixes: 6effaa16ac98 ("ui: set cursor position upon listener
registration")
Reported-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/gtk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index fd82e9b1ca..e9564f2baa 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -450,7 +450,8 @@ static void gd_mouse_set(DisplayChangeListener *dcl,
     GdkDisplay *dpy;
     gint x_root, y_root;
 
-    if (qemu_input_is_absolute()) {
+    if (!gtk_widget_get_realized(vc->gfx.drawing_area) ||
+        qemu_input_is_absolute()) {
         return;
     }
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ui/gtk: fix cursor moved to lower-left corner
  2023-03-20 11:47 [PATCH] ui/gtk: fix cursor moved to lower-left corner marcandre.lureau
@ 2023-03-20 12:20 ` Daniel P. Berrangé
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2023-03-20 12:20 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel, shentey, Gerd Hoffmann

On Mon, Mar 20, 2023 at 03:47:56PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Do not attempt to move the pointer if the widget is not yet realized.
> (this is reproducible with X11)

What is reproducible ? Can you describe the problem that was
reported by Bernhard ?

> 
> Fixes: 6effaa16ac98 ("ui: set cursor position upon listener
> registration")
> Reported-by: Bernhard Beschow <shentey@gmail.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/gtk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index fd82e9b1ca..e9564f2baa 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -450,7 +450,8 @@ static void gd_mouse_set(DisplayChangeListener *dcl,
>      GdkDisplay *dpy;
>      gint x_root, y_root;
>  
> -    if (qemu_input_is_absolute()) {
> +    if (!gtk_widget_get_realized(vc->gfx.drawing_area) ||
> +        qemu_input_is_absolute()) {
>          return;
>      }
>  
> -- 
> 2.39.2
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-20 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-20 11:47 [PATCH] ui/gtk: fix cursor moved to lower-left corner marcandre.lureau
2023-03-20 12:20 ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).