summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-window.c
Commit message (Collapse)AuthorAgeFilesLines
...
* window: auto-add hot key combos to "Send key" menuMarc-André Lureau2013-07-301-0/+73
| | | | | | | Auto-add hotkey combos to "Send key" menu. Because they are captured by virt-viewer, there is currently no way to pass them to the guest. https://bugzilla.redhat.com/show_bug.cgi?id=846006
* window: use dynamically generated menuMarc-André Lureau2013-07-301-2/+31
| | | | | Remove the static Glade menu in favour of the one generated dynamically already used for the toolbar.
* window: use a menu item property for key combosMarc-André Lureau2013-07-301-41/+53
| | | | | | | Allow to add dynamically generated key combos later on. This also removes the extra combo lookup, which used to be problematic due to translations etc.
* Remove restore window location codeMarc-André Lureau2013-07-301-14/+0
| | | | | | | | | It turns out gdk on win32 already restores properly the window size/positon when leaving fullscreen. On non-win32, the WM should do the job. This solves the first window having too small size after leaving fullscreen: https://bugzilla.redhat.com/show_bug.cgi?id=978362
* Make zoom-reset a global key bindingMarc-André Lureau2013-07-301-0/+2
|
* Realize the display when it's added to the windowMarc-André Lureau2013-07-301-0/+1
| | | | | Make sure the widget get some dimensions, so if the display is enabled before it is actually shown, it will have non-zero size
* Initialize fullscreen_monitor to invalid valueMarc-André Lureau2013-07-301-0/+1
| | | | This makes it easier to debug when a window has no associated monitor.
* app: always use maybe_quit()Marc-André Lureau2013-07-081-1/+1
| | | | | | | Now that closing a window is like quiting, there is no reason to ask or skip the confirm dialog depending on how you quit (menu/toolbar/window). https://bugzilla.redhat.com/show_bug.cgi?id=905684
* window: set display fullscreen stateMarc-André Lureau2013-07-051-2/+7
|
* Remove the "container" logic used by legacy browser pluginMarc-André Lureau2013-05-161-22/+0
|
* window: wait until mapped before fullscreenMarc-André Lureau2013-05-161-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | On RHEL6, when starting virt-viewer --full-screen, metacity will remaximize & force-fullscreen when leaving fullscreen, which prevents user from accessing window titlebar, and end up with an incorrect fullscreen state. Thanks Owen Taylor for help debugging this: <owen> elmarco: So the interesting thing here is that the "legacy" isn't triggered off a configure request to a particular size, mutter seems to constrain the window back to fullscreen size on its own when it sees a change to WM_NORMAL_HINTS <owen> commit 4943d79d6844af3f7fc0a15ceadb69d95c4c5c61 <owen> Author: Peter Bloomfield <PeterBloomfield@BellSouth.net> <owen> Date: Wed Jan 20 10:59:07 2010 -0500 <owen> prevent window self-maximisation <owen> Is not in rhel6 metacity <owen> So probably that's the main difference <owen> can you just make your program not fullscreen initially but wait until it's mapped? (gets map-event on the toplevel) <elmarco> owen that seems to work <owen> I don't have a better solution to offer - sorry for the ugliness (code and initial mapping appearance) https://bugzilla.redhat.com/show_bug.cgi?id=876445
* window: leave fullscreen on current windowMarc-André Lureau2013-05-141-1/+6
| | | | | | Since fdaa9b0ca, virt-viewer allows to fullscreen a single window. It feels more symetric to leave a single window from fullscreen as well, unless the application was started in fullscreen.
* window: fix send key menu popup positionMarc-André Lureau2013-05-141-3/+4
| | | | | | | | | Fix send key menu popup position. The current code wasn't correctly translating the menu coordinates based on the toplevel windows position, it was always using origin 0. https://bugzilla.redhat.com/show_bug.cgi?id=913601
* Allow to fullscreen and position display independentlyMarc-André Lureau2013-05-131-1/+4
| | | | | | | | | | Currently, going from window to fullscreen mode changes all display to fullscreen and realize automatic positionning on corresponding client monitor. However, it allows for much more flexibility to allow entering fullscreen on the current monitor each windows seperately. This way the user can decide on arbitrary monitor arrangement. https://bugzilla.redhat.com/show_bug.cgi?id=558241
* Do not restrict disabling display to != 0Marc-André Lureau2013-05-131-5/+1
| | | | | | | | | | | | | | | | Virt-viewer hides the display window 0, but doesn't disable the display. This is inconsistent with other displays, and prevent the guest OS from reconfiguring the main display. (for monitor 0 to be really disabled in multi-monitor guest, the agent need to support sparse monitor config. If not, the first display windows will be reopened to match the new un-sparse configuration) Note also the current Linux vdagent crashes when disabling 1st monitor, to be solved seperately. Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=958550
* Remove tab from source fileDaniel P. Berrange2013-05-011-1/+1
|
* Exit virt-viewer when trying to close any windowChristophe Fergeau2013-04-251-1/+1
| | | | | | | | Currently, in multi-screen scenarios, when closing one remote-viewer window, the corresponding screen gets disabled in the guest OS. This can be confusing as this behaves very differently from File/Quit. This commit will exit the whole application when the user tries to close one of virt-viewer window.
* gtk-3: Rework window size handlingHans de Goede2013-04-231-5/+21
| | | | | | | | | | | | | | | | With gtk-2 we have a special hack, where at first we make the virt-viewer-display request its actual size, and then once the window is mapped, we request a size of 50x50 to allow the user to resize the window to something smaller. With gtk-3 >= 3.8.1 this is broken, and the window gets resized to a smaller size as soon as we change the size request to 50x50. gtk-3 has a much better way of dealing with this in the form of widgets being able to specify both a minimal and a natural size. This patch changes virt-viewer to use this with gtk-3, instead of the gtk-2 hack. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: cleanup zoom handlingHans de Goede2013-04-231-30/+18
| | | | | | | | We've 3 similar zoom function zoom in / out / reset. in / out do not schedule a window resize when there is no display, where as reset does, which is not consistent. Also there is some duplicate code between them. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Use translations when looking up key combination to sendChristophe Fergeau2013-04-021-15/+15
| | | | | | | | | | | | virt_viewer_window_menu_send() compares the label of the menu item that was clicked on with a list of known labels to know which key combination should be sent to the guest. However, the menu label can be translated, but the table doing the label -> key combination mapping uses untranslated labels. This means the menu item will not send any key combination when clicked if translated. This can be observed with fr_FR where "Ctrl+Alt+_Del" is translated to "Ctrl+Alt+_Suppr".
* win32: maximize when leaving fullscreen the first timeMarc-André Lureau2013-04-021-0/+6
| | | | | | | | On windows, the client window may end up with a non-visible toolbar, and overlapping the windows statusbar. To workaround this, let's maximize the client the first time leaving fullscreen. https://bugzilla.redhat.com/show_bug.cgi?id=916810
* window: keep display size when leaving fullscreen for first timeMarc-André Lureau2013-03-261-0/+2
| | | | | | | | | If the application was started in fullscreen, window geometry has not been saved, since the window was not realized. We can unfullscreen and restore 1:1 window to match guest display size with virt_viewer_display_queue_resize() https://bugzilla.redhat.com/show_bug.cgi?id=916810
* window: save window geometry if the window is realizedMarc-André Lureau2013-03-261-6/+5
| | | | | Protect against re-entering fullscreen by moving pre-condition, keey the last know window geometry, since it stays valid.
* window: resize to monitor geometryMarc-André Lureau2013-03-261-7/+7
| | | | This code is potentially bad, we should set size request to the size of the monitor
* Forward directly key events to displayMarc-André Lureau2013-03-231-0/+12
| | | | | | | | | | | Even if the display is disabled, we should keep sending key events to guest. It can wake up from sleep for instance. There is a single widget per window, so we can directly send key events there. If the menu is active, it has the grab, so the window doesn't receive those key events. https://bugzilla.redhat.com/show_bug.cgi?id=870710
* virt-viewer-window: Don't use priv->display when it is NULLHans de Goede2013-03-211-1/+5
| | | | | | | | Add some missing checks for not having a display. Note that where functions should not be called (ie menu items should be disabled) I've used g_return_if_fail. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: Store the monitor locallyHans de Goede2013-03-211-4/+9
| | | | | | | | | | | | | | | | | | | | With commit 81ed9d13 "virt_viewer_window_enter_fullscreen: Pass in monitor for fullscreen window" we need a monitor number to determine where to move the window when going fullscreen. Since the VirtViewerDisplay needs to know the fullscreen monitor number too, to determine the fullscreen size it was being stored there. But we don't always have a display, leading to errors like: (remote-viewer:7996): remote-viewer-CRITICAL **: virt_viewer_display_get_monitor: assertion `VIRT_VIEWER_IS_DISPLAY(self)' failed And to the monitor number not always being stored. This patchset fixes this by storing the monitor number inside VirtViewerWindow, and passing it to VirtViewerDisplay only when we've a display. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt_viewer_window_enter_fullscreen: Pass in monitor for fullscreen windowHans de Goede2013-03-201-16/+20
| | | | | | | | | | Rather then passing in a move boolean + coordinates to move the window to for fullscreen mode, simply pass in the monitor, so that the underlying objects can also use the monitors size to determine the display size. Note: pass in -1 to use the monitor the window is currently on. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Fix send-key menu not showing in fullscreen with gtk3 (rhbz#913601)Hans de Goede2013-02-211-0/+2
| | | | | | | This should also fix the send-key menu showing in the wrong position with a gtk2 build, when the tooltray icon is clicked on the 2nd or higher monitor. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* build-sys: add --with-buildid to details build versionMarc-André Lureau2013-02-121-1/+1
| | | | | | Add a configure argument to append build version details, similar to what Daniel Berrange proposed in the "use finer package version in mingw-virt-viewer" thread on the ML.
* 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
|