[virt-tools-list] [PATCH virt-viewer] Unset app 'fullscreen' when leaving fullscreen
Fabiano Fidêncio
fabiano at fidencio.org
Fri Sep 26 11:37:06 UTC 2014
On Thu, Sep 25, 2014 at 5:58 PM, Jonathon Jongsma <jjongsma at redhat.com>
wrote:
> Previously, the fullscreen floating toolbar and the "toggle-fullscreen"
> hotkey (which maps to the menu item action) had slightly different
> methods of exiting fullscreen. The floating toolbar method unset the
> 'fullscreen' property on the application (which causes all windows to
> simultaneously exit fullscreen), whereas the hotkey did not. This had a
> side-effect of preventing the display from auto re-sizing if it was
> fullscreened again. After this change, both the hotkey and the toolbar
> button will unset the application-level 'fullscreen' property when
> exiting fullscreen mode.
>
> Resolves: rhbz#1022608
> ---
> src/virt-viewer-window.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index fa04a97..a9c9442 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -829,16 +829,26 @@ virt_viewer_window_menu_file_quit(GtkWidget *src
> G_GNUC_UNUSED,
> }
>
>
> -static void
> -virt_viewer_window_toolbar_leave_fullscreen(GtkWidget *button
> G_GNUC_UNUSED,
> - VirtViewerWindow *self)
> +static void virt_viewer_window_set_fullscreen(VirtViewerWindow *self,
> + gboolean fullscreen)
> {
> + if (fullscreen) {
> + virt_viewer_window_enter_fullscreen(self, -1);
> + } else {
> /* leave all windows fullscreen state */
> if (virt_viewer_app_get_fullscreen(self->priv->app))
> g_object_set(self->priv->app, "fullscreen", FALSE, NULL);
> /* or just this window */
> else
> virt_viewer_window_leave_fullscreen(self);
> + }
>
Please, just indent the whole block inside the added else. Or do something
like:
if (fullscreen) {
/* some code */
return;
}
(whatever is your preference ...)
+}
> +
> +static void
> +virt_viewer_window_toolbar_leave_fullscreen(GtkWidget *button
> G_GNUC_UNUSED,
> + VirtViewerWindow *self)
> +{
> + virt_viewer_window_set_fullscreen(self, FALSE);
> }
>
> static void keycombo_menu_location(GtkMenu *menu G_GNUC_UNUSED, gint *x,
> gint *y,
> @@ -875,10 +885,7 @@ virt_viewer_window_menu_view_fullscreen(GtkWidget
> *menu,
> {
> gboolean fullscreen =
> gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu));
>
> - if (fullscreen)
> - virt_viewer_window_enter_fullscreen(self, -1);
> - else
> - virt_viewer_window_leave_fullscreen(self);
> + virt_viewer_window_set_fullscreen(self, fullscreen);
> }
>
> static void add_if_writable (GdkPixbufFormat *data, GHashTable *formats)
> --
> 1.9.3
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
>
apart from the comments, ACK!
--
Fabiano Fidêncio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140926/8312c1d3/attachment.htm>
More information about the virt-tools-list
mailing list