597 Commits

Author SHA1 Message Date
Hans de Goede
a07277f28b virt-viewer-app: Always allow users to close displays from the displays menu
Marking display menu items as non sensitive for shown displays make no sense,
since the user can always close them through the window-manager.

Having a window for a display shown when the display is not selectable nor
ready, can happen when the agent goes away. This happens for example when using
a dual monitor config with a Linux guest and then switching to a text console
inside the guest.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-04-05 16:04:44 +02:00
Christophe Fergeau
9cf264c2cf Use translations when looking up key combination to send
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".
2013-04-02 16:01:31 +02:00
Marc-André Lureau
4da48209cf win32: maximize when leaving fullscreen the first time
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
2013-04-02 13:53:32 +02:00
Marc-André Lureau
29056f9c03 Do not enable extra monitors until they are explicitely enabled 2013-03-28 19:36:57 +01:00
Marc-André Lureau
23acfa582d Make display menu item sensitive again
Even if the display has not been explicitely disabled, as long as
the display is "selectable"

Fix regression introduced with "Do not disable extra client monitors"
3b981d953f270662360e5b0c78183924276a18ed
2013-03-28 19:32:53 +01:00
Marc-André Lureau
081f2decbe Remove gtk_window_present() call
gtk_window_present() may forcefully call gdk_window_show(), which will
call ShowWindow(). Although gdk call is not supposed to move the
window if it's already visible, it does restore the window position on
Vista+. For example, a snapped window will be moved back to its
previous position.

Gtk+ ShowWindow() is currently using SW_SHOWNOACTIVATE, it should
probably use SW_SHOWNA instead, but that didn't help anyway for a
snapped window.

Since virt_viewer_window_show() already ensure the window is visible,
I am not sure why gtk_window_present() is there in the first place, so
just remove it.

https://bugzilla.redhat.com/show_bug.cgi?id=912713
2013-03-26 17:06:07 +01:00
Marc-André Lureau
1e810a543e Add gtk_widget_get_realized() define for old gtk+
Fix build with gtk < 2.20
2013-03-26 15:07:16 +01:00
Marc-André Lureau
006fcf859c window: keep display size when leaving fullscreen for first time
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
2013-03-26 12:35:52 +01:00
Marc-André Lureau
f507f30904 window: save window geometry if the window is realized
Protect against re-entering fullscreen by moving pre-condition,
keey the last know window geometry, since it stays valid.
2013-03-26 12:34:30 +01:00
Marc-André Lureau
d2c4739dc5 window: resize to monitor geometry
This code is potentially bad, we should set size request to the size of the monitor
2013-03-26 12:31:25 +01:00
Marc-André Lureau
d99d943c90 display: make a function to queue the dirty display allocation trick 2013-03-25 22:23:09 +01:00
Marc-André Lureau
19b8be2c85 app: add get_fullscreen_auto_conf() 2013-03-25 22:23:04 +01:00
Christophe Fergeau
464031cae3 Reuse existing 'displays' submenu rather than recreating it
Because of what apparently is a gtk+2 bug , we
cannot recreate the submenu every time we need to refresh it,
otherwise the application may get frozen with the keyboard and
mouse grabbed if gtk_menu_item_set_submenu is called while
the menu is displayed. Reusing the same menu every time
works around this issue.

https://bugzilla.redhat.com/show_bug.cgi?id=922712
2013-03-25 16:18:59 +01:00
Marc-André Lureau
3b981d953f Do not disable extra client monitors
This allows reconfiguration of extra monitors whenever the agent is
back, for example after reboot.

https://bugzilla.redhat.com/show_bug.cgi?id=918997
2013-03-23 00:51:46 +01:00
Marc-André Lureau
9ff289ebf5 spice: always send auto-conf on agent connection
Restore the auto-conf client monitor configuration whenever the agent
is started. This ensures the guest has the expected number of monitors
enabled when rebooting in fullscreen.

