all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: eugene@ikz.ru, emacs-devel@gnu.org
Subject: Re: [eugene@ikz.ru: mouse-drag-vertical-line or	mouse-drag-mode-line failed with complex window split]
Date: Thu, 15 Jun 2006 11:09:54 -0400	[thread overview]
Message-ID: <E1FqtTm-0006gJ-3N@fencepost.gnu.org> (raw)
In-Reply-To: <44900219.3030504@gmx.at> (message from martin rudalics on Wed, 14 Jun 2006 14:33:29 +0200)

Does this fix it?

*** window.c	13 Jun 2006 19:07:16 -0400	1.549
--- window.c	15 Jun 2006 10:19:24 -0400	
***************
*** 63,69 ****
  static void window_scroll_line_based P_ ((Lisp_Object, int, int, int));
  static int window_min_size_1 P_ ((struct window *, int));
  static int window_min_size P_ ((struct window *, int, int, int *));
! static void size_window P_ ((Lisp_Object, int, int, int));
  static int freeze_window_start P_ ((struct window *, void *));
  static int window_fixed_size_p P_ ((struct window *, int, int));
  static void enlarge_window P_ ((Lisp_Object, int, int));
--- 63,69 ----
  static void window_scroll_line_based P_ ((Lisp_Object, int, int, int));
  static int window_min_size_1 P_ ((struct window *, int));
  static int window_min_size P_ ((struct window *, int, int, int *));
! static void size_window P_ ((Lisp_Object, int, int, int, int));
  static int freeze_window_start P_ ((struct window *, void *));
  static int window_fixed_size_p P_ ((struct window *, int, int));
  static void enlarge_window P_ ((Lisp_Object, int, int));
***************
*** 2826,2832 ****
  
  /* Set WINDOW's height or width to SIZE.  WIDTH_P non-zero means set
     WINDOW's width.  Resize WINDOW's children, if any, so that they
!    keep their proportionate size relative to WINDOW.  Propagate
     WINDOW's top or left edge position to children.  Delete windows
     that become too small unless NODELETE_P is non-zero.
  
--- 2826,2836 ----
  
  /* Set WINDOW's height or width to SIZE.  WIDTH_P non-zero means set
     WINDOW's width.  Resize WINDOW's children, if any, so that they
!    keep their proportionate size relative to WINDOW, but if LAST_P
!    is 1, change only the last of WINDOW's children when they
!    are in series.
! 
!   Propagate
     WINDOW's top or left edge position to children.  Delete windows
     that become too small unless NODELETE_P is non-zero.
  
***************
*** 2834,2840 ****
     too small, even if they were too small before!  */
  
  static void
! size_window (window, size, width_p, nodelete_p)
       Lisp_Object window;
       int size, width_p, nodelete_p;
  {
--- 2838,2844 ----
     too small, even if they were too small before!  */
  
  static void
! size_window (window, size, width_p, nodelete_p, last_p)
       Lisp_Object window;
       int size, width_p, nodelete_p;
  {
***************
*** 2911,2916 ****
--- 2915,2921 ----
  
    if (!NILP (*sideward))
      {
+       /* We have a chain of parallel siblings whose size should all change.  */
        for (child = *sideward; !NILP (child); child = c->next)
  	{
  	  c = XWINDOW (child);
***************
*** 2918,2925 ****
  	    c->left_col = w->left_col;
  	  else
  	    c->top_line = w->top_line;
! 	  size_window (child, size, width_p, nodelete_p);
  	}
      }
    else if (!NILP (*forward))
      {
--- 2923,2947 ----
  	    c->left_col = w->left_col;
  	  else
  	    c->top_line = w->top_line;
! 	  size_window (child, size, width_p, nodelete_p, last_p);
! 	}
!     }
!   else if (!NILP (*forward) && last_p)
!     {
!       /* Change the last in a series of siblings.  */
!       Lisp_Object last_child;
!       int child_size;
! 
!       for (child = *forward; !NILP (child); child = c->next)
! 	{
! 	  c = XWINDOW (child);
! 	  last_child = child;
  	}
+ 
+       child_size = XINT (width_p ? c->total_cols : c->total_lines);
+       size_window (last_child,
+ 		   size - old_size + child_size,
+ 		   width_p, nodelete_p, last_p);
      }
    else if (!NILP (*forward))
      {
***************
*** 2928,2934 ****
        int last_pos, first_pos, nchildren, total;
        int *new_sizes = NULL;
  
!       /* Determine the fixed-size portion of the this window, and the
  	 number of child windows.  */
        fixed_size = nchildren = nfixed = total = 0;
        for (child = *forward; !NILP (child); child = c->next, ++nchildren)
--- 2950,2956 ----
        int last_pos, first_pos, nchildren, total;
        int *new_sizes = NULL;
  
!       /* Determine the fixed-size portion of this window, and the
  	 number of child windows.  */
        fixed_size = nchildren = nfixed = total = 0;
        for (child = *forward; !NILP (child); child = c->next, ++nchildren)
***************
*** 2991,2997 ****
  	  /* Set new height.  Note that size_window also propagates
  	     edge positions to children, so it's not a no-op if we
  	     didn't change the child's size.  */
! 	  size_window (child, new_size, width_p, 1);
  
  	  /* Remember the bottom/right edge position of this child; it
  	     will be used to set the top/left edge of the next child.  */
--- 3013,3019 ----
  	  /* Set new height.  Note that size_window also propagates
  	     edge positions to children, so it's not a no-op if we
  	     didn't change the child's size.  */
! 	  size_window (child, new_size, width_p, 1, last_p);
  
  	  /* Remember the bottom/right edge position of this child; it
  	     will be used to set the top/left edge of the next child.  */
***************
*** 3010,3016 ****
  	    int child_size;
  	    c = XWINDOW (child);
  	    child_size = width_p ? XINT (c->total_cols) : XINT (c->total_lines);
! 	    size_window (child, child_size, width_p, 2);
  	  }
      }
  }
--- 3032,3038 ----
  	    int child_size;
  	    c = XWINDOW (child);
  	    child_size = width_p ? XINT (c->total_cols) : XINT (c->total_lines);
! 	    size_window (child, child_size, width_p, 2, last_p);
  	  }
      }
  }
***************
*** 3026,3032 ****
       int height;
       int nodelete;
  {
!   size_window (window, height, 0, nodelete);
  }
  
  
--- 3048,3054 ----
       int height;
       int nodelete;
  {
!   size_window (window, height, 0, nodelete, 0);
  }
  
  
***************
*** 3041,3047 ****
       int width;
       int nodelete;
  {
!   size_window (window, width, 1, nodelete);
  }
  
  /* Change window heights in windows rooted in WINDOW by N lines.  */
--- 3063,3069 ----
       int width;
       int nodelete;
  {
!   size_window (window, width, 1, nodelete, 0);
  }
  
  /* Change window heights in windows rooted in WINDOW by N lines.  */
***************
*** 4281,4288 ****
  
        if (NILP (window))
  	{
! 	  /* This can happen if WINDOW on the previous iteration was
! 	     at top level of the tree and we did not exit.  */
  	  Fset_window_configuration (old_config);
  	  error ("Specified window edge is fixed");
  	}
--- 4303,4310 ----
  
        if (NILP (window))
  	{
! 	  /* This happens if WINDOW on the previous iteration was
! 	     at top level of the window tree.  */
  	  Fset_window_configuration (old_config);
  	  error ("Specified window edge is fixed");
  	}
***************
*** 4304,4311 ****
  	}
  
        /* If this level's succession is in the desired dimension,
! 	 and this window is the last one, its trailing edge is fixed.  */
!       if (NILP (XWINDOW (window)->next) && NILP (first_parallel))
  	{
  	  Fset_window_configuration (old_config);
  	  error ("Specified window edge is fixed");
--- 4326,4335 ----
  	}
  
        /* If this level's succession is in the desired dimension,
! 	 and this window is the last one, and there is no higher level,
! 	 its trailing edge is fixed.  */
!       if (NILP (XWINDOW (window)->next) && NILP (first_parallel)
! 	  && NILP (parent))
  	{
  	  Fset_window_configuration (old_config);
  	  error ("Specified window edge is fixed");
***************
*** 4347,4353 ****
  	      XSETINT (CURBEG (p->next),
  		       XINT (CURBEG (p->next)) + delta);
  	      size_window (p->next, XINT (CURSIZE (p->next)) - delta,
! 			   horiz_flag, 0);
  	      break;
  	    }
  	}
--- 4371,4377 ----
  	      XSETINT (CURBEG (p->next),
  		       XINT (CURBEG (p->next)) + delta);
  	      size_window (p->next, XINT (CURSIZE (p->next)) - delta,
! 			   horiz_flag, 0, 1);
  	      break;
  	    }
  	}
***************
*** 4359,4365 ****
  	     child = XWINDOW (child)->next)
  	  if (! EQ (child, window))
  	    size_window (child, XINT (CURSIZE (child)) + delta,
! 			 horiz_flag, 0);
  
        window = parent;
      }
--- 4383,4389 ----
  	     child = XWINDOW (child)->next)
  	  if (! EQ (child, window))
  	    size_window (child, XINT (CURSIZE (child)) + delta,
! 			 horiz_flag, 0, 1);
  
        window = parent;
      }

  parent reply	other threads:[~2006-06-15 15:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05 15:38 [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split] Richard Stallman
2006-06-11 19:32 ` Chong Yidong
2006-06-12  8:37   ` martin rudalics
2006-06-13 23:21   ` Richard Stallman
2006-06-13 23:40     ` Chong Yidong
2006-06-14  7:26     ` Eugene Vlasov
2006-06-14 12:33       ` martin rudalics
2006-06-15  0:24         ` Nick Roberts
2006-06-15  7:42           ` martin rudalics
2006-06-15 15:09         ` Richard Stallman [this message]
2006-06-15 20:51           ` Eugene Vlasov
2006-06-16  6:53           ` martin rudalics
2006-06-19  7:42             ` Richard Stallman
2006-06-19 12:38               ` martin rudalics
2006-06-19 19:18               ` Eugene Vlasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1FqtTm-0006gJ-3N@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=eugene@ikz.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.