From afe2882f3bf21e6c728b855da0e916c33c6de88d Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Wed, 12 Mar 2025 15:14:39 +0900
Subject: [PATCH 01/12] chore: add test ui

---
 helpers/ui.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/helpers/ui.py b/helpers/ui.py
index ae28ede..b24839d 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -896,7 +896,6 @@ class ScrollableTree(Gtk.ScrolledWindow):
         self.treeview = TreeView(is_steam_deck)
         self.add(self.treeview)
 
-
 class RightPanel(Gtk.Box):
     def __init__(self, is_steam_deck):
         super().__init__(spacing=6)
@@ -1582,6 +1581,7 @@ class TreeView(Gtk.TreeView):
                     column_title = "Name"
                 saved_size = data["cols"][column_title]
                 column.set_fixed_width(saved_size)
+                column.set_expand(True)
             else:
                 if ("Name" in column_title):
                     column.set_fixed_width(800)
@@ -2330,12 +2330,8 @@ class Grid(Gtk.Grid):
         self._version = "%s %s" %(app_name, sys.argv[2])
 
         self.scrollable_treelist = ScrollableTree(is_steam_deck)
-        if is_steam_deck is True:
-            self.scrollable_treelist.set_hexpand(False)
-            self.scrollable_treelist.set_vexpand(True)
-        else:
-            self.scrollable_treelist.set_hexpand(True)
-            self.scrollable_treelist.set_vexpand(True)
+        self.scrollable_treelist.set_hexpand(False)
+        self.scrollable_treelist.set_vexpand(True)
 
         self.right_panel = RightPanel(is_steam_deck)
         self.sel_panel = ModSelectionPanel()
@@ -2357,8 +2353,8 @@ class Grid(Gtk.Grid):
             self.attach_next_to(self.bar, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 4, 1)
             self.attach_next_to(self.right_panel, self.scrollable_treelist, Gtk.PositionType.RIGHT, 1, 1)
         else:
-            self.attach(self.scrollable_treelist, 0, 0, 7, 5)
-            self.attach_next_to(self.bar, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 7, 1)
+            self.attach(self.scrollable_treelist, 0, 0, 3, 1)
+            self.attach_next_to(self.bar, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 3, 1)
             self.attach_next_to(self.right_panel, self.scrollable_treelist, Gtk.PositionType.RIGHT, 1, 1)
 
     def update_right_statusbar(self):
@@ -2438,6 +2434,15 @@ class App(Gtk.Application):
         self.win = OuterWindow(is_steam_deck, is_game_mode)
         self.win.set_icon_name("dzgui")
 
+        window = self.win.get_window()
+        screen = window.get_screen()
+        display = screen.get_display()
+        monitor = Gdk.Display.get_monitor_at_window(display, screen.get_root_window())
+        rect = monitor.get_geometry()
+        w = rect.width
+        h = rect.height
+        self.win.set_size_request((w/3), h/3)
+
         accel = Gtk.AccelGroup()
         accel.connect(Gdk.KEY_q, Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE, self._halt_window_subprocess)
         self.win.add_accel_group(accel)

From 117814ad61dcd8d9e9c9830685e7b1101be067e5 Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Fri, 14 Mar 2025 23:34:40 +0900
Subject: [PATCH 02/12] feat: save window size on quit

---
 helpers/ui.py | 86 ++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 65 insertions(+), 21 deletions(-)

diff --git a/helpers/ui.py b/helpers/ui.py
index b24839d..22274fc 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -50,6 +50,7 @@ helpers_path = '%s/.local/share/dzgui/helpers' %(user_path)
 log_path = '%s/logs' %(state_path)
 changelog_path = '%s/CHANGELOG.md' %(state_path)
 geometry_path = '%s/dzg.cols.json' %(state_path)
+res_path = '%s/dzg.res.json' %(state_path)
 funcs = '%s/funcs' %(helpers_path)
 mods_temp_file = '%s/dzg.mods_temp' %(cache_path)
 stale_mods_temp_file = '%s/dzg.stale_mods_temp' %(cache_path)