https://bugzilla.redhat.com/show_bug.cgi?id=918997
2013-03-23 00:51:46 +01:00
Hans de Goede
663782b45c virt-viewer-display-spice: Skip monitor info in fullscreen-auto-conf mode
When we are in fullscreen-auto-conf virt-viewer-session-spice sends a
monitor-info message to the agent with the exact client monitor info, and
virt-viewer-display-spice should not override that.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2013-03-23 00:51:46 +01:00
Marc-André Lureau
910692b140 Forward directly key events to display
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
2013-03-23 00:51:46 +01:00
Hans de Goede
f43c87f599 virt-viewer-app: Call virt_viewer_app_update_menu_displays on show_hint change
Since the sensitivity of the display menu-check-items depends on show_hint,
we need to call virt_viewer_app_update_menu_displays on show_hint change.

This fixes the following scenario:
1) Linux guest with upto 4 displays on a single qxl dev
2) Configure it for 2 displays
3) Switch to a text-console in the guest (ie send ctrl+alt+F3)
4) All displays except for disp 1 are now not sensitve in the menu
5) Switch back to X
6) The second display in the view->displays menu is still not sensitive

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-21 21:20:55 +01:00
Hans de Goede
7ea90b8d17 virt-viewer-display: Document difference between nth display and monitor
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-21 17:25:35 +01:00
Hans de Goede
f7c11ac899 virt-viewer-window: Don't use priv->display when it is NULL
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>
2013-03-21 17:25:35 +01:00
Hans de Goede
9893c23830 virt-viewer-window: Store the monitor locally
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>
2013-03-21 17:25:35 +01:00
Christophe Fergeau
b8f64b82a9 Fix compilation with older glib versions
Recent commits introduced use of g_clear_object and
g_byte_array_new_take which are only present respectively in glib
2.28 and 2.32
2013-03-20 16:03:28 +01:00
Christophe Fergeau
a5180d34e7 Fix compilation with older gtk+
gtk_widget_get_mapped is only available in gtk+ 2.20, so we need
a compat definition for older releases.
2013-03-20 16:03:27 +01:00
Hans de Goede
0f737b4e9d virt-viewer-display-spice: Use display monitor property for fullscreen size
When a display is pinned to a certain monitor for fullscreen, it will be moved
there when going fullscreen. Currently we use gdk_screen_get_monitor_at_window
to determine which monitor we are on and get the size from that monitor.

But this is racy, sometimes the size_allocate function runs before the move
has finished and we get the size from the wrong monitor:
https://bugzilla.redhat.com/show_bug.cgi?id=918570

Since if the display is pinned to a certain monitor, the display will always
end up on that monitor we can avoid the race by simply using that monitors
size.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-20 15:26:47 +01:00
Hans de Goede
81ed9d13a8 virt_viewer_window_enter_fullscreen: Pass in monitor for fullscreen window
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>
2013-03-20 15:26:47 +01:00
Hans de Goede
62e0d000ce virt-viewer-display: Add monitor property
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-20 15:26:47 +01:00
Marc-André Lureau
1a74444bb7 spice: update fullscreen state on display creation
This ensure self->priv->auto_resize has correct value.
And allow changing guest resolution when started in fullscreen.

