Statistics
| Branch: | Revision:

root / ui / gtk.c @ feature-archipelago

History | View | Annotate | Download (45 kB)

# Date Author Comment
2777ccc5 01/20/2014 08:30 pm Stefan Weil

gtk: Support keyboard translation for hosts running Windows

GTK uses different hardware keycodes on Windows hosts, so some special
handling is needed to get the QEMU keycode.

Signed-off-by: Stefan Weil <>

ef0dd982 12/02/2013 07:02 pm Stefan Weil

gtk: Replace conditional debug messages by trace methods

Signed-off-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

92f16236 08/27/2013 03:21 pm Stefan Weil

gtk: Remove unused include statements which are not portable

These include files don't exist for MinGW and are not needed for Linux
(and hopefully for other hosts as well), so remove them.

Signed-off-by: Stefan Weil <>

b1e749c0 07/22/2013 08:52 pm Jan Kiszka

gtk: Fix accelerator filtering

This is in fact very simply: When the input in grabbed, everything
should be exclusively passed to the guest - except it has our magic
CTRL-ALT modifier set. Then let GTK filter out those accels that are in
use. When checking the modifier state, we just need to filter out NUM...

f0875536 06/28/2013 10:03 pm Gerd Hoffmann

gtk: add support for surface conversion

Also use CAIRO_FORMAT_RGB24 unconditionally. DisplaySurfaces will never
ever see 8bpp surfaces. And using CAIRO_FORMAT_RGB16_565 for the 16bpp
case doesn't seem to be a good idea too.

<quote src="/usr/include/cairo/cairo.h">...

030b4b7d 06/17/2013 04:00 am Stefan Weil

gtk: Fix compiler warning (GTK 3 deprecated function)

With GTK 3, the function gdk_cursor_unref is deprecated:

qemu/ui/gtk.c: In function ‘gd_cursor_define’:
qemu/ui/gtk.c:380:5: error:
‘gdk_cursor_unref’ is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkcursor.h:233): Use 'g_object_unref' instead [-Werror=deprecated-declarations]...

4efeabbb 06/14/2013 01:28 pm Michael Tokarev

create qemu_openpty_raw() helper function and move it to a separate file

In two places qemu uses openpty() which is very system-dependent,
and in both places the pty is switched to raw mode as well.
Make a wrapper function which does both steps, and move all the...

787ba4f0 06/11/2013 10:45 pm Peter Wu

gtk: implement -full-screen

Aiming for GTK as replacement for SDL, a feature like -full-screen should also
be implemented.

Bringing the window into full-screen mode is done by activating the "Fullscreen"
menu item. This is done after showing the windows to make the cursor and menu...

bd5c51ee 06/10/2013 07:38 pm Michael Roth

qemu-char: don't issue CHR_EVENT_OPEN in a BH

When CHR_EVENT_OPENED was initially added, it was CHR_EVENT_RESET,
and it was issued as a bottom-half:

86e94dea5b740dad65446c857f6959eae43e0ba6

Which we basically used to print out a greeting/prompt for the...

f7da9c17 06/10/2013 07:36 pm Anthony Liguori

gtk: use better icon

The current icon looks pretty terrible rendered in Gnome. This
switches to a transparent SVG which looks much nicer.

Signed-off-by: Anthony Liguori <>

17139240 06/04/2013 12:14 am Anthony Liguori

gtk: don't use g_object_unref on GdkCursor

It's not a GObject.

Cc: Gerd Hoffman <>
Reported-by: Michael Tokarev <>
Signed-off-by: Anthony Liguori <>
---
v1 -> v2
- Fix summary to agree with code (Peter)

41686a96 06/03/2013 11:36 pm Anthony Liguori

gtk: don't resize window when enabling scaling

Signed-off-by: Anthony Liguori <>

7791dba3 05/14/2013 04:53 pm Paolo Bonzini

portability: pty.h is glibc-specific

This should fix building the GTK+ front-end on BSDs.

Signed-off-by: Paolo Bonzini <>
Message-id:
Signed-off-by: Anthony Liguori <>

b087143b 05/13/2013 05:52 pm Igor Mitsyanko

ui/gtk.c: do not use gdk_display_warp_pointer when GTK ver >3.0

