[virt-tools-list] [PATCH virt-viewer v4 3/3] session-spice: Disable extra displays in fullscreen mode

Pavel Grunt pgrunt at redhat.com
Tue May 5 07:18:54 UTC 2015


On Mon, 2015-05-04 at 12:26 -0500, Jonathon Jongsma wrote:
> On Mon, 2015-05-04 at 17:20 +0200, Pavel Grunt wrote:
> > When running in fullscreen it is possible to end up in a situation
> > where we have more displays enabled than monitors. This can happen
> > if displays that were enabled in the previous connection to the 
> > guest
> > doesn't match displays requested when entering the fullscreen mode.
> > 
> > This commit solves the problem by disabling displays that should 
> > not
> > enabled in the fullscreen mode.
> > 
> > Resolves: rhbz#1212802
> > ---
> > v1: https://www.redhat.com/archives/virt-tools-list/2015
> > -April/msg00184.html
> > v2: - nth is not used to determine which display should be enabled,
> >       but the list of fullscreen displays is used
> >     - the extra display is disabled instead of being ignored
> > v3: - added missing check for self->priv->did_auto_conf to fix 
> > hidden display
> >       when --reconnect
> > v4: - due to PATCH 2/3 it is possible to use 
> > virt_viewer_app_get_initial_displays()
> >       to get fullscreen mode displays
> > ---
> >  src/virt-viewer-session-spice.c | 24 ++++++++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> > 
> > diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer
> > -session-spice.c
> > index c1333dd..fa1fd1f 100644
> > --- a/src/virt-viewer-session-spice.c
> > +++ b/src/virt-viewer-session-spice.c
> > @@ -693,6 +693,16 @@ destroy_display(gpointer data)
> >      g_object_unref(display);
> >  }
> >  
> > +static gboolean
> > +display_is_in_fullscreen_mode(VirtViewerSessionSpice *self,
> > +                              VirtViewerDisplay *display)
> > +{
> > +    gconstpointer nth = 
> > GINT_TO_POINTER(virt_viewer_display_get_nth(display));
> > +    VirtViewerApp *app = > > virt_viewer_session_get_app(VIRT_VIEWER_SESSION(self));
> > +
> > +    return 
> > g_list_index(virt_viewer_app_get_initial_displays(app), nth) != -1;
> > +}
> > +
> 
> virt_ivewer_app_get_initial_displays() returns a newly-allocated 
> list,
> which will be leaked here. Perhaps you could simply call
> get_initial_montor_for_display() and check whether it's != -1.
> 
Right, I will fix the leak. Unfortunately, I cannot use
get_initial_monitor_for_display() because it just returns the display
id when there is no user configuration (monitor-mapping).

Thank you, I will send v5.
Pavel




More information about the virt-tools-list mailing list