@@ -88,10 +89,10 @@ log_cols = [
 ]
 filters = {
     "1PP": True,
-    "3PP": True,
     "Day": True,
-    "Night": True,
     "Empty": False,
+    "3PP": True,
+    "Night": True,
     "Full": False,
     "Low pop": True,
     "Non-ASCII": False,
@@ -685,7 +686,7 @@ def process_shell_return_code(transient_parent, msg, code, original_input):
             process_tree_option([treeview.view, RowType.HANDSHAKE], treeview)
         case 255:
             spawn_dialog(transient_parent, "Update complete. Please close DZGUI and restart.", Popup.NOTIFY)
-            Gtk.main_quit()
+            save_res_and_quit(transient_parent)
 
 
 def process_tree_option(input, treeview):
@@ -878,8 +879,20 @@ class OuterWindow(Gtk.Window):
             if query_config(None, "fullscreen")[0] == "true":
                 self.maximize()
 
-        # Hide FilterPanel on main menu
+        if os.path.isfile(res_path):
+            with open(res_path, "r") as infile:
+                try:
+                    data = json.load(infile)
+                    valid_json = True
+                except json.decoder.JSONDecodeError:
+                    logger.critical("JSON decode error in '%s'" %(geometry_path))
+                    valid_json = False
+
+        if valid_json:
+            self.set_default_size(data["res"]["width"], data["res"]["height"])
+
         self.show_all()
+        # Hide FilterPanel on main menu
         self.grid.right_panel.set_filter_visibility(False)
         self.grid.sel_panel.set_visible(False)
         self.grid.scrollable_treelist.treeview.grab_focus()
@@ -970,7 +983,7 @@ class ButtonBox(Gtk.Box):
             button.set_opacity(0.6)
             self.buttons.append(button)
             button.connect("clicked", self._on_selection_button_clicked)
-            self.pack_start(button, False, False, True)
+            self.pack_start(button, False, False, 0)
 
         self.buttons[0].set_opacity(1.0)
 
@@ -1042,7 +1055,9 @@ class ButtonBox(Gtk.Box):
 
         if context == ButtonType.EXIT:
             logger.info("Normal user exit")
-            Gtk.main_quit()
+            widgets = relative_widget(self)
+            window = widgets["outer"]
+            save_res_and_quit(window)
             return
         cols = treeview.get_columns()
 
@@ -2434,25 +2449,46 @@ class App(Gtk.Application):
         self.win = OuterWindow(is_steam_deck, is_game_mode)
         self.win.set_icon_name("dzgui")
 
-        window = self.win.get_window()
-        screen = window.get_screen()
-        display = screen.get_display()
-        monitor = Gdk.Display.get_monitor_at_window(display, screen.get_root_window())
-        rect = monitor.get_geometry()
-        w = rect.width
-        h = rect.height
-        self.win.set_size_request((w/3), h/3)
 
         accel = Gtk.AccelGroup()
         accel.connect(Gdk.KEY_q, Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE, self._halt_window_subprocess)
         self.win.add_accel_group(accel)
 
-        GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, Gtk.main_quit)
+
+        GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, self._halt_window_subprocess)
         Gtk.main()
 
     def _halt_window_subprocess(self, accel_group, window, code, flag):
+        save_res_and_quit(self.win)
         self.win.halt_proc_and_quit(self, None)
 
+def save_res_and_quit(window):
+    if window.props.is_maximized:
+        return
+    rect = window.get_size()
+
+    def write_json(rect):
+        data = {"res": { "width": rect.width, "height": rect.height } }
+        j = json.dumps(data, indent=2)
+        with open(res_path, "w") as outfile:
+            outfile.write(j)
+        logger.info("Wrote initial column widths to '%s'" %(res_path))
+
+    if os.path.isfile(res_path):
+        with open(res_path, "r") as infile:
+            try:
+                data = json.load(infile)
+                data["res"]["width"] = rect.width
+                data["res"]["height"] = rect.height
+                with open(res_path, "w") as outfile:
+                    outfile.write(json.dumps(data, indent=2))
+            except json.decoder.JSONDecodeError:
+                logger.critical("JSON decode error in '%s'" %(res_path))
+                write_json(rect)
+    else:
+        write_json(rect)
+
+    Gtk.main_quit()
 
 class ModSelectionPanel(Gtk.Box):
     def __init__(self):
@@ -2621,7 +2657,7 @@ class FilterPanel(Gtk.Box):
         self.keyword_entry.set_placeholder_text("Filter by keyword")
         self.keyword_entry.connect("activate", self._on_keyword_enter)
         self.keyword_entry.connect("key-press-event", self._on_esc_pressed)
-    
+
         completion = Gtk.EntryCompletion(inline_completion=True)
         completion.set_text_column(0)
         completion.set_minimum_key_length(1)
