On Sun, Feb 23, 2003 at 01:26:29PM -0500, Paul Pelzl wrote:
> Found a bug.  Try executing "commands_at_leaf; close" while you have an
> open input box from one of the "query_" functions (e.g. query_yesno).

I've attached a patch that should fix this. (I'll wait a few days for
other bug reports and then make a new release with all the fixes as
I'm sure there are other things to be fixed.) The ChangeLog entries
for this patch are:

  * Fixed frame_close
  * Implemented "close" command for queries.
  * Added the command frame_close_if_empty and bound close command
    for frames to this.

-- 
Tuomo
Only in ./man: ion.1x
Only in .: pwm
diff -u -r -x CVS -x '*.o' -x '*.a' ../i/ion/query/main.c ./query/main.c
--- ../i/ion/query/main.c       2003-01-31 20:16:33.000000000 +0200
+++ ./query/main.c      2003-02-23 20:50:49.000000000 +0200
@@ -74,6 +74,8 @@
        FN_VOID(generic, WInput,        "cancel",                       input_cancel), 
 
        FN_VOID(generic, WInput,        "scrollup",                     
input_scrollup),
        FN_VOID(generic, WInput,        "scrolldown",           input_scrolldown),
+       
+       FN_VOID(generic, WInput,        "close",                        input_cancel), 
 
        END_FUNTAB
 };
 
diff -u -r -x CVS -x '*.o' -x '*.a' ../i/ion/src/funtabs.c ./src/funtabs.c
--- ../i/ion/src/funtabs.c      2003-02-22 19:40:18.000000000 +0200
+++ ./src/funtabs.c     2003-02-23 20:52:15.000000000 +0200
@@ -124,6 +124,7 @@
        FN_VOID(generic, WFrame,        "frame_attach_tagged",  frame_attach_tagged),
        FN_VOID(generic, WFrame,        "frame_toggle_sub_tag", frame_toggle_sub_tag),
        FN_VOID(generic, WFrame,        "frame_close",                  frame_close),
+       FN_VOID(generic, WFrame,        "frame_close_if_empty", frame_close_if_empty),
 
        FN_VOID(generic, WRegion,       "frame_resize_vert",    resize_vert),
        FN_VOID(generic, WRegion,       "frame_resize_horiz",   resize_horiz),
@@ -143,7 +144,7 @@
        FN_VOID(generic, WFrame,        "frame_move_current_tab_right", 
frame_move_current_tab_right),
 
        /* Common functions */
-       FN_VOID(generic, WFrame,        "close",                                
frame_close),
+       FN_VOID(generic, WFrame,        "close",                                
frame_close_if_empty),
        
        END_FUNTAB
 };
Only in ./src: ion
diff -u -r -x CVS -x '*.o' -x '*.a' ../i/ion/src/splitframe.c ./src/splitframe.c
--- ../i/ion/src/splitframe.c   2003-02-22 22:49:41.000000000 +0200
+++ ./src/splitframe.c  2003-02-23 20:53:38.000000000 +0200
@@ -178,20 +178,18 @@
        
        ws=(WWorkspace*)REGION_MANAGER(frame);
        
-       if(ws!=NULL || !WTHING_IS(ws, WWorkspace)){
+       if(ws==NULL || !WTHING_IS(ws, WWorkspace)){
                region_rescue_managed_on_list((WRegion*)frame, frame->managed_list);
                destroy_thing((WThing*)frame);
                return;
        }
        
-       if(ws!=NULL){
-               vp=(WViewport*)REGION_MANAGER(ws);
-               
-               if(vp!=NULL && WTHING_IS(vp, WViewport)){
-                       if(vp->ws_count<=1 && ws->split_tree==(WObj*)frame){
-                               fwarn(frame, "Cannot destroy only frame on only 
workspace.");
-                               return;
-                       }
+       vp=(WViewport*)REGION_MANAGER(ws);
+       
+       if(vp!=NULL && WTHING_IS(vp, WViewport)){
+               if(vp->ws_count<=1 && ws->split_tree==(WObj*)frame){
+                       fwarn(frame, "Cannot destroy only frame on only workspace.");
+                       return;
                }
        }
        
@@ -216,5 +214,14 @@
 }
 
 
+void frame_close_if_empty(WFrame *frame)
+{
+       if(frame->managed_count!=0 || frame->current_input!=NULL)
+               return;
+       
+       frame_close(frame);
+}
+
+
 /*}}}*/
 
diff -u -r -x CVS -x '*.o' -x '*.a' ../i/ion/src/splitframe.h ./src/splitframe.h
--- ../i/ion/src/splitframe.h   2003-02-22 19:40:18.000000000 +0200
+++ ./src/splitframe.h  2003-02-23 20:52:33.000000000 +0200
@@ -19,6 +19,7 @@
 extern void split_empty(WRegion *reg, const char *str);
 extern void split_top(WWorkspace *ws, const char *str);
 extern void frame_close(WFrame *frame);
+extern void frame_close_if_empty(WFrame *frame);
 
 #endif /* ION_SPLITFRAME_H */
 

Reply via email to