Add PanColor to simplify pan functions
[geeqie.git] / src / view-dir.cc
index 43eb793..e5e688d 100644 (file)
 
 #include "view-dir.h"
 
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <cstring>
+
+#include <glib-object.h>
+
 #include <config.h>
 
 #include "compat.h"
@@ -33,6 +40,7 @@
 #include "layout.h"
 #include "main-defines.h"
 #include "menu.h"
+#include "options.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-misc.h"
@@ -135,7 +143,7 @@ static void vd_destroy_cb(GtkWidget *widget, gpointer data)
                {
                g_signal_handlers_disconnect_matched(G_OBJECT(vd->popup), G_SIGNAL_MATCH_DATA,
                                                     0, 0, nullptr, nullptr, vd);
-               g_object_unref(vd->popup);
+               gq_gtk_widget_destroy(vd->popup);
                }
 
        switch (vd->type)
@@ -1176,10 +1184,9 @@ void vd_activate_cb(GtkTreeView *tview, GtkTreePath *tpath, GtkTreeViewColumn *,
 static GdkRGBA *vd_color_shifted(GtkWidget *widget)
 {
        static GdkRGBA color;
-       static GdkRGBA color_style;
        static GtkWidget *done = nullptr;
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 /* @FIXME GTK4 no background color */
 #else
        if (done != widget)
@@ -1187,9 +1194,7 @@ static GdkRGBA *vd_color_shifted(GtkWidget *widget)
                GtkStyleContext *style_context;
 
                style_context = gtk_widget_get_style_context(widget);
-               gtk_style_context_get_background_color(style_context, GTK_STATE_FLAG_NORMAL, &color_style);
-
-               memcpy(&color, &color_style, sizeof(color_style));
+               gtk_style_context_get_background_color(style_context, GTK_STATE_FLAG_NORMAL, &color);
 
                shift_color(&color, -1, 0);
                done = widget;