@@ -2630,7 +2666,7 @@ class FilterPanel(Gtk.Box):
         renderer_text = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
         self.maps_combo = Gtk.ComboBox.new_with_model_and_entry(map_store)
         self.maps_combo.set_entry_text_column(0)
-    
+
         # instantiate maps completer entry
         self.maps_entry = self.maps_combo.get_child()
         self.maps_entry.set_completion(completion)
@@ -2642,12 +2678,20 @@ class FilterPanel(Gtk.Box):
         self.maps_combo.connect("changed", self._on_map_changed)
         self.maps_combo.connect("key-press-event", self._on_esc_pressed)
 
-        self.pack_start(self.filters_label, False, False, True)
-        self.pack_start(self.keyword_entry, False, False, True)
-        self.pack_start(self.maps_combo, False, False, True)
+        self.pack_start(self.filters_label, False, False, 0)
+        self.pack_start(self.keyword_entry, False, False, 0)
+        self.pack_start(self.maps_combo, False, False, 0)
 
+        button_grid = Gtk.Grid()
+        row = 1
+        col = 0
         for i, check in enumerate(checks[0:]):
-            self.pack_start(checks[i], False, False, True)
+            col = col + 1
+            if (col > 3):
+                row = row + 1
+                col = 1
+            button_grid.attach(checks[i], col, row, 1, 1)
+        self.pack_start(button_grid, False, False, 0)
 
     def _on_map_entry_keypress(self, entry, event):
         match event.keyval:

From 35804df4dfb66c1f62447c3552a64b2e9288d017 Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Fri, 14 Mar 2025 23:36:52 +0900
Subject: [PATCH 03/12] fix: move call to other func def

---
 helpers/ui.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/helpers/ui.py b/helpers/ui.py
index 22274fc..6d07f30 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -899,7 +899,7 @@ class OuterWindow(Gtk.Window):
 
     def halt_proc_and_quit(self, window, event):
         self.grid.terminate_treeview_process()
-        Gtk.main_quit()
+        save_res_and_quit(self.win)
 
 
 class ScrollableTree(Gtk.ScrolledWindow):
@@ -2459,7 +2459,6 @@ class App(Gtk.Application):
         Gtk.main()
 
     def _halt_window_subprocess(self, accel_group, window, code, flag):
-        save_res_and_quit(self.win)
         self.win.halt_proc_and_quit(self, None)
 
 def save_res_and_quit(window):

From df872fa4e7f3f0d23c9c369bd24d25205e02fe0a Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Fri, 14 Mar 2025 23:47:46 +0900
Subject: [PATCH 04/12] fix: send proper params to halt funcs

---
 helpers/ui.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/helpers/ui.py b/helpers/ui.py
index 6d07f30..622bff3 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -899,7 +899,7 @@ class OuterWindow(Gtk.Window):
 
     def halt_proc_and_quit(self, window, event):
         self.grid.terminate_treeview_process()
-        save_res_and_quit(self.win)
+        save_res_and_quit(window)
 
 
 class ScrollableTree(Gtk.ScrolledWindow):
@@ -2455,11 +2455,14 @@ class App(Gtk.Application):
         self.win.add_accel_group(accel)
 
 
-        GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, self._halt_window_subprocess)
+        GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, self._catch_sigint)
         Gtk.main()
 
+    def _catch_sigint(self):
+        self.win.halt_proc_and_quit(self.win, None)
+
     def _halt_window_subprocess(self, accel_group, window, code, flag):
-        self.win.halt_proc_and_quit(self, None)
+        self.win.halt_proc_and_quit(self.win, None)
 
 def save_res_and_quit(window):
     if window.props.is_maximized:

From 52961755ffedaa00d6c14517e99e827dc5b0befa Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 12:09:51 +0900
Subject: [PATCH 05/12] fix: quit signal being blocked in fullscreen

---
 helpers/ui.py | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/helpers/ui.py b/helpers/ui.py
index 622bff3..6412f4f 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -875,21 +875,26 @@ class OuterWindow(Gtk.Window):
         self.add(self.grid)
         if is_game_mode is True:
             self.fullscreen()
+        elif query_config(None, "fullscreen")[0] == "true":
+            logger.info("User preference for 'fullscreen' is 'true'")
+            self.maximize()
         else:
