Message ID | 1396608084-26986-5-git-send-email-tiwai@suse.de |
---|---|
State | New |
Headers | show |
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
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
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 > >
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
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.
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
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.
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
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");
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(+)