All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI
@ 2014-04-04 10:41 Takashi Iwai
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 1/4] gtk: Use gtk generic event signal instead of motion-notify-event Takashi Iwai
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Takashi Iwai @ 2014-04-04 10:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori, Cole Robinson

Hi,

this is the revisited patch series.  The only difference from v2
is that now they are checkpatch-clean and Cole's acks have been
added to patches 1-3.


Takashi

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

* [Qemu-devel] [PATCH v3 1/4] gtk: Use gtk generic event signal instead of motion-notify-event
  2014-04-04 10:41 [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Takashi Iwai
@ 2014-04-04 10:41 ` Takashi Iwai
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 2/4] gtk: Fix the relative pointer tracking mode Takashi Iwai
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Takashi Iwai @ 2014-04-04 10:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori, Cole Robinson

The GDK motion-notify-event isn't generated when the pointer goes out
of the target window even if the pointer is grabbed, which essentially
means to lose the pointer tracking in gtk-ui.

Meanwhile the generic "event" signal is sent when the pointer is
grabbed, so we can use this and pick the motion notify events manually
there instead.

Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
Tested-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 ui/gtk.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index f056e4034b3e..c9f6d24eeb1a 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -765,6 +765,14 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
     return TRUE;
 }
 
+static gboolean gd_event(GtkWidget *widget, GdkEvent *event, void *opaque)
+{
+    if (event->type == GDK_MOTION_NOTIFY) {
+        return gd_motion_event(widget, &event->motion, opaque);
+    }
+    return FALSE;
+}
+
 /** Window Menu Actions **/
 
 static void gd_menu_pause(GtkMenuItem *item, void *opaque)
@@ -1267,8 +1275,8 @@ static void gd_connect_signals(GtkDisplayState *s)
     g_signal_connect(s->drawing_area, "expose-event",
                      G_CALLBACK(gd_expose_event), s);
 #endif
-    g_signal_connect(s->drawing_area, "motion-notify-event",
-                     G_CALLBACK(gd_motion_event), s);
+    g_signal_connect(s->drawing_area, "event",
+                     G_CALLBACK(gd_event), s);
     g_signal_connect(s->drawing_area, "button-press-event",
                      G_CALLBACK(gd_button_event), s);
     g_signal_connect(s->drawing_area, "button-release-event",
-- 
1.9.1

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

* [Qemu-devel] [PATCH v3 2/4] gtk: Fix the relative pointer tracking mode
  2014-04-04 10:41 [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Takashi Iwai
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 1/4] gtk: Use gtk generic event signal instead of motion-notify-event Takashi Iwai
@ 2014-04-04 10:41 ` Takashi Iwai
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 3/4] gtk: Remember the last grabbed pointer position Takashi Iwai
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Takashi Iwai @ 2014-04-04 10:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori, Cole Robinson

The relative pointer tracking mode was still buggy even after the
previous fix of the motion-notify-event since the events are filtered
out when the pointer moves outside the drawing window due to the
boundary check for the absolute mode.

This patch fixes the issue by moving the unnecessary boundary check
into the if block of absolute mode, and keep the coordinate in the
relative mode even if it's outside the drawing area.  But this makes
the coordinate (last_x, last_y) possibly pointing to (-1,-1),
introduce a new flag to indicate the last coordinate has been
updated.

Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
Tested-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 ui/gtk.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index c9f6d24eeb1a..913cc3f70c02 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -156,6 +156,7 @@ typedef struct GtkDisplayState
     DisplayChangeListener dcl;
     DisplaySurface *ds;
     int button_mask;
+    gboolean last_set;
     int last_x;
     int last_y;
 
@@ -616,25 +617,25 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
     x = (motion->x - mx) / s->scale_x;
     y = (motion->y - my) / s->scale_y;
 
