Re: [PATCH] Enable to send F10 key to the guest OS.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 23, 2008 at 12:04:38PM +0900, Hiroyuki Kaguchi wrote:
> On 2008/05/23 11:51, Hiroyuki Kaguchi wrote:
> > The F10 key is assigned as the accelerator of the menu bar in the OS(Windows or
> > Linux).
> > On this account it is necessary to send the F10 key to the guest OS.
> > However, with the existing specifications of virt-viewer, the F10 key is
> > assigned to the accelerator
> > of the menu bar of virt-viewer and we cannot send the F10 key to the guest OS.
> > So, I change virt-viewer to be able to send F10 key to the guest OS when
> > virt-viewer grabs the keyboard.

The idea of the patch is a good one, but I think it is possible for
the user to customize the accelerator for menus. So by clearing the
accelerator and then resetting it to "F10" we would be overriding 
the user's customization.

So before clearing the accelerator we  should first make a record of
what the current setting is. This will let us correctly restore it
later.

> diff -r 5299a3aaebb5 src/main.c
> --- a/src/main.c	Sun Apr 27 23:41:26 2008 -0400
> +++ b/src/main.c	Wed May 21 17:35:09 2008 +0900
> @@ -116,6 +116,8 @@ static void viewer_grab(GtkWidget *vnc, 
>  	for (i = 0 ; i < LAST_MENU; i++) {
>  		gtk_label_set_text_with_mnemonic(GTK_LABEL(menuItems[i].label), menuItems[i].grabbed_text);
>  	}
> +
> +	gtk_settings_set_string_property(gtk_settings_get_default(), "gtk-menu-bar-accel", "", "");
>  }
>  
>  static void viewer_ungrab(GtkWidget *vnc, GtkWidget *window)
> @@ -127,6 +129,8 @@ static void viewer_ungrab(GtkWidget *vnc
>  	for (i = 0 ; i < LAST_MENU; i++) {
>  		gtk_label_set_text_with_mnemonic(GTK_LABEL(menuItems[i].label), menuItems[i].ungrabbed_text);
>  	}
> +
> +	gtk_settings_set_string_property(gtk_settings_get_default(), "gtk-menu-bar-accel", "F10", "");
>  }
>  
>  static void viewer_shutdown(GtkWidget *src G_GNUC_UNUSED, void *dummy G_GNUC_UNUSED, GtkWidget *vnc)


Regards,
Daniel.
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux