texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5544] try not to end up in footnotes window


From: Gavin D. Smith
Subject: [5544] try not to end up in footnotes window
Date: Fri, 09 May 2014 18:10:21 +0000

Revision: 5544
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5544
Author:   gavin
Date:     2014-05-09 18:10:21 +0000 (Fri, 09 May 2014)
Log Message:
-----------
try not to end up in footnotes window

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/footnotes.c
    trunk/info/window.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-05-09 17:41:30 UTC (rev 5543)
+++ trunk/ChangeLog     2014-05-09 18:10:21 UTC (rev 5544)
@@ -12,6 +12,13 @@
        * info/signals.c (redisplay_after_signal): [automatic-footnotes=On]
        Redisplay footnotes after a window resize to get the correct size.
 
+       * info/footnotes.c (info_get_or_remove_footnotes): Mark footnotes
+       windows with W_TempWindow.  (Note: This flag was not used anywhere.)
+       * info/window.c (window_delete_window): Prefer windows that are
+       not marked with W_TempWindow.  (For example, opening and closing
+       a help window would result in an enlarged footnotes window being
+       selected.)
+
 2014-05-09  Gavin Smith  <address@hidden>
 
        * info/nodes.c (info_find_file): If full path to file has been given,

Modified: trunk/info/footnotes.c
===================================================================
--- trunk/info/footnotes.c      2014-05-09 17:41:30 UTC (rev 5543)
+++ trunk/info/footnotes.c      2014-05-09 18:10:21 UTC (rev 5544)
@@ -229,6 +229,7 @@
       old_active = active_window;
       active_window = last;
       fn_win = window_make_window (new_footnotes);
+      fn_win->flags |= W_TempWindow;
       active_window = old_active;
 
       if (!fn_win)

Modified: trunk/info/window.c
===================================================================
--- trunk/info/window.c 2014-05-09 17:41:30 UTC (rev 5543)
+++ trunk/info/window.c 2014-05-09 18:10:21 UTC (rev 5544)
@@ -657,13 +657,26 @@
 
   if (window == active_window)
     {
+      WINDOW *new_active = 0;
+
       /* If there isn't a next window, then there must be a previous one,
          since we cannot delete the last window.  If there is a next window,
-         prefer to use that as the active window. */
+         prefer to use that as the active window.  Try to find an important
+         window to select, e.g. not a footnotes window. */
       if (next)
-        active_window = next;
-      else
-        active_window = prev;
+        {
+          new_active = next;
+          while ((new_active->flags & W_TempWindow) && new_active->next)
+            new_active = new_active->next;
+        }
+
+      if ((!new_active || new_active->flags & W_TempWindow) && prev)
+        {
+          new_active = prev;
+          while ((new_active->flags & W_TempWindow) && new_active->prev)
+            new_active = new_active->prev;
+        }
+      active_window = new_active;
     }
 
   if (next && active_window == next)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]