fortrangoingonforty/sniffly / 2ec9f67

Browse files

fix breadcrumb clearing on empty tabs and window focus after dialog

Co-Authored-By: mfwolffe <wolffemf@dukes.jmu.edu>
Authored by espadonne
SHA
2ec9f673e7eb508040d1138a39b55e9ef4f62ba9
Parents
0b61102
Tree
e06b5a0

2 changed files

StatusFile+-
M src/gui/breadcrumb_widget.f90 5 1
M src/gui/gtk_app.f90 5 0
src/gui/breadcrumb_widget.f90modified
@@ -128,7 +128,11 @@ contains
128128
     cached_forward_segment_paths = ""
129129
     cached_forward_segment_names = ""
130130
 
131
-    if (len_trim(full_path) == 0) return
131
+    ! If path is empty, trigger redraw to clear breadcrumb and return
132
+    if (len_trim(full_path) == 0) then
133
+      call queue_redraw()
134
+      return
135
+    end if
132136
 
133137
     ! Use full path (no ~ abbreviation for better navigation)
134138
     working_path = trim(full_path)
src/gui/gtk_app.f90modified
@@ -559,6 +559,11 @@ contains
559559
     ! Call helper to show native file picker
560560
     call show_native_directory_picker(selected_path, status)
561561
 
562
+    ! Restore window focus after dialog (native dialogs steal focus on macOS)
563
+    if (c_associated(main_window_ptr)) then
564
+      call gtk_window_present(main_window_ptr)
565
+    end if
566
+
562567
     if (status == 0 .and. len_trim(selected_path) > 0) then
563568
       print *, "Selected directory: ", trim(selected_path)
564569