diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-03-17 15:51:57 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-03-17 15:51:57 +0000 |
commit | 87f639629334c4592c3ba1011af0f691db1e7ed1 (patch) | |
tree | 2951a1db38c8c68e4d123138eeac21666b7450aa /vl.c | |
parent | 087edb503afebf184f07078900efc26c73035e98 (diff) | |
parent | 2bda66028b4962c36d4eabe2995edab12df93691 (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-3' into staging
gtk: warp bugfixes.
gtk: Allow to activate grab-on-hover from the command line
# gpg: Signature made Mon 17 Mar 2014 13:35:35 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
* remotes/kraxel/tags/pull-gtk-3:
gtk: Don't warp absolute pointer
gtk: Fix mouse warping with gtk3
gtk: Allow to activate grab-on-hover from the command line
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -143,6 +143,9 @@ int vga_interface_type = VGA_NONE; static int full_screen = 0; static int no_frame = 0; int no_quit = 0; +#ifdef CONFIG_GTK +static bool grab_on_hover; +#endif CharDriverState *serial_hds[MAX_SERIAL_PORTS]; CharDriverState *parallel_hds[MAX_PARALLEL_PORTS]; CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES]; @@ -2276,6 +2279,25 @@ static DisplayType select_display(const char *p) } else if (strstart(p, "gtk", &opts)) { #ifdef CONFIG_GTK display = DT_GTK; + while (*opts) { + const char *nextopt; + + if (strstart(opts, ",grab_on_hover=", &nextopt)) { + opts = nextopt; + if (strstart(opts, "on", &nextopt)) { + grab_on_hover = true; + } else if (strstart(opts, "off", &nextopt)) { + grab_on_hover = false; + } else { + goto invalid_gtk_args; + } + } else { + invalid_gtk_args: + fprintf(stderr, "Invalid GTK option string: %s\n", p); + exit(1); + } + opts = nextopt; + } #else fprintf(stderr, "GTK support is disabled\n"); exit(1); @@ -4404,7 +4426,7 @@ int main(int argc, char **argv, char **envp) #endif #if defined(CONFIG_GTK) case DT_GTK: - gtk_display_init(ds, full_screen); + gtk_display_init(ds, full_screen, grab_on_hover); break; #endif default: |