Commit 9697f5d2d38e5dd1e64e8e0d64436e6d44e7b1fe "gtk: custom cursor support"
introduced unconditional usage of gdk_display_warp_pointer(). This function
is marked as deprecated since GTK-3.0, and triggers warning (error with -Werror)...

bf9b255f 04/26/2013 04:48 pm Anthony Liguori

gtk: refactor menu creation

Signed-off-by: Anthony Liguori <>

5209089f 04/25/2013 10:45 pm Gerd Hoffmann

console: zap ds arg from register_displaychangelistener

We don't have multiple DisplayStates any more,
so passing it in as argument is not needed.

Signed-off-by: Gerd Hoffmann <>

571253d4 04/23/2013 06:37 pm Ozan Çağlayan

ui/gtk: Use gtk_widget_get_window() to support both gtk2 and gtk3

This fixes build with gtk+-3.0.

Signed-off-by: Ozan Çağlayan <>
Message-id:
Signed-off-by: Anthony Liguori <>

e6f53fd5 04/17/2013 06:28 pm Markus Armbruster

Fix warnings suppressors to honor --disable-werror

Replace

#pragma GCC diagnostic ignored FOO
[Troublesome code...]
#pragma GCC diagnostic error FOO

by

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored FOO
[Troublesome code...]...
9697f5d2 04/16/2013 10:26 am Gerd Hoffmann

gtk: custom cursor support

Makes gtk ui play nicely with qxl (and vmware_svga)
as you can actually see your pointer now ;)

Signed-off-by: Gerd Hoffmann <>

284d1c6b 04/16/2013 10:26 am Gerd Hoffmann

console: allow pinning displaychangelisteners to consoles

DisplayChangeListener gets a new QemuConsole field, which can be set to
non-NULL before registering. This will pin the QemuConsole, so that
particular DisplayChangeListener will not follow console switches....

1dbfa005 04/16/2013 10:03 am Gerd Hoffmann

console: rename vga_hw_*, add QemuConsole param

Add QemuConsole parameter to vga_hw_*, so the interface allows to update
non-active consoles (the actual code can't handle this yet, see next
patch). Passing NULL is allowed and updates the active console, like...

dccfcd0e 04/15/2013 07:19 pm Paolo Bonzini

sysemu: avoid proliferation of include/ subdirectories

Signed-off-by: Paolo Bonzini <>

d819cdcc 04/02/2013 04:13 pm Stefan Weil

ui/gtk: Set QEMU window icon

The QEMU icon which is already used for SDL
is now also loaded by GTK.

Signed-off-by: Stefan Weil <>
Message-id:
Signed-off-by: Anthony Liguori <>

d8da9ee8 04/02/2013 04:13 pm Aurelien Jarno

gtk: make more messages translatable

Anthony Liguori <>
Signed-off-by: Aurelien Jarno <>
Reviewed-by: Anthony Liguori <>
Message-id:
Signed-off-by: Anthony Liguori <>

fee204fd 03/27/2013 05:26 pm Hans de Goede

qemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_open

To better reflect that it is for handling a backend being opened.

Signed-off-by: Hans de Goede <>
Message-id:
Signed-off-by: Anthony Liguori <>

6db253ca 03/25/2013 08:10 pm Jan Kiszka

gtk: Release modifier when graphic console loses keyboard focus

This solves, e.g., sticky ALT when selecting a GTK menu, switching to a
different window or selecting a different virtual console.

Signed-off-by: Jan Kiszka <>
Message-id: ...

bc2ed970 03/18/2013 11:21 am Gerd Hoffmann

console: zap displaystate from dcl callbacks

Now that nobody depends on DisplayState in DisplayChangeListener
callbacks any more we can remove the parameter from all callbacks.

Signed-off-by: Gerd Hoffmann <>

7c20b4a3 03/18/2013 11:21 am Gerd Hoffmann

console: fix displaychangelisteners interface

Split callbacks into separate Ops struct. Pass DisplayChangeListener
pointer as first argument to all callbacks. Uninline a bunch of
display functions and move them from console.h to console.c

Signed-off-by: Gerd Hoffmann <>

21ef45d7 03/18/2013 11:21 am Gerd Hoffmann

console: kill DisplayState->opaque

It's broken by design. There can be multiple DisplayChangeListener
instances, so they simply can't store state in the (single) DisplayState
struct. Try 'qemu -display gtk -vnc :0', watch it crash & burn.

With DisplayChangeListenerOps having a more sane interface now we can...

c12aeb86 03/18/2013 11:21 am Gerd Hoffmann

console: rework DisplaySurface handling [dcl/ui side]

Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListener
callbacks with a dpy_gfx_switch callback which notifies the ui code
when the framebuffer backing storage changes.

Signed-off-by: Gerd Hoffmann <>

9d9801cf 03/18/2013 11:21 am Gerd Hoffmann

gtk: stop using DisplayState

Rework DisplayStateListener callbacks to not use the DisplayState
any more. Factor out the window size handling to a separate function,
so the zoom callbacks can call that directly instead of abusing the
gd_switch DisplayStateListener callback for that....

702ec69c 03/13/2013 11:27 am Gerd Hoffmann

chardev: add vc support to qapi

This patch adds 'vc' support to qapi and also switches over the
vc chardev initialization to the new qapi code path.

Signed-off-by: Gerd Hoffmann <>

ef6413a2 02/26/2013 09:29 pm Daniel P. Berrange

Add compat macro for gtk_widget_get_realized

The gtk_widget_get_realized method only arrived in GTK 2.20,
so defined a compat macro for earlier GTK

Signed-off-by: Daniel P. Berrange <>
Message-id: ...

bc0477c7 02/26/2013 09:29 pm Daniel P. Berrange

Add compat for GDK_KEY_XXX symbols

The GDK_KEY_XXX symbols are new in GTK3 and only the most
recent GTK2 releases. Most versions of GTK2 have simply
used GDK_XXX

Signed-off-by: Daniel P. Berrange <>
Message-id: ...

fe43bca8 02/26/2013 09:29 pm Daniel P. Berrange

Replace expose-event handler with draw handler in GTK3

In GTK3 the 'expose-event' signal has been replaced by a new
'draw' signal. The only difference is that the latter will
pre-create the cairo drawing context & set the clip mask.
Since the drawing code is already structured in a nice way,...

530daf82 02/26/2013 09:29 pm Daniel P. Berrange

Replace gtk_menu_append with gtk_menu_shell_append

The gtk_menu_append method has long been deprecated in favour
of the gtk_menu_shell_append method. The former is now entirely
gone in GTK3, so switch all code to the latter which works on
both GTK2 and GTK3...

8906de76 02/26/2013 09:29 pm Daniel P. Berrange

Conditionalize use of gdk_display_warp_pointer

In GTK3 the gdk_display_warp_pointer method is deprecated.
Instead we should use gdk_device_warp on the GdkDevice
instead associated with the event being processed.

Signed-off-by: Daniel P. Berrange <>...

1ed76b59 02/26/2013 09:29 pm Daniel P. Berrange

Conditionalize use of gtk_widget_size_request

The gtk_widget_size_request method has been replaced by
the gtk_widget_get_preferred_size method in GTK3. Conditionally
call the new method in GTK3

Signed-off-by: Daniel P. Berrange <>
Message-id: ...

cba68834 02/26/2013 09:29 pm Daniel P. Berrange

Add compat for gdk_drawable_get_size on GTK3

GTK3 lacks the gdk_drawable_get_size method, so we create a
stub impl which gets the get_width/get_height mehtods instead

Signed-off-by: Daniel P. Berrange <>
Message-id: ...

66962f14 02/26/2013 09:29 pm Daniel P. Berrange

Remove use of gdk_drawable_get_{screen, display}

The gdk_drawable_get_screen and gdk_drawable_get_display
methods don't exist in GDK3. Fortunately, even on GTK2
they are not required - we can call the equivalent
gtk_widget_get_screen/gtk_widget_get_display methods...

655199da 02/26/2013 09:29 pm Daniel P. Berrange

Conditionalize use of gdk_keyboard_grab / gdk_keyboard_ungrab

On GTK3 there is support for multiple keyboard devices, so
rather than using gdk_keyboard_grab / gdk_keyboard_ungrab
we should iterate over all devices, grabbing each one in
turn

Signed-off-by: Daniel P. Berrange <>...

2a05485d 02/26/2013 09:29 pm Daniel P. Berrange

