Hi,

First of all thanks for keeping alive the great piece of software.

I have been using geeqie since the time it was GQview and I usually
run it in full screen mode using the -f option.

The only thing that have been annoying me all that time is that
flickering that takes place just after start when you start
immediately in fullscreen mode (-f option) and just before
quit when you quit not leaving fullscreen mode beforehand
(using a shortcut for "<Actions>/MenuActions/Quit").

Obviously the flickering is caused by the fact that geeqie has
separate windows for normal and fullscreen mode and that even
being run in fullscreen mode it still shows both windows and
although the full screen window overlaps all other windows
the user is still able to see the normal window for a moment
on start and quit.

I've rechecked if it is also the case for GQview. It is,
but for some reason GQview takes less time to quit so it is
harder to notice the flickering there.

The issue becomes even more annoying if you use a tiling window
manager because in that case aside from flickering you will
enjoy watching how all of your windows are being shuffled :)

I haven't done any GTK coding before today, so I don't know why
two-window approach is taken and if there is a better way.
So I tried to fix the issue not changing things dramatically.

The idea is OK let's still show the normal window in fullscreen
mode (as per my experiments shortcuts don't work when the normal
window is hidden), but at least let it be shown *after* the
fullscreen window and let it be hidden *before* the fullscreen
window is closed when quitting from the application.

Here it the patch that works for me. I don't like it very much
because it is a kind of work around and not a fix, but at least
it will help to notice the difference.

I am not a multidisplay user, so I am not aware of any
multidisplay use cases for geeqie and so I couldn't verify that
they wouldn't be affected by this patch.

diff --git a/src/layout.c b/src/layout.c
index 649ee67..4122b14 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -2078,8 +2078,9 @@ LayoutWindow *layout_new(FileData *dir_fd, LayoutOptions 
*lop)
        return layout_new_with_geometry(dir_fd, lop, NULL);
 }
 
-LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
-                                      const gchar *geometry)
+LayoutWindow *layout_new_hidden_with_geometry(FileData *dir_fd,
+                                             const LayoutOptions *lop,
+                                             const gchar *geometry)
 {
        LayoutWindow *lw;
        GdkGeometry hint;
@@ -2201,7 +2202,6 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, 
LayoutOptions *lop,
                        }
                }
 
-       gtk_widget_show(lw->window);
        layout_tools_hide(lw, lw->options.tools_hidden);
 
        image_osd_set(lw->image, lw->options.image_overlay.state);
@@ -2219,6 +2219,17 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, 
LayoutOptions *lop,
        return lw;
 }
 
+LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
+                                      const gchar *geometry)
+{
+       LayoutWindow *lw =
+               layout_new_hidden_with_geometry(dir_fd, lop, geometry);
+
+       gtk_widget_show(lw->window);
+
+       return lw;
+}
+
 void layout_write_attributes(LayoutOptions *layout, GString *outstr, gint 
indent)
 {
        WRITE_NL(); WRITE_CHAR(*layout, id);
@@ -2414,13 +2425,14 @@ LayoutWindow *layout_new_from_config(const gchar 
**attribute_names, const gchar
                layout_config_startup_path(&lop, &path);
                }
 
-       lw = layout_new_with_geometry(NULL, &lop, use_commandline ? 
command_line->geometry : NULL);
+       lw = layout_new_hidden_with_geometry(NULL, &lop, use_commandline ? 
command_line->geometry : NULL);
        layout_sort_set(lw, options->file_sort.method, 
options->file_sort.ascending);
        layout_set_path(lw, path);
 
        if (use_commandline && command_line->startup_full_screen) 
layout_image_full_screen_start(lw);
        if (use_commandline && command_line->startup_in_slideshow) 
layout_image_slideshow_start(lw);
 
+       gtk_widget_show(lw->window);
 
        g_free(path);
        free_layout_options_content(&lop);
diff --git a/src/layout.h b/src/layout.h
index e5c804f..a0fecf7 100644
--- a/src/layout.h
+++ b/src/layout.h
@@ -21,6 +21,9 @@ extern GList *layout_window_list;
 LayoutWindow *layout_new(FileData *dir_fd, LayoutOptions *lop);
 LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
                                       const gchar *geometry);
+LayoutWindow *layout_new_hidden_with_geometry(FileData *dir_fd,
+                                             const LayoutOptions *lop,
+                                             const gchar *geometry);
 LayoutWindow *layout_new_from_config(const gchar **attribute_names, const 
gchar **attribute_values, gboolean use_commandline);
 void layout_update_from_config(LayoutWindow *lw, const gchar 
**attribute_names, const gchar **attribute_values);
 
diff --git a/src/main.c b/src/main.c
index c56ab57..3a80d1c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -690,12 +690,20 @@ static void exit_program_write_metadata_cb(gint success, 
const gchar *dest_path,
 
 void exit_program(void)
 {
-       layout_image_full_screen_stop(NULL);
+       LayoutWindow *lw = NULL;
 
        if (metadata_write_queue_confirm(FALSE, exit_program_write_metadata_cb, 
NULL)) return;
 
        if (exit_confirm_dlg()) return;
 
+       /* Hide main window before closing fullscreen window to avoid 
flickering */
+       if (layout_valid(&lw))
+               {
+               gtk_widget_hide(lw->window);
+               }
+
+       layout_image_full_screen_stop(NULL);
+
        exit_program_final();
 }

-- 
Vitaly Sinilin <v...@kp4.ru>

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Geeqie-devel mailing list
Geeqie-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geeqie-devel

Reply via email to