-    if (x < 0 || y < 0 ||
-        x >= surface_width(s->ds) ||
-        y >= surface_height(s->ds)) {
-        return TRUE;
-    }
-
     if (qemu_input_is_absolute()) {
+        if (x < 0 || y < 0 ||
+            x >= surface_width(s->ds) ||
+            y >= surface_height(s->ds)) {
+            return TRUE;
+        }
         qemu_input_queue_abs(s->dcl.con, INPUT_AXIS_X, x,
                              surface_width(s->ds));
         qemu_input_queue_abs(s->dcl.con, INPUT_AXIS_Y, y,
                              surface_height(s->ds));
         qemu_input_event_sync();
-    } else if (s->last_x != -1 && s->last_y != -1 && gd_is_grab_active(s)) {
+    } else if (s->last_set && gd_is_grab_active(s)) {
         qemu_input_queue_rel(s->dcl.con, INPUT_AXIS_X, x - s->last_x);
         qemu_input_queue_rel(s->dcl.con, INPUT_AXIS_Y, y - s->last_y);
         qemu_input_event_sync();
     }
     s->last_x = x;
     s->last_y = y;
+    s->last_set = TRUE;
 
     if (!qemu_input_is_absolute() && gd_is_grab_active(s)) {
         GdkScreen *screen = gtk_widget_get_screen(s->drawing_area);
@@ -669,8 +670,7 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
             GdkDisplay *display = gtk_widget_get_display(widget);
             gdk_display_warp_pointer(display, screen, x, y);
 #endif
-            s->last_x = -1;
-            s->last_y = -1;
+            s->last_set = FALSE;
             return FALSE;
         }
     }
-- 
1.9.1

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

* [Qemu-devel] [PATCH v3 3/4] gtk: Remember the last grabbed pointer position
  2014-04-04 10:41 [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Takashi Iwai
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 1/4] gtk: Use gtk generic event signal instead of motion-notify-event Takashi Iwai
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 2/4] gtk: Fix the relative pointer tracking mode Takashi Iwai
@ 2014-04-04 10:41 ` Takashi Iwai
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option Takashi Iwai
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Takashi Iwai @ 2014-04-04 10:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori, Cole Robinson

It's pretty annoying that the pointer reappears at a random place once
after grabbing and ungrabbing the input.  Better to restore to the
original position where the pointer was grabbed.

Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
Tested-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 ui/gtk.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 913cc3f70c02..6668bd8226d5 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -159,6 +159,8 @@ typedef struct GtkDisplayState
     gboolean last_set;
     int last_x;
     int last_y;
+    int grab_x_root;
+    int grab_y_root;
 
     double scale_x;
     double scale_y;
@@ -971,8 +973,8 @@ static void gd_ungrab_keyboard(GtkDisplayState *s)
 
 static void gd_grab_pointer(GtkDisplayState *s)
 {
-#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDisplay *display = gtk_widget_get_display(s->drawing_area);
+#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDeviceManager *mgr = gdk_display_get_device_manager(display);
     GList *devices = gdk_device_manager_list_devices(mgr,
                                                      GDK_DEVICE_TYPE_MASTER);
@@ -996,6 +998,8 @@ static void gd_grab_pointer(GtkDisplayState *s)
         tmp = tmp->next;
     }
     g_list_free(devices);
+    gdk_device_get_position(gdk_device_manager_get_client_pointer(mgr),
+                            NULL, &s->grab_x_root, &s->grab_y_root);
 #else
     gdk_pointer_grab(gtk_widget_get_window(s->drawing_area),
                      FALSE, /* All events to come to our window directly */
@@ -1007,13 +1011,15 @@ static void gd_grab_pointer(GtkDisplayState *s)
                      NULL, /* Allow cursor to move over entire desktop */
                      s->null_cursor,
                      GDK_CURRENT_TIME);
+    gdk_display_get_pointer(display, NULL,
+                            &s->grab_x_root, &s->grab_y_root, NULL);
 #endif
 }
 
 static void gd_ungrab_pointer(GtkDisplayState *s)
 {
-#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDisplay *display = gtk_widget_get_display(s->drawing_area);
+#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDeviceManager *mgr = gdk_display_get_device_manager(display);
     GList *devices = gdk_device_manager_list_devices(mgr,
                                                      GDK_DEVICE_TYPE_MASTER);
@@ -1027,8 +1033,14 @@ static void gd_ungrab_pointer(GtkDisplayState *s)
         tmp = tmp->next;
     }
     g_list_free(devices);
+    gdk_device_warp(gdk_device_manager_get_client_pointer(mgr),
+                    gtk_widget_get_screen(s->drawing_area),
+                    s->grab_x_root, s->grab_y_root);
 #else
     gdk_pointer_ungrab(GDK_CURRENT_TIME);
+    gdk_display_warp_pointer(display,
+                             gtk_widget_get_screen(s->drawing_area),
+                             s->grab_x_root, s->grab_y_root);
 #endif
 }
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-04 10:41 [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Takashi Iwai
                   ` (2 preceding siblings ...)
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 3/4] gtk: Remember the last grabbed pointer position Takashi Iwai
@ 2014-04-04 10:41 ` Takashi Iwai
  2014-04-07  8:07   ` Gerd Hoffmann
  2014-04-04 23:08 ` [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Brian Jackson
  2014-04-06 10:36 ` Michael S. Tsirkin
  5 siblings, 1 reply; 15+ messages in thread
