unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
@ 2006-06-05 15:38 Richard Stallman
  2006-06-11 19:32 ` Chong Yidong
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Stallman @ 2006-06-05 15:38 UTC (permalink / raw)


Would someone please investigate this and ack?

------- Start of forwarded message -------
From: Eugene Vlasov <eugene@ikz.ru>
To: emacs-pretest-bug@gnu.org
Date: Tue, 30 May 2006 20:48:27 +0600 (YEKST)
Subject: mouse-drag-vertical-line or mouse-drag-mode-line failed with
	complex window split
X-Spam-Status: No, score=1.9 required=5.0 tests=FORGED_RCVD_HELO,
	RCVD_IN_BL_SPAMCOP_NET autolearn=no version=3.0.4

Steps to reproduce:

1. Start emacs: emacs -Q
2. Split window horizontally: C-x 3
3. Split one of windows vertically: C-x 2
After this position of vertical divider cannot be changed with mouse-1
grag, but keyboard bindings for wide/narrow window works.

More complex example for mouse-drag-mode-line:

1. Start emacs: emacs -Q
2. Split window vertically: C-x 2
3. Split selected window horizontally: C-x 3
4. Split selected window vertically: C-x 2
Then central horizontal divider cannot be dragged with mouse-1.


In GNU Emacs 22.0.50.1 (i686-alt-linux-gnu, GTK+ Version 2.8.17)
 of 2006-05-30 on eugene-home.ikz.ru
X server distributor `The X.Org Foundation', version 11.0.70000000
configured using `configure '--build=i686-alt-linux' '--host=i686-alt-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--without-included-gettext' '--sharedstatedir=/var' '--with-gcc' '--with-pop' '--with-x-toolkit=gtk' '--with-png' '--with-jpeg' '--with-xpm' '--with-gif' '--with-tiff' 'CFLAGS=-pipe -Wall -O2 -march=i686 -mtune=pentium4' 'build_alias=i686-alt-linux' 'host_alias=i686-alt-linux''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ru_RU.KOI8-R
  locale-coding-system: cyrillic-koi8
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  url-handler-mode: t
  display-time-mode: t
  recentf-mode: t
  encoded-kbd-mode: t
  jabber-activity-mode: t
  delete-selection-mode: t
  pc-selection-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <next> <next> <next> 
<next> q C-x 3 C-x 2 <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <down-mouse-1> 
<help-echo> <mouse-movement> <help-echo> <drag-mouse-1> 
<help-echo> C-x 1 M-x <up> <return>

Recent messages:
Wrote /home/eugene/.newsrc.eld
Saving /home/eugene/.newsrc.eld...done
Loading emacsbug...done
call-interactively: End of buffer [5 times]
Quit
Retrieving newsgroup: list.emacs-pretest-bug...
Fetching headers for list.emacs-pretest-bug...done
Generating summary...done
No more unread articles
Auto-saving...done


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  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
  0 siblings, 2 replies; 15+ messages in thread
From: Chong Yidong @ 2006-06-11 19:32 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Would someone please investigate this and ack?
>
> From: Eugene Vlasov <eugene@ikz.ru>
> Subject: mouse-drag-vertical-line or mouse-drag-mode-line failed with
> 	complex window split
>
> 1. Start emacs: emacs -Q
> 2. Split window horizontally: C-x 3
> 3. Split one of windows vertically: C-x 2
> After this position of vertical divider cannot be changed with mouse-1
> grag, but keyboard bindings for wide/narrow window works.

The bug was introduced by the following change.  I don't know which
part of your patch creates the problem.

2006-04-18  Richard Stallman  <rms@gnu.org>

	* window.c (adjust_window_trailing_edge): Correctly distinguish
	series vs parallel cases, even when window has no parent.

*** emacs/src/window.c	2006/04/17 21:50:59	1.542
--- emacs/src/window.c	2006/04/18 20:56:31	1.543
***************
*** 4275,4292 ****
  
    while (1)
      {
        p = XWINDOW (window);
        parent = p->parent;
  
!       /* Make sure there is a following window.  */
!       if (NILP (parent)
! 	  && (horiz_flag ? 1
! 	      : NILP (XWINDOW (window)->next)))
  	{
  	  Fset_window_configuration (old_config);
  	  error ("No other window following this one");
  	}
  
        /* Don't make this window too small.  */
        if (XINT (CURSIZE (window)) + delta
  	  < (horiz_flag ? window_min_width : window_min_height))
--- 4275,4304 ----
  
    while (1)
      {
+       Lisp_Object first_parallel = Qnil;
+ 
        p = XWINDOW (window);
        parent = p->parent;
  
!       if (NILP (XWINDOW (window)->next))
  	{
  	  Fset_window_configuration (old_config);
  	  error ("No other window following this one");
  	}
  
+       /* See if this level has windows in parallel in the specified
+ 	 direction.  If so, set FIRST_PARALLEL to the first one.  */
+       if (horiz_flag)
+ 	{
+ 	  if (! NILP (parent) && !NILP (XWINDOW (parent)->vchild))
+ 	    first_parallel = XWINDOW (parent)->vchild;
+ 	}
+       else
+ 	{
+ 	  if (! NILP (parent) && !NILP (XWINDOW (parent)->hchild))
+ 	    first_parallel = XWINDOW (parent)->hchild;
+ 	}
+ 
        /* Don't make this window too small.  */
        if (XINT (CURSIZE (window)) + delta
  	  < (horiz_flag ? window_min_width : window_min_height))
***************
*** 4304,4315 ****
  	       XINT (CURSIZE (window)) + delta);
  
        /* If this window has following siblings in the desired dimension,
! 	 make them smaller.
  	 (If we reach the top of the tree and can never do this,
  	 we will fail and report an error, above.)  */
!       if (horiz_flag
! 	  ? !NILP (XWINDOW (parent)->hchild)
! 	  : !NILP (XWINDOW (parent)->vchild))
  	{
  	  if (!NILP (XWINDOW (window)->next))
  	    {
--- 4316,4326 ----
  	       XINT (CURSIZE (window)) + delta);
  
        /* If this window has following siblings in the desired dimension,
! 	 make them smaller, and exit the loop.
! 
  	 (If we reach the top of the tree and can never do this,
  	 we will fail and report an error, above.)  */
!       if (NILP (first_parallel))
  	{
  	  if (!NILP (XWINDOW (window)->next))
  	    {
***************
*** 4331,4339 ****
        else
  	/* Here we have a chain of parallel siblings, in the other dimension.
  	   Change the size of the other siblings.  */
! 	for (child = (horiz_flag
! 		      ? XWINDOW (parent)->vchild
! 		      : XWINDOW (parent)->hchild);
  	     ! NILP (child);
  	     child = XWINDOW (child)->next)
  	  if (! EQ (child, window))
--- 4342,4348 ----
        else
  	/* Here we have a chain of parallel siblings, in the other dimension.
  	   Change the size of the other siblings.  */
! 	for (child = first_parallel;
  	     ! NILP (child);
  	     child = XWINDOW (child)->next)
  	  if (! EQ (child, window))

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-11 19:32 ` Chong Yidong
@ 2006-06-12  8:37   ` martin rudalics
  2006-06-13 23:21   ` Richard Stallman
  1 sibling, 0 replies; 15+ messages in thread
From: martin rudalics @ 2006-06-12  8:37 UTC (permalink / raw)
  Cc: rms, emacs-devel

 >>1. Start emacs: emacs -Q
 >>2. Split window horizontally: C-x 3
 >>3. Split one of windows vertically: C-x 2
 >>After this position of vertical divider cannot be changed with mouse-1
 >>grag, but keyboard bindings for wide/narrow window works.
 >
 >
 > The bug was introduced by the following change.  I don't know which
 > part of your patch creates the problem.
 >
 > 2006-04-18  Richard Stallman  <rms@gnu.org>

Maybe that change also caused the following problem:

1. emacs -Q
2. C-x 2
3. C-x 3

At this moment I can't resize the upper windows by dragging the modeline
of the right upper window with down-mouse-1.  Dragging the modeline of
the left upper window works normally.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  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
  1 sibling, 2 replies; 15+ messages in thread
From: Richard Stallman @ 2006-06-13 23:21 UTC (permalink / raw)
  Cc: emacs-devel

I think I fixed this.  Does it seem to work correctly now?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-13 23:21   ` Richard Stallman
@ 2006-06-13 23:40     ` Chong Yidong
  2006-06-14  7:26     ` Eugene Vlasov
  1 sibling, 0 replies; 15+ messages in thread
From: Chong Yidong @ 2006-06-13 23:40 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I think I fixed this.  Does it seem to work correctly now?

Works for me.  Thanks.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  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
  1 sibling, 1 reply; 15+ messages in thread
From: Eugene Vlasov @ 2006-06-14  7:26 UTC (permalink / raw)
  Cc: rms

On Tue, 13 Jun 2006 19:21:29 -0400 Richard Stallman wrote:

> I think I fixed this.  Does it seem to work correctly now?

Now it works much better. But here another testcase:
1. emacs -Q
2. C-x 2
3. C-x 3
4. C-x 2
5. C-u 2 C-x o
6. C-x 2
then central horizontal divider still cannot be moved with mouse drag.


-- 
WBR, Eugene Vlasov        mailto:eugvv at altlinux.ru
                          JID: eugvv@jabber.ru

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-14  7:26     ` Eugene Vlasov
@ 2006-06-14 12:33       ` martin rudalics
  2006-06-15  0:24         ` Nick Roberts
  2006-06-15 15:09         ` Richard Stallman
  0 siblings, 2 replies; 15+ messages in thread
From: martin rudalics @ 2006-06-14 12:33 UTC (permalink / raw)
  Cc: rms, emacs-devel

 > Now it works much better.

I second that.

 > But here another testcase:

My dual recipe is:

1. emacs -Q
2. C-x 3
3. C-x 2
4. C-x 3
5. C-x 2

At this moment I can't drag the modeline of the middle window on the
left (the window I created in step 5).

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  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
  1 sibling, 1 reply; 15+ messages in thread
From: Nick Roberts @ 2006-06-15  0:24 UTC (permalink / raw)
  Cc: emacs-devel, Eugene Vlasov, rms

martin rudalics writes:
 >  > Now it works much better.
 > 
 > I second that.
 > 
 >  > But here another testcase:
 > 
 > My dual recipe is:
 > 
 > 1. emacs -Q
 > 2. C-x 3
 > 3. C-x 2
 > 4. C-x 3
 > 5. C-x 2
 > 
 > At this moment I can't drag the modeline of the middle window on the
 > left (the window I created in step 5).

This looks like a contived window arrangement.  Do you actually need this
arrangement or were you just testing extreme situations?  I think we should
focus on bugs that are encountered in normal use, otherwise we really will be
here for eternity.  In your example, you can still move the mode line by
selecting it from the window to the right.

In Eugene's example, I just note that I can't move the lower mode line at all.
Also that if scroll-bar-mode is disabled, the bug with the vertical divider,
that he reported, disappears, which seems a bit odd.


-- 
Nick                                           http://www.inet.net.nz/~nickrob

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-15  0:24         ` Nick Roberts
@ 2006-06-15  7:42           ` martin rudalics
  0 siblings, 0 replies; 15+ messages in thread
From: martin rudalics @ 2006-06-15  7:42 UTC (permalink / raw)
  Cc: emacs-devel, Eugene Vlasov, rms

 > This looks like a contived window arrangement.  Do you actually need this
 > arrangement or were you just testing extreme situations?  I think we should
 > focus on bugs that are encountered in normal use, otherwise we really will be
 > here for eternity.  In your example, you can still move the mode line by
 > selecting it from the window to the right.

I don't need this but I frequently need the arrangement described in my
earlier mail on this subject.  Happily that has been resolved.

Anyway, we are talking about a regression here because all these worked
with pre-April releases.  I contributed mine only to give further clues
on how to reproduce the bug and am confident that my case automatically
disappears as soon as Evgeni's problem has been resolved.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-14 12:33       ` martin rudalics
  2006-06-15  0:24         ` Nick Roberts
@ 2006-06-15 15:09         ` Richard Stallman
  2006-06-15 20:51           ` Eugene Vlasov
  2006-06-16  6:53           ` martin rudalics
  1 sibling, 2 replies; 15+ messages in thread
From: Richard Stallman @ 2006-06-15 15:09 UTC (permalink / raw)
  Cc: eugene, emacs-devel

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;
      }

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-15 15:09         ` Richard Stallman
@ 2006-06-15 20:51           ` Eugene Vlasov
  2006-06-16  6:53           ` martin rudalics
  1 sibling, 0 replies; 15+ messages in thread
From: Eugene Vlasov @ 2006-06-15 20:51 UTC (permalink / raw)
  Cc: martin rudalics, rms

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

On Thu, 15 Jun 2006 11:09:54 -0400 Richard Stallman wrote:

> Does this fix it?
>
> *** window.c	13 Jun 2006 19:07:16 -0400	1.549
> --- window.c	15 Jun 2006 10:19:24 -0400	

I found another strangeness with this patch. If split window as i
wrote earlier ("C-x 2" "C-x 3" "C-x 2" "C-u 2 C-x o" "C-x 2") we have:

---------
!   !   !
!---1-3-!
!   !   !
!---2-4-!
!       !
!       !
---------

Then if move vertical divider with handle 1 all ok.
But if try to move vertical divider with handle 2, and then change
position of horizontal dividers 3 or 4, window split looks broken:


[-- Attachment #2: Broken window split --]
[-- Type: image/jpeg, Size: 9519 bytes --]

[-- Attachment #3: Type: text/plain, Size: 107 bytes --]



-- 
WBR, Eugene Vlasov        mailto:eugvv at altlinux.ru
                          JID: eugvv@jabber.ru

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-15 15:09         ` Richard Stallman
  2006-06-15 20:51           ` Eugene Vlasov
@ 2006-06-16  6:53           ` martin rudalics
  2006-06-19  7:42             ` Richard Stallman
  1 sibling, 1 reply; 15+ messages in thread
From: martin rudalics @ 2006-06-16  6:53 UTC (permalink / raw)
  Cc: eugene, emacs-devel

 > Does this fix it?
 >
 > *** window.c	13 Jun 2006 19:07:16 -0400	1.549
 > --- window.c	15 Jun 2006 10:19:24 -0400	

It fixes it.  However, the weird behavior related by Evgeni in response
to this shows up on my system too.  After C-x 3, C-x o, C-x 2, C-x 3
dragging the central vertical divider produces all sorts of scrambled
modelines, duplicate fringes and the like.  Windows revert to their
correct appearance though as soon as I resize the frame.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  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
  0 siblings, 2 replies; 15+ messages in thread
From: Richard Stallman @ 2006-06-19  7:42 UTC (permalink / raw)
  Cc: eugene, emacs-devel

Do these changes fix the remaining problems?

*** mouse.el	16 Mar 2006 15:21:13 -0500	1.297
--- mouse.el	18 Jun 2006 17:44:30 -0400	
***************
*** 529,534 ****
--- 529,552 ----
        (mouse-drag-mode-line-1 start-event nil))))
  
  \f
+ (defun mouse-drag-vertical-line-rightward-window (window)
+   "Return a window that is immediately to the right of WINDOW, or nil."
+   (let ((bottom (nth 3 (window-inside-edges window)))
+ 	(left (nth 0 (window-inside-edges window)))
+ 	best best-right
+ 	(try (previous-window window)))
+     (while (not (eq try window))
+       (let ((try-top (nth 1 (window-inside-edges try)))
+ 	    (try-bottom (nth 3 (window-inside-edges try)))
+ 	    (try-right (nth 2 (window-inside-edges try))))
+ 	(if (and (< try-top bottom)
+ 		 (>= try-bottom bottom)
+ 		 (< try-right left)
+ 		 (or (null best-right) (> try-right best-right)))
+ 	    (setq best-right try-right best try)))
+       (setq try (previous-window try)))
+     best))
+ 
  (defun mouse-drag-vertical-line (start-event)
    "Change the width of a window by dragging on the vertical line."
    (interactive "e")
***************
*** 594,600 ****
  			;; adjust the window on the left.
  			(if (eq which-side 'right)
  			    (selected-window)
! 			  (previous-window))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
  			 edges (window-edges window)
--- 612,619 ----
  			;; adjust the window on the left.
  			(if (eq which-side 'right)
  			    (selected-window)
! 			  (mouse-drag-vertical-line-rightward-window
! 			   (selected-window)))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
  			 edges (window-edges window)


*** window.c	13 Jun 2006 19:07:16 -0400	1.549
--- window.c	18 Jun 2006 17:23:15 -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, 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,2842 ****
  
  /* 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.
  
     If NODELETE_P is 2, that means we do delete windows that are
     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;
  {
    struct window *w = XWINDOW (window);
    struct window *c;
--- 2826,2848 ----
  
  /* 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.
! 
!    If FIRST_ONLY is 1, change only the first of WINDOW's children when
!    they are in series.  If LAST_ONLY 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.
  
     If NODELETE_P is 2, that means we do delete windows that are
     too small, even if they were too small before!  */
  
  static void
! size_window (window, size, width_p, nodelete_p, first_only, last_only)
       Lisp_Object window;
       int size, width_p, nodelete_p;
+      int first_only, last_only;
  {
    struct window *w = XWINDOW (window);
    struct window *c;
***************
*** 2911,2916 ****
--- 2917,2923 ----
  
    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,2926 ****
  	    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))
      {
        int fixed_size, each, extra, n;
--- 2925,2969 ----
  	    c->left_col = w->left_col;
  	  else
  	    c->top_line = w->top_line;
! 	  size_window (child, size, width_p, nodelete_p,
! 		       first_only, last_only);
  	}
      }
+   else if (!NILP (*forward) && last_only)
+     {
+       /* 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, first_only, last_only);
+     }
+   else if (!NILP (*forward) && first_only)
+     {
+       /* Change the first in a series of siblings.  */
+       int child_size;
+ 
+       child = *forward;
+       c = XWINDOW (child);
+ 
+       if (width_p)
+ 	c->left_col = w->left_col;
+       else
+ 	c->top_line = w->top_line;
+ 
+       child_size = XINT (width_p ? c->total_cols : c->total_lines);
+       size_window (child,
+ 		   size - old_size + child_size,
+ 		   width_p, nodelete_p, first_only, last_only);
+     }
    else if (!NILP (*forward))
      {
        int fixed_size, each, extra, n;
***************
*** 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)
--- 2971,2977 ----
        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.  */
--- 3034,3040 ----
  	  /* 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, first_only, last_only);
  
  	  /* 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);
  	  }
      }
  }
--- 3053,3059 ----
  	    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, first_only, last_only);
  	  }
      }
  }
***************
*** 3026,3032 ****
       int height;
       int nodelete;
  {
!   size_window (window, height, 0, nodelete);
  }
  
  
--- 3069,3075 ----
       int height;
       int nodelete;
  {
!   size_window (window, height, 0, nodelete, 0, 0);
  }
  
  
***************
*** 3041,3047 ****
       int width;
       int nodelete;
  {
!   size_window (window, width, 1, nodelete);
  }
  
  /* Change window heights in windows rooted in WINDOW by N lines.  */
--- 3084,3090 ----
       int width;
       int nodelete;
  {
!   size_window (window, width, 1, nodelete, 0, 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");
  	}
--- 4324,4331 ----
  
        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");
  	}
***************
*** 4296,4301 ****
--- 4339,4352 ----
  	{
  	  if (! NILP (parent) && !NILP (XWINDOW (parent)->vchild))
  	    first_parallel = XWINDOW (parent)->vchild;
+ 	  else if (NILP (parent) && !NILP (p->next))
+ 	    {
+ 	      /* Handle the vertical chain of main window and minibuffer
+ 		 which has no parent.  */
+ 	      first_parallel = window;
+ 	      while (! NILP (XWINDOW (first_parallel)->prev))
+ 		first_parallel = XWINDOW (first_parallel)->prev;
+ 	    }
  	}
        else
  	{
***************
*** 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");
--- 4355,4364 ----
  	}
  
        /* 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;
  	    }
  	}
--- 4400,4406 ----
  	      XSETINT (CURBEG (p->next),
  		       XINT (CURBEG (p->next)) + delta);
  	      size_window (p->next, XINT (CURSIZE (p->next)) - delta,
! 			   horiz_flag, 0, 1, 0);
  	      break;
  	    }
  	}
***************
*** 4359,4365 ****
  	     child = XWINDOW (child)->next)
  	  if (! EQ (child, window))
  	    size_window (child, XINT (CURSIZE (child)) + delta,
! 			 horiz_flag, 0);
  
        window = parent;
      }
--- 4412,4418 ----
  	     child = XWINDOW (child)->next)
  	  if (! EQ (child, window))
  	    size_window (child, XINT (CURSIZE (child)) + delta,
! 			 horiz_flag, 0, 0, 1);
  
        window = parent;
      }

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-19  7:42             ` Richard Stallman
@ 2006-06-19 12:38               ` martin rudalics
  2006-06-19 19:18               ` Eugene Vlasov
  1 sibling, 0 replies; 15+ messages in thread
From: martin rudalics @ 2006-06-19 12:38 UTC (permalink / raw)
  Cc: eugene, emacs-devel

> Do these changes fix the remaining problems?
> 
> *** mouse.el	16 Mar 2006 15:21:13 -0500	1.297
> --- mouse.el	18 Jun 2006 17:44:30 -0400	
> 
> *** window.c	13 Jun 2006 19:07:16 -0400	1.549
> --- window.c	18 Jun 2006 17:23:15 -0400	

All problems I've seen in this context have been resolved.

Thank you very much for fixing this.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [eugene@ikz.ru: mouse-drag-vertical-line or mouse-drag-mode-line failed with complex window split]
  2006-06-19  7:42             ` Richard Stallman
  2006-06-19 12:38               ` martin rudalics
@ 2006-06-19 19:18               ` Eugene Vlasov
  1 sibling, 0 replies; 15+ messages in thread
From: Eugene Vlasov @ 2006-06-19 19:18 UTC (permalink / raw)
  Cc: martin rudalics, rms

On Mon, 19 Jun 2006 03:42:21 -0400 Richard Stallman wrote:

> Do these changes fix the remaining problems?
>
> *** mouse.el	16 Mar 2006 15:21:13 -0500	1.297
> --- mouse.el	18 Jun 2006 17:44:30 -0400	

Yes, with this patch all works fine.


-- 
WBR, Eugene Vlasov        mailto:eugvv at altlinux.ru
                          JID: eugvv@jabber.ru

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-06-19 19:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).