Fix #821: Un-full-screen doesn't work. Regression
authorColin Clark <colin.clark@cclark.uk>
Thu, 29 Oct 2020 10:25:42 +0000 (10:25 +0000)
committerColin Clark <colin.clark@cclark.uk>
Thu, 29 Oct 2020 10:25:42 +0000 (10:25 +0000)
https://github.com/BestImageViewer/geeqie/issues/821

Implement a user-definable option for "Hide window in fullscreen",
instead of a define.

src/fullscreen.c
src/fullscreen.h
src/options.c
src/options.h
src/preferences.c
src/rcfile.c

index 958bad2..a031b7b 100644 (file)
@@ -338,9 +338,10 @@ FullScreenData *fullscreen_start(GtkWidget *window, ImageWindow *imd,
         */
        if (fs->same_region)
                {
-#ifdef HIDE_WINDOW_IN_FULLSCREEN
-               gtk_widget_hide(fs->normal_window);
-#endif
+               if (options->hide_window_in_fullscreen)
+                       {
+                       gtk_widget_hide(fs->normal_window);
+                       }
                image_change_fd(fs->normal_imd, NULL, image_zoom_get(fs->normal_imd));
                }
 
@@ -360,9 +361,10 @@ void fullscreen_stop(FullScreenData *fs)
        if (fs->same_region)
                {
                image_move_from_image(fs->normal_imd, fs->imd);
-#ifdef HIDE_WINDOW_IN_FULLSCREEN
-               gtk_widget_show(fs->normal_window);
-#endif
+               if (options->hide_window_in_fullscreen)
+                       {
+                       gtk_widget_show(fs->normal_window);
+                       }
                if (options->stereo.enable_fsmode)
                        {
                        image_stereo_set(fs->normal_imd, options->stereo.mode);
index 1e9650f..69d263d 100644 (file)
@@ -24,7 +24,6 @@
 
 #define FULL_SCREEN_HIDE_MOUSE_DELAY 3000
 #define FULL_SCREEN_BUSY_MOUSE_DELAY 200
-#define HIDE_WINDOW_IN_FULLSCREEN
 
 FullScreenData *fullscreen_start(GtkWidget *window, ImageWindow *imd,
                                 void (*stop_func)(FullScreenData *, gpointer), gpointer stop_data);
index 2ea1f99..6bc13a9 100644 (file)
@@ -91,6 +91,7 @@ ConfOptions *init_options(ConfOptions *options)
        options->marks_save = TRUE;
        options->with_rename = FALSE;
        options->collections_on_top = FALSE;
+       options->hide_window_in_fullscreen = TRUE;
 
        memset(&options->image.border_color, 0, sizeof(options->image.border_color));
        memset(&options->image.alpha_color_1, 0, sizeof(options->image.alpha_color_1));
index 9de4ace..8527304 100644 (file)
@@ -73,6 +73,7 @@ struct _ConfOptions
 
        gboolean with_rename;
        gboolean collections_on_top;
+       gboolean hide_window_in_fullscreen;
 
        gchar *help_search_engine;
 
index dab683f..ccdb5f4 100644 (file)
@@ -428,6 +428,7 @@ static void config_window_apply(void)
        options->marks_save = c_options->marks_save;
        options->with_rename = c_options->with_rename;
        options->collections_on_top = c_options->collections_on_top;
+       options->hide_window_in_fullscreen = c_options->hide_window_in_fullscreen;
        config_entry_to_option(help_search_engine_entry, &options->help_search_engine, NULL);
 
        options->read_metadata_in_idle = c_options->read_metadata_in_idle;
@@ -3259,6 +3260,7 @@ static void config_tab_behavior(GtkWidget *notebook)
        GtkWidget *marks;
        GtkWidget *with_rename;
        GtkWidget *collections_on_top;
+       GtkWidget *hide_window_in_fullscreen;
        GtkWidget *checkbox;
 
        vbox = scrolled_notebook_page(notebook, _("Behavior"));
@@ -3335,6 +3337,10 @@ static void config_tab_behavior(GtkWidget *notebook)
                                options->collections_on_top, &c_options->collections_on_top);
        gtk_widget_set_tooltip_text(collections_on_top,"Open collections window on top");
 
+       hide_window_in_fullscreen = pref_checkbox_new_int(group, _("Hide window in fullscreen"),
+                               options->hide_window_in_fullscreen, &c_options->hide_window_in_fullscreen);
+       gtk_widget_set_tooltip_text(hide_window_in_fullscreen,"When alt-tabbing, prevent Geeqie window showing twice");
+
        pref_spin_new_int(group, _("Recent folder list maximum size"), NULL,
                          1, 50, 1, options->open_recent_list_maxsize, &c_options->open_recent_list_maxsize);
 
index 2ae6873..0d3a03c 100644 (file)
@@ -353,6 +353,7 @@ static void write_global_attributes(GString *outstr, gint indent)
 
        WRITE_NL(); WRITE_BOOL(*options, with_rename);
        WRITE_NL(); WRITE_BOOL(*options, collections_on_top);
+       WRITE_NL(); WRITE_BOOL(*options, hide_window_in_fullscreen);
 
        /* File operations Options */
        WRITE_NL(); WRITE_BOOL(*options, file_ops.enable_in_place_rename);
@@ -781,6 +782,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                if (READ_CHAR(*options, help_search_engine)) continue;
 
                if (READ_BOOL(*options, collections_on_top)) continue;
+               if (READ_BOOL(*options, hide_window_in_fullscreen)) continue;
 
                /* Properties dialog options */
                if (READ_CHAR(*options, properties.tabs_order)) continue;