FVWM: FlipFocus patch for 2.0.43

From: Dan Niles <dan_at_more.net>
Date: Wed, 10 Jul 1996 07:54:05 -0500

Here is an my FlipFocus patch updated for fvwm 2.0.43. For those of
of you who are new, FlipFocus swaps the top two (selected) windows.
This lets you switch back and forth between frequently used windows without
having to remember if you need to use Prev or Next.

The arguments to FlipFocus are the same as to Focus.

------------------------ fvwm-2.0.43-FlipFocus.patch -------------------------
--- parse.h.orig Thu May 30 13:03:10 1996
+++ parse.h Tue Jul 9 11:25:10 1996
_at_@ -89,6 +89,7 @@
 #define F_SEND_STRING 112
 #define F_ADD_MOD 113
 #define F_DESTROY_MOD 114
+#define F_FLIP_FOCUS 115
 
 /* Functions for use by modules only! */
 #define F_SEND_WINDOW_LIST 1000
--- misc.h.orig Wed Jun 19 20:31:15 1996
+++ misc.h Tue Jul 9 11:16:15 1996
_at_@ -384,6 +384,8 @@
                unsigned long context,char *action, int *Module);
 void raise_it_func(XEvent *eventp,Window w,FvwmWindow *tmp_win,
                    unsigned long context, char *action, int *Module);
+void flip_focus_func(XEvent *eventp,Window w,FvwmWindow *tmp_win,
+ unsigned long context, char *action, int *Module);
 void focus_func(XEvent *eventp,Window w,FvwmWindow *tmp_win,
                 unsigned long context, char *action, int *Module);
 void warp_func(XEvent *eventp,Window w,FvwmWindow *tmp_win,
--- functions.c.orig Wed Jun 19 19:01:56 1996
+++ functions.c Tue Jul 9 11:16:15 1996
_at_@ -55,6 +55,7 @@
   {"EdgeResistance",SetEdgeResistance,F_EDGE_RES, FUNC_NO_WINDOW},
   {"Exec", exec_function, F_EXEC, FUNC_NO_WINDOW},
   {"ExecUseSHELL", exec_setup, F_EXEC_SETUP, FUNC_NO_WINDOW},
+ {"FlipFocus", flip_focus_func, F_FLIP_FOCUS, FUNC_NEEDS_WINDOW},
   {"Focus", focus_func, F_FOCUS, FUNC_NEEDS_WINDOW},
   {"Function", ComplexFunction, F_FUNCTION, FUNC_NO_WINDOW},
   {"GotoPage", goto_page_func, F_GOTO_PAGE, FUNC_NO_WINDOW},
--- builtins.c.orig Thu Jun 27 09:34:19 1996
+++ builtins.c Tue Jul 9 11:16:15 1996
_at_@ -847,6 +847,38 @@
 }
       
 
+void flip_focus_func(XEvent *eventp,Window w,FvwmWindow *tmp_win,
+ unsigned long context, char *action, int *Module)
+{
+
+ FvwmWindow *scratch;
+
+ if (DeferExecution(eventp,&w,&tmp_win,&context,SELECT,ButtonRelease))
+ return;
+
+ /* Reorder the window list */
+ if( Scr.Focus ){
+ if( Scr.Focus->next ) Scr.Focus->next->prev = Scr.Focus->prev;
+ if( Scr.Focus->prev ) Scr.Focus->prev->next = Scr.Focus->next;
+ Scr.Focus->next = Scr.FvwmRoot.next;
+ Scr.Focus->prev = &Scr.FvwmRoot;
+ if(Scr.FvwmRoot.next)Scr.FvwmRoot.next->prev = Scr.Focus;
+ Scr.FvwmRoot.next = Scr.Focus;
+ }
+ if( tmp_win != Scr.Focus ){
+ if( tmp_win->next ) tmp_win->next->prev = tmp_win->prev;
+ if( tmp_win->prev ) tmp_win->prev->next = tmp_win->next;
+ tmp_win->next = Scr.FvwmRoot.next;
+ tmp_win->prev = &Scr.FvwmRoot;
+ if(Scr.FvwmRoot.next)Scr.FvwmRoot.next->prev = tmp_win;
+ Scr.FvwmRoot.next = tmp_win;
+ }
+
+ FocusOn(tmp_win,0);
+
+}
+
+
 void focus_func(XEvent *eventp,Window w,FvwmWindow *tmp_win,
                 unsigned long context, char *action, int *Module)
 {
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Jul 10 1996 - 08:02:59 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST