console: Hook QemuConsoles into qom tree
Put them named "console[$index]" below "/backend", so you canlist & inspect them via QMP.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Message-id: 1372150171-8707-1-git-send-email-kraxel@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: add support for surface conversion
Also use CAIRO_FORMAT_RGB24 unconditionally. DisplaySurfaces will neverever see 8bpp surfaces. And using CAIRO_FORMAT_RGB16_565 for the 16bppcase doesn't seem to be a good idea too.
<quote src="/usr/include/cairo/cairo.h">...
Merge remote-tracking branch 'spice/spice.v71' into staging
spice: Add -spice disable-agent-file-transfer cmdline option (rhbz#961850)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
vnc: use booleans for vnc_connect, vnc_listen_read and vnc_display_add_client
Some arguments to these functions are booleans - either by declaration,or by actual usage, but sometimes value of 0 or 1 is passed for a bool,and sometimes it is declared as int but a bool value, or true/false,...
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]...
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...
gtk: implement -full-screen
Aiming for GTK as replacement for SDL, a feature like -full-screen should alsobe 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...
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...
gtk: use better icon
The current icon looks pretty terrible rendered in Gnome. Thisswitches to a transparent SVG which looks much nicer.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: don't use g_object_unref on GdkCursor
It's not a GObject.
Cc: Gerd Hoffman <kraxel@redhat.com>Reported-by: Michael Tokarev <mjt@tls.msk.ru>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>---v1 -> v2 - Fix summary to agree with code (Peter)
gtk: don't resize window when enabling scaling
cocoa: Avoid deprecated NSOpenPanel beginSheetForDirectory
In MacOSX 10.6 and above the NSOpenPanel beginSheetForDirectorymethod is deprecated. Use the preferred replacements instead.We retain the original code for use on earlier MacOSX versionsbecause the replacement methods don't exist before 10.6....
cocoa: Avoid deprecated NSOpenPanel filename method
Avoid the NSOpenPanel filename method (deprecated in MacOSX 10.6)in favour of using the URL method and extracting the path from theresulting NSUrl object.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
cocoa: Avoid deprecated CPS* functions
The functions CPSGetCurrentProcess and CPSEnableForegroundOperationare deprecated in newer versions of MacOSX and cause warning messagesto be logged to the system log. Instead, use the new preferred methodof promoting our console process up to a graphical app with menubar...
cocoa: Fix leaks of NSScreen and NSConcreteMapTable
On MacOSX 10.8 QEMU provokes system log messages:11/03/2013 17:03:29.998 qemu-system-arm42586: objc42586: Object0x7ffbf9c2f3b0 of class NSScreen autoreleased with no pool in place - justleaking - break on objc_autoreleaseNoPool() to debug...
ui/input.c: replace magic numbers with macros
It's clearer to use defined macros than magic numbers.
Signed-off-by: Amos Kong <akong@redhat.com>Reviewed-by: Lei Li <lilei@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
vnc: Make ledstate comparison before modifiers updated
The ledstate should be compared before modifiers updated,otherwise the ledstate would be the same as current_led_state.
Reported-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>...
portability: pty.h is glibc-specific
This should fix building the GTK+ front-end on BSDs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1368533121-30796-1-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 functionis marked as deprecated since GTK-3.0, and triggers warning (error with -Werror)...
TLS support for VNC Websockets
Added TLS support to the VNC QEMU Websockets implementation.VNC-TLS needs to be enabled for this feature to be used.
The required certificates are specified as in case of VNC-TLSwith the VNC parameter "x509=<path>".
If the server certificate isn't signed by a rooth authority it needs to...
vnc: Support for LED state extension
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366867752-11578-3-git-send-email-lilei@linux.vnet.ibm.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: Adjust lock state sync logic with VNC_FEATURE_LED_STATE
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366867752-11578-4-git-send-email-lilei@linux.vnet.ibm.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: Add SCROLL lock key to kbd_leds
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366867752-11578-2-git-send-email-lilei@linux.vnet.ibm.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: refactor menu creation
console: qom-ify QemuConsole
Just the minimal bits to turn QemuConsoles into Objects.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: add device link to QemuConsoles
So it is possible to figure which qemu console displays which device.
console: add qemu_console_lookup_by_device
Look up the QemuConsole for a given device, using the new link.
console: switch ppm_save to qemu_open
... so it works with fdset.
console: zap ds arg from register_displaychangelistener
We don't have multiple DisplayStates any more,so passing it in as argument is not needed.
console: add dummy surface for guests without graphic card
So users get a notification instead of a crash.
input: make QEMUPutLEDEntry + QEMUPutMouseEntry private
There is no need for anybody outside ui/input.c to access thestruct elements. Move the definitions, leaving only the typedefsin the header files.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
input: introduce keyboard handler list
Add a linked list of keyboard handlers. Added handlers will goto the head of the list. Removed handlers will be zapped fromthe list. The head of the list will be used for events.
This fixes the keyboard-dead-after-usb-kbd-unplug issue, key events...
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 <ozancag@gmail.com>Message-id: 1366711402-1750-1-git-send-email-ozancag@gmail.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'luiz/queue/qmp' into staging
ui/cocoa.m: Fix recent compile breakage
Fix failures to compile introduced by recent console commits1dbfa00503, 81c0d5a6) which removed is_graphic_console() andvga_hw_update() without updating the cocoa UI backend to match.
monitor: fix the wrong order of releasing keys
(qemu) sendkey ctrl_r-scroll_lock-scroll_lock
Executing this command could not let Windows guest panic, it caused bythe wrong order of releasing keys. This problem was introduced bycommit e4c8f004c55d9da3eae3e14df740238bf805b5d6....
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...]...
gtk: custom cursor support
Makes gtk ui play nicely with qxl (and vmware_svga)as you can actually see your pointer now ;)
xen: re-enable refresh interval reporting for xenfb
xenfb informs the guest about the gui refresh interval so it can avoidpointless work. That logic was temporarely disabled for theDisplayState reorganization. Restore it now, with a proper interfacefor it....
console: add qemu_console_is_*
console: allow pinning displaychangelisteners to consoles
DisplayChangeListener gets a new QemuConsole field, which can be set tonon-NULL before registering. This will pin the QemuConsole, so thatparticular DisplayChangeListener will not follow console switches....
console: add GraphicHwOps
Pass a single GraphicHwOps struct pointer to graphic_console_init,instead of a bunch of function pointers.
console: gui timer fixes
Make gui update rate adaption code in gui_update() actually work.Sprinkle in a tracepoint so you can see the code at work. Removethe update rate adaption code in vnc and make vnc simply use thegeneric bits instead.
console: rename vga_hw_*, add QemuConsole param
Add QemuConsole parameter to vga_hw_*, so the interface allows to updatenon-active consoles (the actual code can't handle this yet, see nextpatch). Passing NULL is allowed and updates the active console, like...
console: give each QemuConsole its own DisplaySurface
Go away from the global DisplaySurface, give one to each QemuConsoleinstead. With this patch applied it is possible to callgraphics_hw_* functions with qemu consoles which are not the currentforeground console....
console: simplify screendump
Screendumps are alot simpler as we can update non-activeQemuConsoles now. So we only need to update the QemuConsolewe want write out, then dump the DisplaySurface content intoa ppm file. Done.
No console switching needed. No special support code in the...
console: zap g_width + g_height
We have a surface per QemuConsole now, so there is no need to keeptrack of the QemuConsole size any more as we can query the surfacesize directly at any time.
console: move gui_update+gui_setup_refresh from vl.c into console.c
Pure code motion, no functional changes.
console: make DisplayState private to console.c
With gui_* being moved to console.c nobody outside console.c needsaccess to DisplayState fields any more. Make the struct private.
pixman: add qemu_pixman_color()
Helper function to map qemu colors (32bit integer + matching PixelFormat)into pixman_color_t.
pixman: render vgafont glyphs into pixman images
Add helper functions to create pixman mask images for glyphsand to render these glyphs into a pixman image.
console: use pixman for fill+blit
Zap homegrown pixel shuffeling code, use pixman calls instead.
console: use pixman for font rendering
Zap homegrown font rendering code, use pixman calls instead.
console: switch color_table_rgb to pixman_color_t
Now that all text console rendering uses pixman we can easilyswitch the color tables to use pixman_color_t directly.
console: add trace events
console: displaystate init revamp
We have only one DisplayState, so there is no need for the "next" linking, rip it. Also consolidate all displaystate initializationinto init_displaystate(). This function is called by vl.c aftercreating the devices (and thus all QemuConsoles) and before...
sysemu: avoid proliferation of include/ subdirectories
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()
The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.Rename to qemu_set_nonblock() just like qemu_set_cloexec().
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
ui/gtk: Set QEMU window icon
The QEMU icon which is already used for SDLis now also loaded by GTK.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Message-id: 1364653300-26813-1-git-send-email-sw@weilnetz.deSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: make more messages translatable
Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1364836326-8707-2-git-send-email-aurelien@aurel32.netSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 <hdegoede@redhat.com>Message-id: 1364292483-16564-3-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: Release modifier when graphic console loses keyboard focus
This solves, e.g., sticky ALT when selecting a GTK menu, switching to adifferent window or selecting a different virtual console.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Message-id: 514F417A.6010908@web.de...
ui/cocoa.m: Fix compile failures introduced by recent console changes
Fix various compilation failures introduced by the recent consolechanges.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1363638501-29603-1-git-send-email-peter.maydell@linaro.org...
sdl: stop using DisplayState
Rework DisplayStateListener callbacks to not use the DisplayStateany more.
spice: stop using DisplayState
cocoa: stop using DisplayState
console: zap displaystate from dcl callbacks
Now that nobody depends on DisplayState in DisplayChangeListenercallbacks any more we can remove the parameter from all callbacks.
console: stop using DisplayState in gfx hardware emulation
Use QemuConsole instead. Updates interfaces in console.[ch] and adaptsgfx hardware emulation code.
console: zap color_table
qemu_create_surface hands out 32bpp surfaces.So we can just use color_table_rgb directly.
console: remove ds_get_* helper functions
Switch the few remaining ds_get_* uses in console.c over to the newsurface_* accessors.
While doing so tripped over a few leftovers from commita93a4a226a2afba147ba5df688b85d844f537c68 (code using depth == 0as indicator for textmode rendering). Fixed them up....
console: fix displaychangelisteners interface
Split callbacks into separate Ops struct. Pass DisplayChangeListenerpointer as first argument to all callbacks. Uninline a bunch ofdisplay functions and move them from console.h to console.c
console: kill DisplayState->opaque
It's broken by design. There can be multiple DisplayChangeListenerinstances, so they simply can't store state in the (single) DisplayStatestruct. Try 'qemu -display gtk -vnc :0', watch it crash & burn.
With DisplayChangeListenerOps having a more sane interface now we can...
spice: zap sdpy global
DisplayChangeListener is passed now to all DisplayChangeListenerOpscallbacks, so we can use that to access the spice display state andkill the sdpy global variable.
sdl: drop dead code
DisplayAllocator removal (commit187cd1d9f30d13f0d0ef682e4d91cfa3e4cbd472) made this a nop.
console: rework DisplaySurface handling [vga emu side]
Decouple DisplaySurface allocation & deallocation from DisplayState.Replace dpy_gfx_resize + dpy_gfx_setdata with a dpy_gfx_replace_surfacefunction.
This handles the graphic hardware emulation.
console: rework DisplaySurface handling [dcl/ui side]
Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListenercallbacks with a dpy_gfx_switch callback which notifies the ui codewhen the framebuffer backing storage changes.
gtk: stop using DisplayState
Rework DisplayStateListener callbacks to not use the DisplayStateany more. Factor out the window size handling to a separate function,so the zoom callbacks can call that directly instead of abusing thegd_switch DisplayStateListener callback for that....
vnc: stop using DisplayState
chardev: add vc support to qapi
This patch adds 'vc' support to qapi and also switches over thevc chardev initialization to the new qapi code path.
qemu-char: move text console init to console.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 17cefde0a8d7807294bab95e93c3328a20d3f2ed.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 <berrange@redhat.com>Message-id: 1361805646-6425-13-git-send-email-berrange@redhat.com...
Add compat for GDK_KEY_XXX symbols
The GDK_KEY_XXX symbols are new in GTK3 and only the mostrecent GTK2 releases. Most versions of GTK2 have simplyused GDK_XXX
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Message-id: 1361805646-6425-14-git-send-email-berrange@redhat.com...
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 willpre-create the cairo drawing context & set the clip mask.Since the drawing code is already structured in a nice way,...
Ensure x_keymap.o is built when GTK is enabled
The x_keymap.o file is required by both GTK and SDL builds,so it must be explicitly listed as a GTK dep to ensure thelinker works when SDL is disabled
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>...
Replace gtk_menu_append with gtk_menu_shell_append
The gtk_menu_append method has long been deprecated in favourof the gtk_menu_shell_append method. The former is now entirelygone in GTK3, so switch all code to the latter which works onboth GTK2 and GTK3...
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 GdkDeviceinstead associated with the event being processed.
Conditionalize use of gtk_widget_size_request
The gtk_widget_size_request method has been replaced bythe gtk_widget_get_preferred_size method in GTK3. Conditionallycall the new method in GTK3
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Message-id: 1361805646-6425-9-git-send-email-berrange@redhat.com...
Add compat for gdk_drawable_get_size on GTK3
GTK3 lacks the gdk_drawable_get_size method, so we create astub impl which gets the get_width/get_height mehtods instead
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Message-id: 1361805646-6425-2-git-send-email-berrange@redhat.com...
Remove use of gdk_drawable_get_{screen, display}
The gdk_drawable_get_screen and gdk_drawable_get_displaymethods don't exist in GDK3. Fortunately, even on GTK2they are not required - we can call the equivalentgtk_widget_get_screen/gtk_widget_get_display methods...
Conditionalize use of gdk_keyboard_grab / gdk_keyboard_ungrab
On GTK3 there is support for multiple keyboard devices, sorather than using gdk_keyboard_grab / gdk_keyboard_ungrabwe should iterate over all devices, grabbing each one inturn
Conditionalize use of gdk_pointer_grab / gdk_pointer_ungrab
On GTK3 there is support for multiple pointer devices, sorather than using gdk_pointer_grab / gdk_pointer_ungrabwe should iterate over all devices, grabbing each one inturn
Remove use of GtkVBox in GTK3
The GtkVBox class is deprecated, in favour of just using theGtkBox class directly. Eventually even GtkBox will bedeprecated in favour of GtkGrid, but that is a bigger fixwhich can wait.
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 niceadded-value for the GTK UI.
We use "pause" as the term for stopping the machine here. So reword alsothe related caption tag....
ui/gtk: Use menu item from stock for full screen
This reduces the required translations and gives a nicer menuwith 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....
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 <sw@weilnetz.de>...
Reenable -Wstrict-prototypes
One part of this patch reverts commit 22bc9a46, which disabled thewarning. The rest of it deals with the warning by adding a #pragma fornewer gcc and by disabling -Werror for compilers that can't deal withthe #pragma.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
ui/gtk: Fix build (missing include for setlocale)
At least for Ubuntu Linux locale.h is needed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Message-id: 1361514481-26164-1-git-send-email-sw@weilnetz.deSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 tohandle this generally speaking.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...