summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-window.c
Commit message (Collapse)AuthorAgeFilesLines
* virtviewer-window: Make sure fullscreen window stays on the same monitorHans de Goede2013-02-111-1/+14
| | | | | | | | | | | | | Sometimes the guest may shortly disable and then re-enable a monitor while in fullscreen mode, this happens for example when changing display resolution through gnome-display-properties inside the guest. This causes the client window-manager to remap the window, and this can cause it to end up on a different monitor. This patch fixes this by remembering the position the window is places at when going fullcreen and moving it there again when its gets (re-)shown. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Improve check for overridden grab key combinationChristophe Fergeau2012-12-201-3/+3
| | | | | | | | | remote-viewer can either use the default grab/ungrab handled by spice-gtk, or override it and use the standard gtk+ accelerator mechanism. However, the code currently assumes that if any accelerator is set in remote-viewer, then the grab key has been overridden. This commit makes sure the grab key is actually overridden before assuming so.
* Make sure png screenshots have a .png extensionsChristophe Fergeau2012-11-151-2/+10
| | | | | | When falling back to saving to .png, the filename might not end with .png. This commit appends the .png extension to the screenshot filename if it's missing.
* Allow to save to other formats than pngChristophe Fergeau2012-11-151-2/+53
| | | | | | Currently, the screenshots can only be saved to png. This commit checks if the file extension is a known one, and will save to this format if it is. Otherwise it will fallback to saving to png.
* Set a default dir/name for screenshotsChristophe Fergeau2012-11-151-3/+5
| | | | | | | It makes sense for the screenshots to be saved in ~/Images, especially as otherwise the filechooser will display 'recent documents' to which we cannot save. This commit also sets the default screenshot name to 'Screenshot'.
* Do not resize window to minimum when toggling auto-resizeMarc-André Lureau2012-10-161-6/+7
| | | | | | | | | | | | | | | The virt_viewer_display_idle() will queue a resize event that will result in display size requisition of 50x50. If we later resize the window to 1x1 in virt_viewer_window_resize() we end up with a tiny window. It is legitimate not to force that 1x1 window resize when toggling the option. After the rest of the logic in virt_viewer_window_resize(), if the remote desktop ends up being resize, that will trigger another virt_viewer_set_desktop_size() and finally change the window size appropriately. https://bugzilla.redhat.com/show_bug.cgi?id=856610
* Show status page by default if display not readyMarc-André Lureau2012-07-231-1/+5
| | | | Switch back to status page if display is not ready.
* Add virt_viewer_window_get_display()Marc-André Lureau2012-07-231-2/+11
| | | | Getter used in following changes.
* Add a DISABLED display hintMarc-André Lureau2012-07-231-0/+12
| | | | | | | | This flag will help to track whether the display has been removed/closed and whether it really has a valid display. Ready in contrast, is used to "hide" temporarily the display (when starting or redrawing the display, to avoid artifacts)
* Use virt_viewer_connect_object() for displayMarc-André Lureau2012-07-231-12/+12
| | | | | | | When display is released, detach signal automatically. Fix various crash related to not cleaning up signal handlers properly, due to no longer 1-1 only relation between display widget and channel.
* Run-time check values before doing bad computationMarc-André Lureau2012-07-231-0/+5
|
* Turn display:show-hint into flags typeMarc-André Lureau2012-07-231-1/+4
|
* Fix various memory leaksChristophe Fergeau2012-06-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==25063== 59 bytes in 1 blocks are definitely lost in loss record 5,163 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356) ==25063== by 0x41F40A: connected (remote-viewer-main.c:186) ==25063== by 0x3DE400F663: g_closure_invoke (gclosure.c:777) ==25063== by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547) ==25063== by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296) ==25063== by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389) ==25063== by 0x41AA53: reemit_signal_VOID (virt-viewer-session-ovirt.c:211) ==25063== by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840) ==25063== by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207) ==25063== by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389) ==25063== 14 bytes in 1 blocks are definitely lost in loss record 623 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82) ==25063== by 0x3DE3882F1A: g_vasprintf (stdio2.h:199) ==25063== by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509) ==25063== by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535) ==25063== by 0x40CBAE: virt_viewer_app_update_pretty_address (virt-viewer-app.c:1538) ==25063== by 0x40FB55: virt_viewer_app_free_connect_info (virt-viewer-app.c:1707) ==25063== by 0x40FBE9: virt_viewer_app_dispose (virt-viewer-app.c:1291) ==25063== by 0x3DE40144F7: g_object_unref (gobject.c:2981) ==25063== by 0x40C31A: main (remote-viewer-main.c:336) ==25063== 10 bytes in 1 blocks are definitely lost in loss record 491 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82) ==25063== by 0x3DE3882F1A: g_vasprintf (stdio2.h:199) ==25063== by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509) ==25063== by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535) ==25063== by 0x40DE36: window_update_menu_displays_cb (virt-viewer-app.c:1640) ==25063== by 0x3DE383833F: g_hash_table_foreach (ghash.c:1524) ==25063== by 0x3DE400F663: g_closure_invoke (gclosure.c:777) ==25063== by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547) ==25063== by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296) ==25063== by 0x3DE40287C1: g_signal_emit (gsignal.c:3352) ==25063== by 0x5772F95: gtk_widget_show (gtkwidget.c:3225) ==25063== 8,431 (72 direct, 8,359 indirect) bytes in 1 blocks are definitely lost in loss record 9,468 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE38616B1: g_slice_alloc (gslice.c:1003) ==25063== by 0x3DE3861C05: g_slice_alloc0 (gslice.c:1029) ==25063== by 0x3DE402F96F: g_type_create_instance (gtype.c:1872) ==25063== by 0x3DE40147A7: g_object_constructor (gobject.c:1849) ==25063== by 0x3DE4016260: g_object_newv (gobject.c:1632) ==25063== by 0x3DE40168AB: g_object_new (gobject.c:1542) ==25063== by 0x40C4BD: virt_viewer_util_load_ui (virt-viewer-util.c:41) ==25063== by 0x40C7EB: virt_viewer_auth_collect_credentials (virt-viewer-auth.c:43) ==25063== by 0x41B391: authenticate_cb (virt-viewer-session-ovirt.c:430) ==25063== by 0x3458C05E8F: ffi_call_unix64 (unix64.S:75) ==25063== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 3,962 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE38616B1: g_slice_alloc (gslice.c:1003) ==25063== by 0x3DE38629F2: g_slist_append (gslist.c:222) ==25063== by 0x41483C: virt_viewer_window_init (virt-viewer-window.c:323) ==25063== by 0x3DE402FA05: g_type_create_instance (gtype.c:1892) ==25063== by 0x3DE40147A7: g_object_constructor (gobject.c:1849) ==25063== by 0x3DE4015D70: g_object_newv (gobject.c:1713) ==25063== by 0x3DE401655F: g_object_new_valist (gobject.c:1830) ==25063== by 0x3DE4016893: g_object_new (gobject.c:1545) ==25063== by 0x40DA34: virt_viewer_app_window_new (virt-viewer-app.c:590) ==25063== by 0x40E300: virt_viewer_app_constructor (virt-viewer-app.c:1336) ==30355== 4 bytes in 1 blocks are definitely lost in loss record 53 of 9,267 ==30355== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==30355== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==30355== by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356) ==30355== by 0x3DE40360FC: value_copy_string (gvaluetypes.c:276) ==30355== by 0x3DE40340CA: g_value_transform (gvalue.c:535) ==30355== by 0x3FDAE621DD: gdk_screen_get_setting (gdkevents-x11.c:3022) ==30355== by 0x3FDB3C7415: gtk_settings_get_property (gtksettings.c:1152) ==30355== by 0x3DE4017A74: g_object_get_property (gobject.c:1289) ==30355== by 0x414991: virt_viewer_window_disable_modifiers (virt-viewer-window.c:616) ==30355== by 0x415922: virt_viewer_window_keyboard_grab (virt-viewer-window.c:931) ==30355== by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840) ==30355== by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207)
* Ensure windows are destroyed when display closesDaniel P. Berrange2012-05-041-0/+11
| | | | | | | | | | | When running virt-viewer with the --reconnect argument, when the session closes, the VirtViewerWindow instances were being freed, but not the GtkWindow itself. So the orphaned window stayed around doing nothing. The GtkBuilder instance was also leaked. Fix these two leaks & also add some debugging to help future troubleshooting
* Fix close of VNC displaysDaniel P. Berrange2012-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When clicking the close button on a virt-viewer window with a VNC session open, while the VNC session terminates, the window does not go away. The problem is that the virt_viewer_session_vnc_disconnected method never gets invoked. The close button triggers a call to virt_viewer_session_clear_displays which unrefs the VirtViewerDisplayVnc instance. This in turn triggers a call to gtk_container_destroy, which destroys all widgets it contains, ie the VncDisplay * object. With the VncDisplay object in its dispose phase, no signals will ever be emitted, thus the 'vnc-disconnected' signal never gets seen. The design issue is that VirtViewerDisplayVnc is assuming it owns the VncDisplay, whereas in fact the real owner is the VirtViewerSessionVnc object. The solution is to introduce a new virt_viewer_display_close method which can be used to de-parent the widget before VirtViewerDisplay is unref'd. The VirtViewerSessionVnc object also needs to hold a full ref on the VncDisplay object, not merely a floating reference * virt-viewer-display-spice.c, virt-viewer-display.c, virt-viewer-display.h: Add virt_viewer_display_close * virt-viewer-display-vnc.c: Deparent VNC widget in virt_viewer_display_close impl * virt-viewer-session-vnc.c: Improve logging * virt-viewer-session.c: Call virt_viewer_display_close before unrefing display * virt-viewer-window.c: Improve logging Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Disable mnemonics via gtk-enable-mnemonics settingsMarc-André Lureau2012-04-011-33/+10
| | | | | | | This has 2 advantages, and I can't figure any drawback: - it fixes the issue of mnemonic hints being draw when pressing Alt key (character underlined), even when they were disabled. - it simplifies the code :)
* Disable menu items that would fail when there is no displayMarc-André Lureau2012-04-011-0/+18
|
* Display correct key bindings to release cursorMarc-André Lureau2012-03-211-3/+16
| | | | | If the accels are enabled (with Spice controller custom bindings), show the configured keybinding in the title bar.
* spice: implement --fullscreen=auto-confMarc-André Lureau2012-03-211-8/+10
| | | | | | | - auto-conf is an optionnal argument to --fullscreen: it will set the guest display configuration to match the client display configuration, by sending the client monitors size and position to capable guests.
* Add a send-key menu in fullscreenMarc-André Lureau2012-03-081-1/+57
|
* virt-viewer-window: Don't try to resize non visible windowsHans de Goede2012-03-071-0/+10
| | | | | | | | | | | Trying to resize not visible windows leads to the following being printed to the console: Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' This gets triggered by the gdk_screen_get_monitor_geometry() call in virt_viewer_window_resize() Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: Add show / hide utility functionsHans de Goede2012-03-071-0/+12
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: Move checks before resize to virt_viewer_window_resizeHans de Goede2012-03-071-5/+5
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: Remove useless tests for priv->window != NULLHans de Goede2012-03-071-7/+1
| | | | | | | priv->window gets set on init and never unset, so there is no need to check for it. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: Add a USB device selection to the fullscreen menu (v2)Hans de Goede2012-03-061-0/+10
| | | | | | | | | Note this button only gets shown on USB redir capable virtual machines. Changes in v2: -Use gtk_widget_set_visible for simpler code Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* window: Call virt_viewer_app_quit instead of gtk_main_quitHans de Goede2012-03-061-1/+1
| | | | | | | When quiting from the fullscreen menu call virt_viewer_app_quit instead of gtk_main_quit so that the session gets properly disconnected before quiting. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: Use a borrowed reference to appHans de Goede2012-03-061-6/+1
| | | | | | | | | | Before this patch there was a cyclic reference between VirtViewerApp and VirtViewerWindow, since all VirtViewerWindows are created / destroyed by VirtViewerApp it is safe to assume that lifetime of VirtViewerApp >= VirtViewerWindow, so VirtViewerWindow can take a borrowed reference breaking the circle, and allowing proper cleanup on exit. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Don't attempt to translate ""Christophe Fergeau2012-03-051-2/+2
| | | | | | | The empty string has a magic meaning for gettext, it's used to store a translation header with all kind of information about the po file. This is not something we want to use as a window title, so change to _("") to "" when we want an empty string.
* Fix compilation with gtk 2.18Marc-André Lureau2012-03-011-20/+1
|
* Small code simplificationMarc-André Lureau2012-02-221-2/+2
|
* Use the accelgroup to define key bindingsMarc-André Lureau2012-02-221-0/+18
| | | | With accelgroups, we can redefine the keybindings
* Add hidden menu smartcard remove/insert and release-cursorMarc-André Lureau2012-02-221-0/+25
|
* Do not disable accelgroup if accels are enabledMarc-André Lureau2012-02-221-0/+10
|
* Set transient parent for screenshot dialogDaniel P. Berrange2012-02-081-11/+13
|
* Do not resize guest desktop if !auto-resizeMarc-André Lureau2012-02-081-0/+3
| | | | | | | | | If auto-resize is enabled, the guest desktop size will be resized to match current window*zoom size. This can be a problem if the user explicitely set the desktop size to a different resolution and want to keep it. Disabling auto-resize sounds like a simple way to allow that.
* Ensure About dialog has transient hints setupDaniel P. Berrange2012-02-081-0/+3
|
* Update copyright headersDaniel P. Berrange2012-02-061-2/+2
|
* Convert TABS to spaces & reindent everywhereDaniel P. Berrange2012-02-061-561/+560
|
* Only make the USB device selection sensitive when the vm is USB capableHans de Goede2012-02-061-0/+13
|
* Add a menu entry for USB device selectionHans de Goede2012-02-061-0/+9
|
* Add a few property getters, used by controllerMarc-André Lureau2012-01-301-0/+9
| | | | | | - virt_viewer_app_get_windows() - virt_viewer_window_get_builder() - "VirtViewerSessionSpice:spice-session" property
* build: replace deprecated functionsMarc-André Lureau2012-01-301-1/+1
|
* Require GTK-VNC 0.4.3 and remove redundant realize() callDaniel P. Berrange2011-11-071-2/+0
| | | | | Remove call to gtk_widget_realize for the GTK-VNC widget. Requires GTK-VNC >= 0.4.3
* Fix broken keycombos for F9->F12 menuDaniel P. Berrange2011-10-111-4/+4
| | | | | The table for sending C-A-Fn to guests had messed up mappings for F9->F12
* Fix setting of window title with --waitDaniel P. Berrange2011-10-111-0/+1
| | | | | | When waiting for a VM to appear or start, set the initial window title to the command line arg. When the VM actually appears then update it to the real VM name
* Propagate primary window zoom level to secondary windowsDaniel P. Berrange2011-09-161-0/+8
| | | | | | Ensure that all windows get a default zoom level of 100. Propagate the primary window's zoom level to all secondary windows when initially creating them
* Fix setting of initial zoom level on displayDaniel P. Berrange2011-08-161-0/+2
|
* Mark exported function for gtkbuild to lookup on WindowsMarc-André Lureau2011-08-041-10/+10
|
* Make title more translatable and using application nameMarc-André Lureau2011-08-041-8/+15
|
* Fix fullscreen should hide taskbar on WindowsMarc-André Lureau2011-08-041-0/+10
|