Conditionalize use of gdk_pointer_grab / gdk_pointer_ungrab

On GTK3 there is support for multiple pointer devices, so
rather than using gdk_pointer_grab / gdk_pointer_ungrab
we should iterate over all devices, grabbing each one in
turn

Signed-off-by: Daniel P. Berrange <>...

51572ab0 02/26/2013 09:29 pm Daniel P. Berrange

Remove use of GtkVBox in GTK3

The GtkVBox class is deprecated, in favour of just using the
GtkBox class directly. Eventually even GtkBox will be
deprecated in favour of GtkGrid, but that is a bigger fix
which can wait.

Signed-off-by: Daniel P. Berrange <>...

30e8f22b 02/22/2013 10:49 pm Jan Kiszka

gtk: Rename File to Machine menu and add pause, reset and power down items

This adds basic guest control commands to the "Machine" menu - a nice
added-value for the GTK UI.

We use "pause" as the term for stopping the machine here. So reword also
the related caption tag....

10409282 02/22/2013 10:49 pm Stefan Weil

ui/gtk: Use menu item from stock for full screen

This reduces the required translations and gives a nicer menu
with an icon.

The full screen menu item is no longer a check menu item.
A checked item is not visible in full screen mode,
so it is not needed for this special menu item....

28d2e5b2 02/22/2013 10:48 pm Stefan Weil

ui/gtk: Support versions of VTE before 0.26

This is needed for current Debian stable (Squeeze).

VTE versions before 0.26 did not support VtePty.

Lower the version requirement and use alternate code which works for Debian.

Signed-off-by: Stefan Weil <>...

c95e3080 02/22/2013 10:48 pm Kevin Wolf

Reenable -Wstrict-prototypes

One part of this patch reverts commit 22bc9a46, which disabled the
warning. The rest of it deals with the warning by adding a #pragma for
newer gcc and by disabling -Werror for compilers that can't deal with
the #pragma.

Signed-off-by: Kevin Wolf <>...

3f58eade 02/22/2013 03:17 pm Stefan Weil

ui/gtk: Fix build (missing include for setlocale)

At least for Ubuntu Linux locale.h is needed.

Signed-off-by: Stefan Weil <>
Message-id:
Signed-off-by: Anthony Liguori <>

73d4dc71 02/22/2013 12:34 am Anthony Liguori

gtk: suppress accelerators from the File menu when grab is active

If you're full screen, you probably expect Ctrl-Q to go to the guest,
not the host. I think restricting certain menus is the right way to
handle this generally speaking.

Signed-off-by: Anthony Liguori <>...

a4ccabcf 02/22/2013 12:34 am Anthony Liguori

ui: add basic GTK gui (v5)

This is minimalistic and just contains the basic widget infrastructure. The GUI
consists of a menu and a GtkNotebook. To start with, the notebook has its tabs
hidden which provides a UI that looks very similar to SDL with the exception of...

d861def3 02/22/2013 12:34 am Anthony Liguori

gtk: add virtual console support (v2)

This enables VteTerminal to be used to render the text consoles. VteTerminal is
the same widget used by gnome-terminal which means it's VT100 emulation is as
good as they come.

It's also screen reader accessible, supports copy/paste, proper scrolling and...

5104a1f6 02/22/2013 12:34 am Anthony Liguori

gtk: add support for input grabbing (v2)

There is a small deviation from SDL's behavior here. Instead of Ctrl+Alt
triggering grab, we now use Ctrl-Alt-g to trigger grab.

GTK will not accept Ctrl+Alt as an accelerator since it just consists of
modifiers. Having grab as a proper accelerator is important as it allows a user...

c6158483 02/22/2013 12:34 am Anthony Liguori

gtk: add support for screen scaling and full screen (v5)

Basic menu items to enter full screen mode and zoom in/out. Unlike SDL, we
don't allow arbitrary scaling based on window resizing. The current behavior
with SDL causes a lot of problems for me.

Sometimes I accidentally resize the window a tiny bit while trying to move it...

834574ea 02/22/2013 12:34 am Anthony Liguori

gtk: add translation support (v5)

This includes a de_DE translation from Kevin Wolf and an it translation from
Paolo Bonzini.

Cc: Paolo Bonzini <>
Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>
Signed-off-by: Anthony Liguori <>...