emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107550: * frame.c (other_visible_fra


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107550: * frame.c (other_visible_frames): Don't assume selected frame is visible.
Date: Sat, 10 Mar 2012 15:46:07 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107550
fixes bug(s): http://debbugs.gnu.org/10955
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-03-10 15:46:07 +0800
message:
  * frame.c (other_visible_frames): Don't assume selected frame is visible.
modified:
  src/ChangeLog
  src/frame.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-03-09 16:46:25 +0000
+++ b/src/ChangeLog     2012-03-10 07:46:07 +0000
@@ -1,3 +1,8 @@
+2012-03-10  Chong Yidong  <address@hidden>
+
+       * frame.c (other_visible_frames): Don't assume the selected frame
+       is visible (Bug#10955).
+
 2012-03-09  Stefan Monnier  <address@hidden>
 
        * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).

=== modified file 'src/frame.c'
--- a/src/frame.c       2012-01-19 07:21:25 +0000
+++ b/src/frame.c       2012-03-10 07:46:07 +0000
@@ -1118,41 +1118,32 @@
 static int
 other_visible_frames (FRAME_PTR f)
 {
-  /* We know the selected frame is visible,
-     so if F is some other frame, it can't be the sole visible one.  */
-  if (f == SELECTED_FRAME ())
+  Lisp_Object frames;
+
+  for (frames = Vframe_list; CONSP (frames); frames = XCDR (frames))
     {
-      Lisp_Object frames;
-      int count = 0;
+      Lisp_Object this = XCAR (frames);
+      if (f == XFRAME (this))
+       continue;
 
-      for (frames = Vframe_list;
-          CONSP (frames);
-          frames = XCDR (frames))
+      /* Verify that we can still talk to the frame's X window,
+        and note any recent change in visibility.  */
+#ifdef HAVE_WINDOW_SYSTEM
+      if (FRAME_WINDOW_P (XFRAME (this)))
        {
-         Lisp_Object this;
-
-         this = XCAR (frames);
-         /* Verify that the frame's window still exists
-            and we can still talk to it.  And note any recent change
-            in visibility.  */
-#ifdef HAVE_WINDOW_SYSTEM
-         if (FRAME_WINDOW_P (XFRAME (this)))
-           {
-             x_sync (XFRAME (this));
-             FRAME_SAMPLE_VISIBILITY (XFRAME (this));
-           }
+         x_sync (XFRAME (this));
+         FRAME_SAMPLE_VISIBILITY (XFRAME (this));
+       }
 #endif
 
-         if (FRAME_VISIBLE_P (XFRAME (this))
-             || FRAME_ICONIFIED_P (XFRAME (this))
-             /* Allow deleting the terminal frame when at least
-                one X frame exists!  */
-             || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f)))
-           count++;
-       }
-      return count > 1;
+      if (FRAME_VISIBLE_P (XFRAME (this))
+         || FRAME_ICONIFIED_P (XFRAME (this))
+         /* Allow deleting the terminal frame when at least one X
+            frame exists.  */
+         || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f)))
+       return 1;
     }
-  return 1;
+  return 0;
 }
 
 /* Delete FRAME.  When FORCE equals Qnoelisp, delete FRAME


reply via email to

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