[gthumb] Fixed crash in fullscreen mode when viewing an image after a video
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] Fixed crash in fullscreen mode when viewing an image after a video
- Date: Thu, 12 Aug 2010 20:01:45 +0000 (UTC)
commit 63ce1567241e2fde16bb9416b9b40c5356b48cec
Author: Paolo Bacchilega <paobac src gnome org>
Date: Thu Aug 12 21:34:16 2010 +0200
Fixed crash in fullscreen mode when viewing an image after a video
Remove the mediabar when the video viewer is
deactivated.
[bug #626686]
extensions/gstreamer_tools/gth-media-viewer-page.c | 28 ++++++++---
gthumb/gth-browser.c | 48 +++++++++++--------
gthumb/gth-browser.h | 3 +
3 files changed, 51 insertions(+), 28 deletions(-)
---
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c b/extensions/gstreamer_tools/gth-media-viewer-page.c
index fc9f6da..53ddb5a 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -647,6 +647,23 @@ gth_media_viewer_page_real_activate (GthViewerPage *base,
static void
+remove_fullscreen_toolbar (GthMediaViewerPage *self)
+{
+ if (self->priv->fullscreen_toolbar == NULL)
+ return;
+
+ g_object_ref (self->priv->mediabar);
+ gtk_container_remove (GTK_CONTAINER (self->priv->fullscreen_toolbar), self->priv->mediabar);
+ gtk_box_pack_start (GTK_BOX (self->priv->area_box), self->priv->mediabar, FALSE, FALSE, 0);
+ g_object_unref (self->priv->mediabar);
+
+ gth_browser_unregister_fullscreen_control (self->priv->browser, self->priv->fullscreen_toolbar);
+ gtk_widget_destroy (self->priv->fullscreen_toolbar);
+ self->priv->fullscreen_toolbar = NULL;
+}
+
+
+static void
gth_media_viewer_page_real_deactivate (GthViewerPage *base)
{
GthMediaViewerPage *self;
@@ -673,6 +690,8 @@ gth_media_viewer_page_real_deactivate (GthViewerPage *base)
g_object_unref (self->priv->actions);
self->priv->actions = NULL;
+ remove_fullscreen_toolbar (self);
+
gth_browser_set_viewer_widget (self->priv->browser, NULL);
}
@@ -1004,14 +1023,7 @@ gth_media_viewer_page_real_fullscreen (GthViewerPage *base,
GtkAllocation allocation;
if (! active) {
- g_object_ref (self->priv->mediabar);
- gtk_container_remove (GTK_CONTAINER (self->priv->fullscreen_toolbar), self->priv->mediabar);
- gtk_box_pack_start (GTK_BOX (self->priv->area_box), self->priv->mediabar, FALSE, FALSE, 0);
- g_object_unref (self->priv->mediabar);
-
- gtk_widget_destroy (self->priv->fullscreen_toolbar);
- self->priv->fullscreen_toolbar = NULL;
-
+ remove_fullscreen_toolbar (self);
return;
}
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index b6d3ece..e8d8c4c 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -5037,6 +5037,21 @@ load_file_data_unref (LoadFileData *data)
static void
+_gth_browser_deactivate_viewer_page (GthBrowser *browser)
+{
+ if (browser->priv->viewer_page != NULL) {
+ if (browser->priv->fullscreen)
+ gth_viewer_page_show_pointer (GTH_VIEWER_PAGE (browser->priv->viewer_page), TRUE);
+ gth_viewer_page_deactivate (browser->priv->viewer_page);
+ gtk_ui_manager_ensure_update (browser->priv->ui);
+ gth_browser_set_viewer_widget (browser, NULL);
+ g_object_unref (browser->priv->viewer_page);
+ browser->priv->viewer_page = NULL;
+ }
+}
+
+
+static void
gth_viewer_page_file_loaded_cb (GthViewerPage *viewer_page,
gboolean success,
gpointer user_data);
@@ -5046,16 +5061,14 @@ static void
_gth_browser_set_current_viewer_page (GthBrowser *browser,
GthViewerPage *registered_viewer_page)
{
- if ((browser->priv->viewer_page != NULL) && (G_OBJECT_TYPE (registered_viewer_page) != G_OBJECT_TYPE (browser->priv->viewer_page))) {
- gth_viewer_page_deactivate (browser->priv->viewer_page);
- gtk_ui_manager_ensure_update (browser->priv->ui);
- gth_browser_set_viewer_widget (browser, NULL);
- g_object_unref (browser->priv->viewer_page);
- browser->priv->viewer_page = NULL;
- }
+ if ((browser->priv->viewer_page != NULL) && (G_OBJECT_TYPE (registered_viewer_page) != G_OBJECT_TYPE (browser->priv->viewer_page)))
+ _gth_browser_deactivate_viewer_page (browser);
+
if (browser->priv->viewer_page == NULL) {
browser->priv->viewer_page = g_object_new (G_OBJECT_TYPE (registered_viewer_page), NULL);
gth_viewer_page_activate (browser->priv->viewer_page, browser);
+ if (browser->priv->fullscreen)
+ gth_viewer_page_show_pointer (GTH_VIEWER_PAGE (browser->priv->viewer_page), FALSE);
gtk_ui_manager_ensure_update (browser->priv->ui);
g_signal_connect (browser->priv->viewer_page,
@@ -5175,19 +5188,6 @@ file_metadata_ready_cb (GList *files,
static void
-_gth_browser_deactivate_viewer_page (GthBrowser *browser)
-{
- if (browser->priv->viewer_page != NULL) {
- gth_viewer_page_deactivate (browser->priv->viewer_page);
- gtk_ui_manager_ensure_update (browser->priv->ui);
- gth_browser_set_viewer_widget (browser, NULL);
- g_object_unref (browser->priv->viewer_page);
- browser->priv->viewer_page = NULL;
- }
-}
-
-
-static void
_gth_browser_load_file (GthBrowser *browser,
GthFileData *file_data,
gboolean view)
@@ -5488,6 +5488,14 @@ gth_browser_register_fullscreen_control (GthBrowser *browser,
}
+void
+gth_browser_unregister_fullscreen_control (GthBrowser *browser,
+ GtkWidget *widget)
+{
+ browser->priv->fullscreen_controls = g_list_remove (browser->priv->fullscreen_controls, widget);
+}
+
+
static void
_gth_browser_create_fullscreen_toolbar (GthBrowser *browser)
{
diff --git a/gthumb/gth-browser.h b/gthumb/gth-browser.h
index 34ca841..2f8d7cb 100644
--- a/gthumb/gth-browser.h
+++ b/gthumb/gth-browser.h
@@ -166,6 +166,9 @@ gpointer gth_browser_get_image_preloader (GthBrowser *browser);
void gth_browser_register_fullscreen_control
(GthBrowser *browser,
GtkWidget *widget);
+void gth_browser_unregister_fullscreen_control
+ (GthBrowser *browser,
+ GtkWidget *widget);
void gth_browser_fullscreen (GthBrowser *browser);
void gth_browser_unfullscreen (GthBrowser *browser);
void gth_browser_file_menu_popup (GthBrowser *browser,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]