From: Takashi Iwai @ 2014-04-04 10:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori, Cole Robinson

I simply like it better, you don't? :)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 ui/gtk.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/ui/gtk.c b/ui/gtk.c
index 6668bd8226d5..4427d9f6c1e9 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -141,6 +141,7 @@ typedef struct GtkDisplayState
     GtkWidget *zoom_fit_item;
     GtkWidget *grab_item;
     GtkWidget *grab_on_hover_item;
+    GtkWidget *grab_on_click_item;
     GtkWidget *vga_item;
 
     int nb_vcs;
@@ -189,6 +190,11 @@ static bool gd_grab_on_hover(GtkDisplayState *s)
     return gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->grab_on_hover_item));
 }
 
+static bool gd_grab_on_click(GtkDisplayState *s)
+{
+    return gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->grab_on_click_item));
+}
+
 static bool gd_on_vga(GtkDisplayState *s)
 {
     return gtk_notebook_get_current_page(GTK_NOTEBOOK(s->notebook)) == 0;
@@ -685,6 +691,12 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
     GtkDisplayState *s = opaque;
     InputButton btn;
 
+    if (button->button == 1 && button->type == GDK_BUTTON_PRESS &&
+        !gd_is_grab_active(s) && gd_grab_on_click(s)) {
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item), TRUE);
+        return TRUE;
+    }
+
     if (button->button == 1) {
         btn = INPUT_BUTTON_LEFT;
     } else if (button->button == 2) {
@@ -1417,6 +1429,9 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s, GtkAccelGroup *accel_g
     s->grab_on_hover_item = gtk_check_menu_item_new_with_mnemonic(_("Grab On _Hover"));
     gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->grab_on_hover_item);
 
+    s->grab_on_click_item = gtk_check_menu_item_new_with_mnemonic(_("Grab On _Click"));
+    gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->grab_on_click_item);
+
     s->grab_item = gtk_check_menu_item_new_with_mnemonic(_("_Grab Input"));
     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->grab_item),
                                  "<QEMU>/View/Grab Input");
-- 
1.9.1

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

* Re: [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI
  2014-04-04 10:41 [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Takashi Iwai
                   ` (3 preceding siblings ...)
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option Takashi Iwai
@ 2014-04-04 23:08 ` Brian Jackson
  2014-04-06 10:36 ` Michael S. Tsirkin
  5 siblings, 0 replies; 15+ messages in thread
From: Brian Jackson @ 2014-04-04 23:08 UTC (permalink / raw)
  To: Takashi Iwai, qemu-devel
  Cc: peter.maydell, Gerd Hoffmann, Anthony Liguori, Cole Robinson

On 04/04/2014 05:41 AM, Takashi Iwai wrote:
> Hi,
>
> this is the revisited patch series.  The only difference from v2
> is that now they are checkpatch-clean and Cole's acks have been
> added to patches 1-3.

Is this 2.0 material?


>
>
> Takashi
>

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

* Re: [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI
  2014-04-04 10:41 [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Takashi Iwai
                   ` (4 preceding siblings ...)
  2014-04-04 23:08 ` [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Brian Jackson
@ 2014-04-06 10:36 ` Michael S. Tsirkin
  5 siblings, 0 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2014-04-06 10:36 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: peter.maydell, Cole Robinson, qemu-devel, Anthony Liguori, Gerd Hoffmann

On Fri, Apr 04, 2014 at 12:41:20PM +0200, Takashi Iwai wrote:
> Hi,
> 
> this is the revisited patch series.  The only difference from v2
> is that now they are checkpatch-clean and Cole's acks have been
> added to patches 1-3.
> 
> 
> Takashi

For the series:

Tested-by: Michael S. Tsirkin <mst@redhat.com>

Any chance this can be merged for 2.0?

This greatly increases the usability of GTK UI:
as it is it's almost useless with mouse pointer jumping
about in jerks to the point that I'm forcing it
off with -sdl.
Lack of grab on click is also a regression from SDL.

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option Takashi Iwai
@ 2014-04-07  8:07   ` Gerd Hoffmann
  2014-04-07  8:21     ` Takashi Iwai
  2014-04-07 20:38     ` Michael S. Tsirkin
  0 siblings, 2 replies; 15+ messages in thread
From: Gerd Hoffmann @ 2014-04-07  8:07 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: qemu-devel, Anthony Liguori, Cole Robinson

On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> I simply like it better, you don't? :)

I still think we should make this simply depend on absolute/relative
pointer mode instead of asking the user to switch it manually.

I'll quickly go put patches 1-3 into a 2.0 pull request, so debating
patch #4 doesn't stop the clear improvements from entering the tree.

cheers,
  Gerd

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-07  8:07   ` Gerd Hoffmann
@ 2014-04-07  8:21     ` Takashi Iwai
  2014-04-07 20:38     ` Michael S. Tsirkin
  1 sibling, 0 replies; 15+ messages in thread
From: Takashi Iwai @ 2014-04-07  8:21 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel, Anthony Liguori, Cole Robinson

At Mon, 07 Apr 2014 10:07:43 +0200,
Gerd Hoffmann wrote:
> 
> On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> > I simply like it better, you don't? :)
> 
> I still think we should make this simply depend on absolute/relative
> pointer mode instead of asking the user to switch it manually.

Yes, agreed, it's more intuitive.
OTOH, we still want the explicit input grab in absolute mode.  So,
we'll need two flags in the end, the explicit grab by menu or key
combo, and the implicit grab by click in relative mode.

> I'll quickly go put patches 1-3 into a 2.0 pull request, so debating
> patch #4 doesn't stop the clear improvements from entering the tree.

Thanks!


Takashi

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-07  8:07   ` Gerd Hoffmann
  2014-04-07  8:21     ` Takashi Iwai
@ 2014-04-07 20:38     ` Michael S. Tsirkin
  2014-04-08  6:25       ` Gerd Hoffmann
  1 sibling, 1 reply; 15+ messages in thread
From: Michael S. Tsirkin @ 2014-04-07 20:38 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Takashi Iwai, qemu-devel, Anthony Liguori, Cole Robinson

On Mon, Apr 07, 2014 at 10:07:43AM +0200, Gerd Hoffmann wrote:
> On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> > I simply like it better, you don't? :)
> 
> I still think we should make this simply depend on absolute/relative
> pointer mode instead of asking the user to switch it manually.

Hmm how do I set absolute/relative mode?
I think it's a matter of taste mostly.
Sometimes I feel I want click to grab sometimes I don't.

> I'll quickly go put patches 1-3 into a 2.0 pull request, so debating
> patch #4 doesn't stop the clear improvements from entering the tree.
> 
> cheers,
>   Gerd
> 
> 

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-07 20:38     ` Michael S. Tsirkin
@ 2014-04-08  6:25       ` Gerd Hoffmann
  2014-04-08  8:11         ` Michael S. Tsirkin
  0 siblings, 1 reply; 15+ messages in thread
From: Gerd Hoffmann @ 2014-04-08  6:25 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Takashi Iwai, qemu-devel, Anthony Liguori, Cole Robinson

On Mo, 2014-04-07 at 23:38 +0300, Michael S. Tsirkin wrote:
> On Mon, Apr 07, 2014 at 10:07:43AM +0200, Gerd Hoffmann wrote:
> > On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> > > I simply like it better, you don't? :)
> > 
> > I still think we should make this simply depend on absolute/relative
> > pointer mode instead of asking the user to switch it manually.
> 
> Hmm how do I set absolute/relative mode?

Depends on the pointer input device being used.

Start guest with "-device usb-tablet".  Go to HMP.  'info mice' should
list the ps/2 mouse and the usb tablet.  Using 'mouse_set' (or was it
set_mouse?) you can force one of the two devides being used.

If you pick the tablet (should be active by default) absolute pointer
events are passed to the guest, and qemu works in absolute mode (i.e.
sdl doesn't do pointer grabs).

If you pick the mouse relative mouse events are passed to the guest, and
qemu works in relative mode (pointer grab is pretty much required to
work with the guest).

cheers,
  Gerd

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-08  6:25       ` Gerd Hoffmann
@ 2014-04-08  8:11         ` Michael S. Tsirkin
  2014-04-08  8:49           ` Gerd Hoffmann
  0 siblings, 1 reply; 15+ messages in thread
From: Michael S. Tsirkin @ 2014-04-08  8:11 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Takashi Iwai, qemu-devel, Anthony Liguori, Cole Robinson

On Tue, Apr 08, 2014 at 08:25:34AM +0200, Gerd Hoffmann wrote:
> On Mo, 2014-04-07 at 23:38 +0300, Michael S. Tsirkin wrote:
> > On Mon, Apr 07, 2014 at 10:07:43AM +0200, Gerd Hoffmann wrote:
> > > On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> > > > I simply like it better, you don't? :)
> > > 
> > > I still think we should make this simply depend on absolute/relative
> > > pointer mode instead of asking the user to switch it manually.
> > 
> > Hmm how do I set absolute/relative mode?
> 
> Depends on the pointer input device being used.
> 
> Start guest with "-device usb-tablet".  Go to HMP.  'info mice' should
> list the ps/2 mouse and the usb tablet.  Using 'mouse_set' (or was it
> set_mouse?) you can force one of the two devides being used.
> 
> If you pick the tablet (should be active by default) absolute pointer
> events are passed to the guest, and qemu works in absolute mode (i.e.
> sdl doesn't do pointer grabs).
> 
> If you pick the mouse relative mouse events are passed to the guest, and
> qemu works in relative mode (pointer grab is pretty much required to
> work with the guest).
> 
> cheers,
>   Gerd
> 

I have to say grab on click is easier to understand - more predictable.
Not requesting that it's made the default, but an option would be nice.

-- 
MST

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-08  8:11         ` Michael S. Tsirkin
@ 2014-04-08  8:49           ` Gerd Hoffmann
  2014-04-08  8:57             ` Michael S. Tsirkin
  0 siblings, 1 reply; 15+ messages in thread
From: Gerd Hoffmann @ 2014-04-08  8:49 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Takashi Iwai, qemu-devel, Anthony Liguori, Cole Robinson

On Di, 2014-04-08 at 11:11 +0300, Michael S. Tsirkin wrote:
> On Tue, Apr 08, 2014 at 08:25:34AM +0200, Gerd Hoffmann wrote:
> > On Mo, 2014-04-07 at 23:38 +0300, Michael S. Tsirkin wrote:
> > > On Mon, Apr 07, 2014 at 10:07:43AM +0200, Gerd Hoffmann wrote:
> > > > On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> > > > > I simply like it better, you don't? :)
> > > > 
> > > > I still think we should make this simply depend on absolute/relative
> > > > pointer mode instead of asking the user to switch it manually.
> > > 
> > > Hmm how do I set absolute/relative mode?
> > 
> > Depends on the pointer input device being used.
> > 
> > Start guest with "-device usb-tablet".  Go to HMP.  'info mice' should
> > list the ps/2 mouse and the usb tablet.  Using 'mouse_set' (or was it
> > set_mouse?) you can force one of the two devides being used.
> > 
> > If you pick the tablet (should be active by default) absolute pointer
> > events are passed to the guest, and qemu works in absolute mode (i.e.
> > sdl doesn't do pointer grabs).
> > 
> > If you pick the mouse relative mouse events are passed to the guest, and
> > qemu works in relative mode (pointer grab is pretty much required to
> > work with the guest).
> > 
> > cheers,
> >   Gerd
> > 
> 
> I have to say grab on click is easier to understand - more predictable.
> Not requesting that it's made the default, but an option would be nice.

Well, usually you'll never ever pick the pointer device manually, this
is mainly meant for testing things or checkout what the behavior is.

Another topic is how to actually activate the grab (when in relative
mode where it is needed).  You surely don't want grab the pointer on
hover as simply crossing the guest window will activate it.
Grab-(+ungrab)-by-hotkey and grab-on-click is what SDL, virt-viewer &
friends are doing today.  I think gtk should simply do the same for
consistency, and I don't see a need for a config option.

cheers,
  Gerd

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-08  8:49           ` Gerd Hoffmann
@ 2014-04-08  8:57             ` Michael S. Tsirkin
  2014-04-08  9:23               ` Takashi Iwai
  0 siblings, 1 reply; 15+ messages in thread
From: Michael S. Tsirkin @ 2014-04-08  8:57 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Takashi Iwai, qemu-devel, Anthony Liguori, Cole Robinson

On Tue, Apr 08, 2014 at 10:49:57AM +0200, Gerd Hoffmann wrote:
> On Di, 2014-04-08 at 11:11 +0300, Michael S. Tsirkin wrote:
> > On Tue, Apr 08, 2014 at 08:25:34AM +0200, Gerd Hoffmann wrote:
> > > On Mo, 2014-04-07 at 23:38 +0300, Michael S. Tsirkin wrote:
> > > > On Mon, Apr 07, 2014 at 10:07:43AM +0200, Gerd Hoffmann wrote:
> > > > > On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> > > > > > I simply like it better, you don't? :)
> > > > > 
> > > > > I still think we should make this simply depend on absolute/relative
> > > > > pointer mode instead of asking the user to switch it manually.
> > > > 
> > > > Hmm how do I set absolute/relative mode?
> > > 
> > > Depends on the pointer input device being used.
> > > 
> > > Start guest with "-device usb-tablet".  Go to HMP.  'info mice' should
> > > list the ps/2 mouse and the usb tablet.  Using 'mouse_set' (or was it
> > > set_mouse?) you can force one of the two devides being used.
> > > 
> > > If you pick the tablet (should be active by default) absolute pointer
> > > events are passed to the guest, and qemu works in absolute mode (i.e.
> > > sdl doesn't do pointer grabs).
> > > 
> > > If you pick the mouse relative mouse events are passed to the guest, and
> > > qemu works in relative mode (pointer grab is pretty much required to
> > > work with the guest).
> > > 
> > > cheers,
> > >   Gerd
> > > 
> > 
> > I have to say grab on click is easier to understand - more predictable.
> > Not requesting that it's made the default, but an option would be nice.
> 
> Well, usually you'll never ever pick the pointer device manually, this
> is mainly meant for testing things or checkout what the behavior is.
> 
> Another topic is how to actually activate the grab (when in relative
> mode where it is needed).  You surely don't want grab the pointer on
> hover as simply crossing the guest window will activate it.

Sounds kind of useful. Why isn't it?

> Grab-(+ungrab)-by-hotkey and grab-on-click is what SDL, virt-viewer &
> friends are doing today.  I think gtk should simply do the same for
> consistency, and I don't see a need for a config option.
> 
> cheers,
>   Gerd

Aha.
It's lack of grab on click that makes me unhappy.
So how about doing this for 2.0?
Drop grab on hover make grab on click the default.


-- 
MST

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

* Re: [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option
  2014-04-08  8:57             ` Michael S. Tsirkin
@ 2014-04-08  9:23               ` Takashi Iwai
  0 siblings, 0 replies; 15+ messages in thread
From: Takashi Iwai @ 2014-04-08  9:23 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Cole Robinson, Gerd Hoffmann, Anthony Liguori, qemu-devel

At Tue, 8 Apr 2014 11:57:19 +0300,
Michael S. Tsirkin wrote:
> 
> On Tue, Apr 08, 2014 at 10:49:57AM +0200, Gerd Hoffmann wrote:
> > On Di, 2014-04-08 at 11:11 +0300, Michael S. Tsirkin wrote:
> > > On Tue, Apr 08, 2014 at 08:25:34AM +0200, Gerd Hoffmann wrote:
> > > > On Mo, 2014-04-07 at 23:38 +0300, Michael S. Tsirkin wrote:
> > > > > On Mon, Apr 07, 2014 at 10:07:43AM +0200, Gerd Hoffmann wrote:
> > > > > > On Fr, 2014-04-04 at 12:41 +0200, Takashi Iwai wrote:
> > > > > > > I simply like it better, you don't? :)
> > > > > > 
> > > > > > I still think we should make this simply depend on absolute/relative
> > > > > > pointer mode instead of asking the user to switch it manually.
> > > > > 
> > > > > Hmm how do I set absolute/relative mode?
> > > > 
> > > > Depends on the pointer input device being used.
> > > > 
> > > > Start guest with "-device usb-tablet".  Go to HMP.  'info mice' should
> > > > list the ps/2 mouse and the usb tablet.  Using 'mouse_set' (or was it
> > > > set_mouse?) you can force one of the two devides being used.
> > > > 
> > > > If you pick the tablet (should be active by default) absolute pointer
> > > > events are passed to the guest, and qemu works in absolute mode (i.e.
> > > > sdl doesn't do pointer grabs).
> > > > 
> > > > If you pick the mouse relative mouse events are passed to the guest, and
> > > > qemu works in relative mode (pointer grab is pretty much required to
> > > > work with the guest).
> > > > 
> > > > cheers,
> > > >   Gerd
> > > > 
> > > 
> > > I have to say grab on click is easier to understand - more predictable.
> > > Not requesting that it's made the default, but an option would be nice.
> > 
> > Well, usually you'll never ever pick the pointer device manually, this
> > is mainly meant for testing things or checkout what the behavior is.
> > 
> > Another topic is how to actually activate the grab (when in relative
> > mode where it is needed).  You surely don't want grab the pointer on
> > hover as simply crossing the guest window will activate it.
> 
> Sounds kind of useful. Why isn't it?
> 
> > Grab-(+ungrab)-by-hotkey and grab-on-click is what SDL, virt-viewer &
> > friends are doing today.  I think gtk should simply do the same for
> > consistency, and I don't see a need for a config option.
> > 
> > cheers,
> >   Gerd
> 
> Aha.
> It's lack of grab on click that makes me unhappy.
> So how about doing this for 2.0?
> Drop grab on hover make grab on click the default.

OK, I'll submit a revised patch to implement grab-on-click only in
relative mode.


Takashi

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

end of thread, other threads:[~2014-04-08  9:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04 10:41 [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Takashi Iwai
2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 1/4] gtk: Use gtk generic event signal instead of motion-notify-event Takashi Iwai
2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 2/4] gtk: Fix the relative pointer tracking mode Takashi Iwai
2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 3/4] gtk: Remember the last grabbed pointer position Takashi Iwai
2014-04-04 10:41 ` [Qemu-devel] [PATCH v3 4/4] gtk: Add "Grab On Click" option Takashi Iwai
2014-04-07  8:07   ` Gerd Hoffmann
2014-04-07  8:21     ` Takashi Iwai
2014-04-07 20:38     ` Michael S. Tsirkin
2014-04-08  6:25       ` Gerd Hoffmann
2014-04-08  8:11         ` Michael S. Tsirkin
2014-04-08  8:49           ` Gerd Hoffmann
2014-04-08  8:57             ` Michael S. Tsirkin
2014-04-08  9:23               ` Takashi Iwai
2014-04-04 23:08 ` [Qemu-devel] [PATCH v3 0/4] Fix relative pointer tracking on Gtk UI Brian Jackson
2014-04-06 10:36 ` Michael S. Tsirkin

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.