File: Fix-1692-Hide-Bars-and-Files-nukes-toolbar-customizations.patch

package info (click to toggle)
geeqie 1%3A2.5-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 16,780 kB
  • sloc: cpp: 110,189; xml: 11,497; sh: 3,681; awk: 124; perl: 88; python: 80; makefile: 23
file content (52 lines) | stat: -rw-r--r-- 1,755 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: Colin Clark <colin.clark@cclark.uk>
Date: Tue, 1 Apr 2025 15:34:27 +0100
Subject: Fix #1692: "Hide Bars and Files" nukes toolbar customizations

https://github.com/BestImageViewer/geeqie/issues/1692

This patch works but I do not know why. It is just a guess.
There may be a better solution.
---
 src/layout-util.cc | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/layout-util.cc b/src/layout-util.cc
index 96020e3..97a9232 100644
--- a/src/layout-util.cc
+++ b/src/layout-util.cc
@@ -3211,7 +3211,6 @@ void create_toolbars(LayoutWindow *lw)
 	for (i = 0; i < TOOLBAR_COUNT; i++)
 		{
 		layout_actions_toolbar(lw, static_cast<ToolbarType>(i));
-		layout_toolbar_clear(lw, static_cast<ToolbarType>(i));
 		layout_toolbar_add_default(lw, static_cast<ToolbarType>(i));
 		}
 }
@@ -3556,7 +3555,11 @@ void layout_toolbar_add(LayoutWindow *lw, ToolbarType type, const gchar *action_
 
 		action_icon = gq_gtk_action_create_icon(action, GTK_ICON_SIZE_SMALL_TOOLBAR);
 
-		gq_gtk_ui_manager_add_ui(lw->ui_manager, lw->toolbar_merge_id[type], path, action_name, action_name, GTK_UI_MANAGER_TOOLITEM, FALSE);
+		/** @FIXME This is a hack to remove run-time errors */
+		if (lw->toolbar_merge_id[type] > 0)
+		{
+			gq_gtk_ui_manager_add_ui(lw->ui_manager, lw->toolbar_merge_id[type], path, action_name, action_name, GTK_UI_MANAGER_TOOLITEM, FALSE);
+		}
 
 		if (GQ_GTK_IS_RADIO_ACTION(action) || GQ_GTK_IS_TOGGLE_ACTION(action))
 			{
@@ -3606,6 +3609,14 @@ void layout_toolbar_add_default(LayoutWindow *lw, ToolbarType type)
 	LayoutWindow *lw_first;
 	GList *work_action;
 
+	if (type >= TOOLBAR_COUNT) return;
+
+	if (layout_window_count() > 0)
+		{
+		return;
+		}
+
+
 	switch (type)
 		{
 		case TOOLBAR_MAIN: