Let mentioning completed tourney file add one cycle
[xboard.git] / filebrowser / path.c
index edb43c8..a68b7c1 100644 (file)
@@ -34,8 +34,8 @@
 
 #include <X11/Xos.h>
 #include <pwd.h>
-#include "selfile.h"
 #include "xstat.h"
+#include "selfile.h"
 #include <X11/Xaw/Scrollbar.h>
 
 #ifndef MAXPATHLEN
 extern uid_t getuid();
 #endif /* def HAS_DIRENT_H */
 
-/* added missing prototypes */
-extern void SFtextChanged();
-extern int SFgetDir(SFDir *);
-extern void SFdrawLists(int);
-extern void SFdrawList(int, int);
-extern void SFclearList(int, int);
-extern void SFmotionList(Widget, int, XMotionEvent*);
-
 typedef struct {
        char    *name;
        char    *dir;
@@ -730,6 +722,7 @@ SFbuttonReleaseList(w, n, event)
        XButtonReleasedEvent    *event;
 {
        SFDir   *dir;
+       static int lastClick;
 
        if(event->button == Button4 || event->button == Button5) return; // [HGM] mouse wheel does not select
        SFbuttonPressed = 0;
@@ -745,7 +738,9 @@ SFbuttonReleaseList(w, n, event)
                        dir->entries[dir->vOrigin + SFcurrentInvert[n]].shown
                );
                SFmotionList(w, n, (XMotionEvent *) event);
+               if(lastClick == 256*n + SFcurrentInvert[n]) SFstatus = SEL_FILE_OK; // [HGM] double click implies OK
        }
+       lastClick = 256*n + SFcurrentInvert[n];
 }
 
 static int