emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog nsfns.m nsterm.m


From: David Reitter
Subject: [Emacs-diffs] emacs/src ChangeLog nsfns.m nsterm.m
Date: Tue, 26 May 2009 18:14:17 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     David Reitter <davidswelt>      09/05/26 18:14:17

Modified files:
        src            : ChangeLog nsfns.m nsterm.m 

Log message:
        Ensure NS frames remain hidden when invisible
        
        * nsterm.m (ns_raise_frame): only raise frame if visible.
        (x_make_frame_visible): move frame to front rather than calling
        ns_raise_frame().
        (keyDown:) do not swallow events that aren't re-sent if frame
        isn't key window.
        (drawRect:) do not set visibility/iconified flags because
        drawRect may be called by NSView even if the frame is hidden.
        
        * nsfns.m (Fx_create_frame): follow other ports in
        determining visibility; default to t. Ensure async_visible is set.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7554&r2=1.7555
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsfns.m?cvsroot=emacs&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsterm.m?cvsroot=emacs&r1=1.73&r2=1.74

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7554
retrieving revision 1.7555
diff -u -b -r1.7554 -r1.7555
--- ChangeLog   23 May 2009 09:10:42 -0000      1.7554
+++ ChangeLog   26 May 2009 18:14:14 -0000      1.7555
@@ -1,3 +1,16 @@
+2009-05-25  David Reitter  <address@hidden>
+
+       * nsterm.m (ns_raise_frame): only raise frame if visible.
+       (x_make_frame_visible): move frame to front rather than calling
+       ns_raise_frame().
+       (keyDown:) do not swallow events that aren't re-sent if frame
+       isn't key window.
+       (drawRect:) do not set visibility/iconified flags because
+       drawRect may be called by NSView even if the frame is hidden.
+
+       * nsfns.m (Fx_create_frame): follow other ports in
+       determining visibility; default to t. Ensure async_visible is set.
+
 2009-05-23  Eli Zaretskii  <address@hidden>
 
        * dired.c (Ffile_attributes): Doc fix.

Index: nsfns.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsfns.m,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- nsfns.m     10 May 2009 22:21:19 -0000      1.43
+++ nsfns.m     26 May 2009 18:14:16 -0000      1.44
@@ -1317,14 +1317,21 @@
 
   if (! f->output_data.ns->explicit_parent)
     {
-        tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_BOOLEAN);
+      tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
         if (EQ (tem, Qunbound))
-            tem = Qnil;
-
+       tem = Qt;
         x_set_visibility (f, tem, Qnil);
-        if (EQ (tem, Qt))
+      if (EQ (tem, Qicon))
+       x_iconify_frame (f);
+      else if (! NILP (tem))
+       {
+         x_make_frame_visible (f);
+         f->async_visible = 1;
             [[FRAME_NS_VIEW (f) window] makeKeyWindow];
     }
+      else
+         f->async_visible = 0;
+    }
 
   if (FRAME_HAS_MINIBUF_P (f)
       && (!FRAMEP (kb->Vdefault_minibuffer_frame)

Index: nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- nsterm.m    18 May 2009 01:56:14 -0000      1.73
+++ nsterm.m    26 May 2009 18:14:16 -0000      1.74
@@ -896,7 +896,11 @@
   NSView *view = FRAME_NS_VIEW (f);
   check_ns ();
   BLOCK_INPUT;
+  FRAME_SAMPLE_VISIBILITY (f);
+  if (FRAME_VISIBLE_P (f))
+    {
   [[view window] makeKeyAndOrderFront: NSApp];
+    }
   UNBLOCK_INPUT;
 }
 
@@ -983,7 +987,10 @@
      called this (frame.c:Fraise_frame ()) also called raise_lower;
      if this ends up the case again, comment this out again. */
   if (!FRAME_VISIBLE_P (f))
+    {
+      f->async_visible = 1;
     ns_raise_frame (f);
+    }
 }
 
 
@@ -4461,7 +4468,8 @@
   if (!emacs_event)
     return;
 
- if (![[self window] isKeyWindow])
+ if (![[self window] isKeyWindow]
+     && [[theEvent window] isKindOfClass: [EmacsWindow class]])
    {
      /* XXX: There is an occasional condition in which, when Emacs display
          updates a different frame from the current one, and temporarily
@@ -4469,7 +4477,6 @@
          (dispnew.c:3878), OS will send the event to the correct NSWindow, but
          for some reason that window has its first responder set to the NSView
          most recently updated (I guess), which is not the correct one. */
-     if ([[theEvent window] isKindOfClass: [EmacsWindow class]])
          [(EmacsView *)[[theEvent window] delegate] keyDown: theEvent];
      return;
    }
@@ -5466,8 +5473,15 @@
 
   ns_clear_frame_area (emacsframe, x, y, width, height);
   expose_frame (emacsframe, x, y, width, height);
+
+  /*
+    drawRect: may be called (at least in OS X 10.5) for invisible
+    views as well for some reason.  Thus, do not infer visibility 
+    here.
+
   emacsframe->async_visible = 1;
   emacsframe->async_iconified = 0;
+  */
 }
 
 




reply via email to

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