-            if query_config(None, "fullscreen")[0] == "true":
-                self.maximize()
-
-        if os.path.isfile(res_path):
-            with open(res_path, "r") as infile:
-                try:
-                    data = json.load(infile)
-                    valid_json = True
-                except json.decoder.JSONDecodeError:
-                    logger.critical("JSON decode error in '%s'" %(geometry_path))
-                    valid_json = False
-
-        if valid_json:
-            self.set_default_size(data["res"]["width"], data["res"]["height"])
+            if os.path.isfile(res_path):
+                with open(res_path, "r") as infile:
+                    try:
+                        data = json.load(infile)
+                        valid_json = True
+                    except json.decoder.JSONDecodeError:
+                        logger.critical("JSON decode error in '%s'" %(geometry_path))
+                        valid_json = False
+            else:
+                valid_json = False
+            if valid_json:
+                res = data["res"]
+                w = res["width"]
+                h = res["height"]
+                logger.info("Restoring window size to %s,%s" %(w,h))
+                self.set_default_size(w, h)
 
         self.show_all()
         # Hide FilterPanel on main menu
@@ -2466,6 +2471,7 @@ class App(Gtk.Application):
 
 def save_res_and_quit(window):
     if window.props.is_maximized:
+        Gtk.main_quit()
         return
     rect = window.get_size()
 
@@ -2474,7 +2480,7 @@ def save_res_and_quit(window):
         j = json.dumps(data, indent=2)
         with open(res_path, "w") as outfile:
             outfile.write(j)
-        logger.info("Wrote initial column widths to '%s'" %(res_path))
+        logger.info("Wrote initial window size to '%s'" %(res_path))
 
     if os.path.isfile(res_path):
         with open(res_path, "r") as infile:

From 22758938bd40bf6e5bd5b3eba2fe03db7625133c Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 12:12:44 +0900
Subject: [PATCH 06/12] chore: bump ui version

---
 helpers/ui.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/helpers/ui.py b/helpers/ui.py
index 6412f4f..1d3647d 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -17,7 +17,7 @@ import gi
 gi.require_version("Gtk", "3.0")
 from gi.repository import Gtk, GLib, Gdk, GObject, Pango
 
-# 5.6.0
+# 5.7.0
 app_name = "DZGUI"
 
 cache = {}

From 2e2b738ca66eb296deb18d55176a35552f318d5a Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 16:22:03 +0900
Subject: [PATCH 07/12] fix: use same padding on all devices

---
 helpers/ui.py | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/helpers/ui.py b/helpers/ui.py
index 1d3647d..4baeea9 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -942,8 +942,7 @@ class RightPanel(Gtk.Box):
         self.question_button.connect("clicked", self._on_button_clicked)
 
         self.pack_start(self.debug_toggle, False, True, 0)
-        if is_steam_deck is False:
-            self.pack_start(self.question_button, False, True, 0)
+        self.pack_start(self.question_button, False, True, 0)
 
     def _on_button_toggled(self, button, command):
         grid = self.get_parent()
@@ -2368,14 +2367,9 @@ class Grid(Gtk.Grid):
         self.bar.add(self.status_right_label)
         self.update_right_statusbar()
 
-        if is_steam_deck is True:
-            self.attach(self.scrollable_treelist, 0, 0, 4, 1)
-            self.attach_next_to(self.bar, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 4, 1)
-            self.attach_next_to(self.right_panel, self.scrollable_treelist, Gtk.PositionType.RIGHT, 1, 1)
-        else:
-            self.attach(self.scrollable_treelist, 0, 0, 3, 1)
-            self.attach_next_to(self.bar, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 3, 1)
-            self.attach_next_to(self.right_panel, self.scrollable_treelist, Gtk.PositionType.RIGHT, 1, 1)
+        self.attach(self.scrollable_treelist, 0, 0, 3, 1)
+        self.attach_next_to(self.bar, self.scrollable_treelist, Gtk.PositionType.BOTTOM, 3, 1)
+        self.attach_next_to(self.right_panel, self.scrollable_treelist, Gtk.PositionType.RIGHT, 1, 1)
 
     def update_right_statusbar(self):
         config_vals.clear()

From 4cbffaf3ffdf7779ec4469932ee1ad3c2c431d32 Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 16:31:44 +0900
Subject: [PATCH 08/12] chore: update checksums

---
 CHANGELOG.md  | 10 ++++++++++
 dzgui.sh      |  4 ++--
 helpers/ui.py |  4 +---
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6a2b24f..4ef6c00 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
 # Changelog
 
