[gthumb] disable fullscreen mode when activating the browser page
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] disable fullscreen mode when activating the browser page
- Date: Sat, 13 Aug 2016 14:42:15 +0000 (UTC)
commit 63b27e5ae8a19af494ac422f8169aec773179c9d
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Aug 13 16:07:59 2016 +0200
disable fullscreen mode when activating the browser page
gthumb/gth-browser-actions-callbacks.c | 2 -
gthumb/gth-browser.c | 63 +++++++++++++++++---------------
2 files changed, 34 insertions(+), 31 deletions(-)
---
diff --git a/gthumb/gth-browser-actions-callbacks.c b/gthumb/gth-browser-actions-callbacks.c
index e0a2ffc..d2eb68e 100644
--- a/gthumb/gth-browser-actions-callbacks.c
+++ b/gthumb/gth-browser-actions-callbacks.c
@@ -194,8 +194,6 @@ gth_browser_activate_browser_mode (GSimpleAction *action,
viewer_sidebar = gth_browser_get_viewer_sidebar (browser);
if (gth_sidebar_tool_is_active (GTH_SIDEBAR (viewer_sidebar)))
gth_sidebar_deactivate_tool (GTH_SIDEBAR (viewer_sidebar));
- else if (gth_browser_get_is_fullscreen (browser))
- gth_browser_unfullscreen (browser);
else
gth_window_set_current_page (GTH_WINDOW (browser), GTH_BROWSER_PAGE_BROWSER);
}
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index f38b792..cc47cf6 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -2434,35 +2434,36 @@ _gth_browser_real_set_current_page (GthWindow *window,
gth_statusbar_show_section (GTH_STATUSBAR (browser->priv->statusbar), (page ==
GTH_BROWSER_PAGE_BROWSER) ? GTH_STATUSBAR_SECTION_FILE_LIST : GTH_STATUSBAR_SECTION_FILE);
_gth_browser_hide_infobar (browser);
- if (browser->priv->viewer_page != NULL) {
- if (page == GTH_BROWSER_PAGE_VIEWER) {
- gth_viewer_page_show (browser->priv->viewer_page);
- _gth_browser_show_pointer_on_viewer (browser, FALSE);
- hide_mouse_pointer_after_delay (browser, NULL);
-
- browser->priv->last_mouse_x = 0.0;
- browser->priv->last_mouse_y = 0.0;
- if (browser->priv->motion_signal == 0)
+ if (page == GTH_BROWSER_PAGE_VIEWER) {
+ if (browser->priv->viewer_page != NULL) {
+ gth_viewer_page_show (browser->priv->viewer_page);
+ _gth_browser_show_pointer_on_viewer (browser, FALSE);
+ hide_mouse_pointer_after_delay (browser, NULL);
+
+ browser->priv->last_mouse_x = 0.0;
+ browser->priv->last_mouse_y = 0.0;
+ if (browser->priv->motion_signal == 0)
browser->priv->motion_signal = g_signal_connect (browser,
"motion_notify_event",
G_CALLBACK
(viewer_motion_notify_event_cb),
browser);
- }
- else {
- gth_viewer_page_hide (browser->priv->viewer_page);
-
- if (browser->priv->motion_signal != 0) {
- g_signal_handler_disconnect (browser, browser->priv->motion_signal);
- browser->priv->motion_signal = 0;
- }
- if (browser->priv->hide_mouse_timeout != 0) {
- g_source_remove (browser->priv->hide_mouse_timeout);
- browser->priv->hide_mouse_timeout = 0;
- }
- }
- }
+ }
+ }
+ else {
+ if (browser->priv->viewer_page != NULL)
+ gth_viewer_page_hide (browser->priv->viewer_page);
- _gth_browser_update_header_bar_content (browser);
+ if (browser->priv->motion_signal != 0) {
+ g_signal_handler_disconnect (browser, browser->priv->motion_signal);
+ browser->priv->motion_signal = 0;
+ }
+ if (browser->priv->hide_mouse_timeout != 0) {
+ g_source_remove (browser->priv->hide_mouse_timeout);
+ browser->priv->hide_mouse_timeout = 0;
+ }
+ }
+
+ _gth_browser_update_header_bar_content (browser);
gtk_widget_set_visible (browser->priv->browser_status_commands, page == GTH_BROWSER_PAGE_BROWSER);
gtk_widget_set_visible (browser->priv->viewer_status_commands, page == GTH_BROWSER_PAGE_VIEWER);
@@ -2511,7 +2512,7 @@ _gth_browser_real_set_current_page (GthWindow *window,
/* restore the browser window size */
- if (page == GTH_BROWSER_PAGE_BROWSER && ! (browser->priv->fullscreen ||
browser->priv->was_fullscreen))
+ if ((page == GTH_BROWSER_PAGE_BROWSER) && ! (browser->priv->fullscreen ||
browser->priv->was_fullscreen))
gth_window_apply_saved_size (GTH_WINDOW (window), page);
/* set the focus */
@@ -2521,6 +2522,11 @@ _gth_browser_real_set_current_page (GthWindow *window,
else if (page == GTH_BROWSER_PAGE_VIEWER)
_gth_browser_make_file_visible (browser, browser->priv->current_file);
+ /* exit from fullscreen after switching to the browser */
+
+ if ((page == GTH_BROWSER_PAGE_BROWSER) && gth_browser_get_is_fullscreen (browser))
+ gth_browser_unfullscreen (browser);
+
/* extension hook */
gth_hook_invoke ("gth-browser-set-current-page", browser);
@@ -6842,13 +6848,12 @@ gth_browser_unfullscreen (GthBrowser *browser)
gtk_window_unfullscreen (GTK_WINDOW (browser));
browser->priv->properties_on_screen = FALSE;
- if (GTH_VIEWER_PAGE_GET_INTERFACE (browser->priv->viewer_page)->show_properties != NULL)
- gth_viewer_page_show_properties (browser->priv->viewer_page, FALSE);
-
if (browser->priv->viewer_page != NULL) {
+ if (GTH_VIEWER_PAGE_GET_INTERFACE (browser->priv->viewer_page)->show_properties != NULL)
+ gth_viewer_page_show_properties (browser->priv->viewer_page, FALSE);
gth_viewer_page_fullscreen (browser->priv->viewer_page, FALSE);
- _gth_browser_show_pointer_on_viewer (browser, TRUE);
}
+ _gth_browser_show_pointer_on_viewer (browser, TRUE);
g_list_free (browser->priv->viewer_controls);
browser->priv->viewer_controls = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]