https://bugzilla.redhat.com/show_bug.cgi?id=873298
2013-03-13 20:44:42 +01:00
Marc-André Lureau
7b227be064 Don't override G_LOG_DOMAIN=all
If the string is different, the GLib log handler will not log all
messages.
2013-03-13 19:42:42 +01:00
Daniel P. Berrange
9d69e5a629 Delete browser plugin entirely
The browser plugin code has been effectively unmaintained since
the day it was merged. There has always been a caveat that the
code has not been properly audited to ensure it is secure, and
being unmaintained doesn't give a warm secure feeling. These
days there are better solutions for the browser which are pure
HTML5 code, noVNC and SPICE-HTML5.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-03-13 11:47:42 +00:00
Marc-André Lureau
9d851a4da3 file: add version field, raise an error if incompatibily
The virt-viewer connection file can now have a version=0.5 field. If
the virt-viewer version opening the connection doesn't provide at
least that version, an error is raised with the version required.
2013-03-08 16:54:01 +01:00
Marc-André Lureau
13f493200c Allow app_initial_connect() to raise an error 2013-03-08 16:54:01 +01:00
Marc-André Lureau
49c242f526 Add virt_viewer_compare_version() 2013-03-08 16:54:01 +01:00
Marc-André Lureau
ef9b142dd9 Add VIRT_VIEWER_ERROR GError 2013-03-08 16:54:01 +01:00
Hans de Goede
b529b60525 Fix send-key menu not showing in fullscreen with gtk3 (rhbz#913601)
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>
2013-02-21 18:16:14 +01:00
Daniel P. Berrange
ea6340eb2b Post release version bump 2013-02-13 16:39:21 +00:00
Daniel P. Berrange
f3c2e2d268 Update for 0.5.5 release v0.5.5 2013-02-13 16:16:55 +00:00
Daniel P. Berrange
cd03c8e7ab Update min spice-gtk requirement docs / RPM requires 2013-02-13 16:16:35 +00:00
Daniel P. Berrange
9f6b2e3f81 Turn off deprecation warnings
GLib deprecated the GValueArray type without providing an ABI
compatible replacement. Thus we need to disable dreprecation
warnings

../../src/virt-viewer-auth.c: In function 'virt_viewer_auth_vnc_credentials':
../../src/virt-viewer-auth.c:112:9: error: 'g_value_array_get_nth' is deprecated (declared at /usr/include/glib-2.0/gobject/gvaluearray.h:65): Use 'g_array_index' instead [-Werror=deprecated-declarations]
2013-02-13 15:20:11 +00:00
Daniel P. Berrange
b96e43e8ee Avoid Makefile @ check for data/Makefile.am 2013-02-13 15:18:19 +00:00
Daniel P. Berrange
09a961ceba Adapt 'po file' syntax check to look at more files
The 'po file' check needs to consider various files in data/
as well as normal sources
2013-02-13 15:18:19 +00:00
Daniel P. Berrange
87bb91e6af Don't define the same make target/variables twice
The NSIS patches defined the .PHONY target twice and also
defined CLEANFILES twice
2013-02-13 15:18:16 +00:00
Daniel P. Berrange
25a2acc2da Auto-generate AUTHORS file from GIT logs
Rather than trying to manually keep track of authors,
just auto-generate the list from GIT logs

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-02-13 15:17:57 +00:00
Marc-André Lureau
db19b2ec99 win: add virt-viewer.msi build rule
In order to build the MSI, you will need msitools:
http://ftp.gnome.org/pub/GNOME/sources/msitools/

The MANUFACTURER environment variable is mandatory and should be set
to the manufacturer/author of the MSI build.
2013-02-13 13:20:37 +01:00
Marc-André Lureau
6203eff3bc spec: include mime file 2013-02-12 18:59:04 +01:00
Marc-André Lureau
a52b5ea88c build-sys: add --with-buildid to details build version
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.
2013-02-12 18:56:33 +01:00
Marc-André Lureau
da45d9fa1e Register remote-viewer mime handling
Unfortunately, I don't see yet how we could avoid the browser dialog
asking which application to open. On Firefox, each user has a
mimeTypes.rdf, but we can't really modify it..
2013-02-11 19:35:00 +01:00
Marc-André Lureau
d5229a71eb win32: process message queue in debug-helper
Process messages while waiting for pi.hProcess.

Avoid the spice-x from hanging in WaitForInputIdle(), although the
client itself might not be ready, not even started...

https://bugzilla.redhat.com/show_bug.cgi?id=903190
2013-02-11 16:54:01 +01:00
Hans de Goede
ea6c9d2673 virtviewer-window: Make sure fullscreen window stays on the same monitor
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>
2013-02-11 14:25:01 +01:00
Marc-André Lureau
329a4b4908 Fix "Do not ask me again" checkbox settings saving
Based on bug report by Hans:

The code block for saving was below this check:

    if (priv->session) {
        virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
        if (priv->connected) {
            priv->quiting = TRUE;
            return;
        }
    }

Which means it never executes when quiting virt-viewer while conneced, causing
the "Do not ask me again" checkbox settings to not be saved.
2013-02-07 20:35:19 +01:00
Hans de Goede
e99f03008e usbredir: Fix usbredir menu always being grayed out on monitor 2+
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-06 16:14:28 +01:00