+## [5.7.0-beta.10] 2024-03-15
+## Added
+- Restore application size on subsequent startup
+
+## Fixed
+- Grid scaling causes table to exceeds bounds of display viewport
+- Window exceeds taskbar on Steam Deck
+## Changed
+- Packed filter checkbox buttons into a 3x3 grid
+
 ## [5.7.0-beta.9] 2024-03-04
 ## Fixed
 - Livonia server results being dropped from batch queries
diff --git a/dzgui.sh b/dzgui.sh
index a70ab3e..6e4d650 100755
--- a/dzgui.sh
+++ b/dzgui.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 set -o pipefail
 
-version=5.7.0-beta.9
+version=5.7.0-beta.10
 
 #CONSTANTS
 aid=221100
@@ -587,7 +587,7 @@ fetch_helpers_by_sum(){
     [[ -f "$config_file" ]] && source "$config_file"
     declare -A sums
     sums=(
-        ["ui.py"]="5a876efacf208d12b5fe761996425412"
+        ["ui.py"]="dfec256412be2bfb83d69ad873f244e1"
         ["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
         ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
         ["funcs"]="0d2d7a2b08f1112dc2474ba81a489002"
diff --git a/helpers/ui.py b/helpers/ui.py
index 4baeea9..7ef7db8 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -2463,6 +2463,7 @@ class App(Gtk.Application):
     def _halt_window_subprocess(self, accel_group, window, code, flag):
         self.win.halt_proc_and_quit(self.win, None)
 
+
 def save_res_and_quit(window):
     if window.props.is_maximized:
         Gtk.main_quit()
@@ -2514,7 +2515,6 @@ class ModSelectionPanel(Gtk.Box):
             button.connect("clicked", self._on_button_clicked)
             self.pack_start(button, False, True, 0)
 
-
     def initialize(self):
         l = len(self.get_children())
         last = self.get_children()[l-1]
@@ -2526,7 +2526,6 @@ class ModSelectionPanel(Gtk.Box):
                 case "Unhighlight stale":
                     i.set_label("Highlight stale")
 
-
     def _on_button_clicked(self, button):
         self.active_button = button
         label = button.get_label()
@@ -2555,7 +2554,6 @@ class ModSelectionPanel(Gtk.Box):
                         path = Gtk.TreePath(i)
                         treeview.get_selection().select_path(path)
 
-
     def _remove_last_button(self):
         children = self.get_children()
         l = len(children)

From acf43b159180461e7c40f4951b2ef4969d25b739 Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 16:40:31 +0900
Subject: [PATCH 09/12] chore: remove newline

---
 CHANGELOG.md | 1 -
 1 file changed, 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ef6c00..6759ca8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,6 @@
 ## [5.7.0-beta.10] 2024-03-15
 ## Added
 - Restore application size on subsequent startup
-
 ## Fixed
 - Grid scaling causes table to exceeds bounds of display viewport
 - Window exceeds taskbar on Steam Deck

From 1b7254003aeaa4b9aacf81dfd9176d7720a1f7ee Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 16:50:25 +0900
Subject: [PATCH 10/12] chore: update ip db checksum

---
 dzgui.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dzgui.sh b/dzgui.sh
index 6e4d650..74f5cb7 100755
--- a/dzgui.sh
+++ b/dzgui.sh
@@ -639,7 +639,7 @@ fetch_helpers_by_sum(){
 }
 fetch_geo_file(){
     # for binary releases
-    local geo_sum="9824e9b9a75a4830a2423932cc188b06"
+    local geo_sum="76ec9e25b92022de5d2e9c41baf88772"
     local km_sum="b038fdb8f655798207bd28de3a004706"
     local gzip="$helpers_path/ips.csv.gz"
     if [[ ! -f $geo_file  ]] || [[ $(get_hash $geo_file) != $geo_sum ]]; then

From 05e897dd31ab5de1ef643bac623e8139ef6d8875 Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 16:51:54 +0900
Subject: [PATCH 11/12] chore: update changelog

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6759ca8..db373d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@
 - Window exceeds taskbar on Steam Deck
 ## Changed
 - Packed filter checkbox buttons into a 3x3 grid
+- Updated IP database to 2025-03 records
 
 ## [5.7.0-beta.9] 2024-03-04
 ## Fixed

From 3c235e22edea8e0909ddf8c03b4c57470d815b6b Mon Sep 17 00:00:00 2001
From: aclist <92275929+aclist@users.noreply.github.com>
Date: Sat, 15 Mar 2025 17:43:28 +0900
Subject: [PATCH 12/12] chore: update changelog

---
 CHANGELOG.md  |  1 +
 dzgui.sh      |  4 ++--
 helpers/funcs | 14 ++++++++++----
 helpers/ui.py |  8 +++++---
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index db373d1..5bdbc03 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
 ## Fixed
 - Grid scaling causes table to exceeds bounds of display viewport
 - Window exceeds taskbar on Steam Deck
+- Reduce possibility of timeouts when pinging servers
 ## Changed
 - Packed filter checkbox buttons into a 3x3 grid
 - Updated IP database to 2025-03 records
diff --git a/dzgui.sh b/dzgui.sh
index 74f5cb7..41cf671 100755
--- a/dzgui.sh
+++ b/dzgui.sh
@@ -587,10 +587,10 @@ fetch_helpers_by_sum(){
     [[ -f "$config_file" ]] && source "$config_file"
     declare -A sums
     sums=(
-        ["ui.py"]="dfec256412be2bfb83d69ad873f244e1"
+        ["ui.py"]="121f27e51c945d78e97b77397d3c5173"
         ["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
         ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
-        ["funcs"]="0d2d7a2b08f1112dc2474ba81a489002"
+        ["funcs"]="fd7c23e39a70099a7f0006afd8919508"
         ["lan"]="c62e84ddd1457b71a85ad21da662b9af"
     )
     local author="aclist"
diff --git a/helpers/funcs b/helpers/funcs
index 80f45f2..4f7f02d 100755
--- a/helpers/funcs
+++ b/helpers/funcs
@@ -784,12 +784,18 @@ logger(){
 }
 test_ping(){
     shift
+    local time
     local ip="$1"
     local qport="$2"
-    local res
-    res=$(ping -c1 -4 -W0.5 $1 | grep time= | awk -F= '{print $4}')
-    [[ ! $? -eq 0 ]] && res="Timed out"
-    printf "%s" "$res"
+    log "$ip"
+    log "$qport"
+    res=$(a2s $ip $qport info)
+    if [[ -z $res ]]; then
+        time="Timed out"
+    else
+        time=$(<<< "$res" jq -r '.[].ping')
+    fi
+    printf "%s" "$time"
 }
 show_server_modlist(){
     shift
diff --git a/helpers/ui.py b/helpers/ui.py
index 7ef7db8..1995e83 100644
--- a/helpers/ui.py
+++ b/helpers/ui.py
@@ -1091,12 +1091,13 @@ class ButtonBox(Gtk.Box):
 
 
 class CalcDist(multiprocessing.Process):
-    def __init__(self, widget, addr, result_queue, cache):
+    def __init__(self, widget, addr, qport, result_queue, cache):
         super().__init__()
 
         self.widget = widget
         self.result_queue = result_queue
         self.addr = addr
+        self.qport = str(qport)
         self.ip = addr.split(':')[0]
 
     def run(self):
@@ -1105,7 +1106,7 @@ class CalcDist(multiprocessing.Process):
             self.result_queue.put([self.addr, cache[self.addr][0], cache[self.addr][1]])
             return
         proc = call_out(self.widget, "get_dist", self.ip)
-        proc2 = call_out(self.widget, "test_ping", self.ip)
+        proc2 = call_out(self.widget, "test_ping", self.ip, self.qport)
         km = proc.stdout
         ping = proc2.stdout
         self.result_queue.put([self.addr, km, ping])
@@ -1332,6 +1333,7 @@ class TreeView(Gtk.TreeView):
 
         if self.view == WindowContext.TABLE_API or self.view == WindowContext.TABLE_SERVER:
             addr = self.get_column_at_index(7)
+            qport = self.get_column_at_index(8)
             if addr is None:
                 server_tooltip[0] = format_tooltip()
                 grid.update_statusbar(server_tooltip[0])
@@ -1345,7 +1347,7 @@ class TreeView(Gtk.TreeView):
                 grid.update_statusbar(tooltip)
                 return
             self.emit("on_distcalc_started")
-            self.current_proc = CalcDist(self, addr, self.queue, cache)
+            self.current_proc = CalcDist(self, addr, qport, self.queue, cache)
             self.current_proc.start()
         else:
             tooltip = format_metadata(row_sel)