From 63fc98222a5aefded51b1f98f7d9a6ffbea32481 Mon Sep 17 00:00:00 2001 From: "eric.beuque" Date: Thu, 19 Apr 2012 20:46:33 +0000 Subject: [PATCH] [FreetuxTV] Restore the original window position after fullscreen mode (Fixes issue 131) --- ChangeLog | 1 + lib/libvlc-gtk/gtk-libvlc-media-player.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index bc6a507..3850130 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ FreetuxTV 0.6.4 (2012-XX-XX) - Issue 145: Fix dialog add group loading with corrupted XML file - Improve help to be compatible with help2man + - Issue 131: Restore the original window position after fullscreen mode FreetuxTV 0.6.3 (2012-04-01) - Rename the menu to synchronize TV channel list. diff --git a/lib/libvlc-gtk/gtk-libvlc-media-player.c b/lib/libvlc-gtk/gtk-libvlc-media-player.c index 6dbad01..1a3b586 100644 --- a/lib/libvlc-gtk/gtk-libvlc-media-player.c +++ b/lib/libvlc-gtk/gtk-libvlc-media-player.c @@ -42,6 +42,9 @@ struct _GtkLibvlcMediaPlayerPrivate GtkWidget* pWigdetOriginalParent; GtkWidget* pWindowFullscreen; + gint root_x; + gint root_y; + gboolean isModeFullscreen; GtkAccelGroup *pAccelGroup; @@ -1618,6 +1621,7 @@ gtk_libvlc_media_player_set_fullscreen (GtkLibvlcMediaPlayer *self, gboolean ful GtkWidget *pTopLevel = gtk_widget_get_toplevel (priv->pWigdetOriginalParent); if (gtk_widget_is_toplevel (pTopLevel)) { + gtk_window_get_position (GTK_WINDOW(pTopLevel), &priv->root_x, &priv->root_y); gtk_widget_hide(pTopLevel); } @@ -1639,6 +1643,8 @@ gtk_libvlc_media_player_set_fullscreen (GtkLibvlcMediaPlayer *self, gboolean ful GtkWidget *pTopLevel = gtk_widget_get_toplevel (priv->pWigdetOriginalParent); if (gtk_widget_is_toplevel (pTopLevel)) { gtk_widget_show(pTopLevel); + // Restore the previous position of the windows that was erased by gtk_widget_hide + gtk_window_move(GTK_WINDOW(pTopLevel), priv->root_x, priv->root_y); }