all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: emacs-devel@gnu.org, "Alan Third" <athird@googlemail.com>,
	"Mattias Engdegård" <mattiase@acm.org>,
	"Paul Eggert" <eggert@cs.ucla.edu>
Subject: Re: Emacs 28 on OSX: emacsclient.c:1415: warning: implicit declaration of function 'openat'
Date: Mon, 18 Apr 2022 10:53:39 +0800	[thread overview]
Message-ID: <87pmlfksp8.fsf@yahoo.com> (raw)
In-Reply-To: <m27d7njfhc.wl%esq@lawlist.com> (Keith David Bershatsky's message of "Sun, 17 Apr 2022 19:24:31 -0700")

Keith David Bershatsky <esq@lawlist.com> writes:

> I applied the patch from Po Lu to the master branch and have the following output when building on OSX 10.6.8:
>
>   CC       nsterm.o
> In file included from nsterm.m:46:
> lisp.h:2156: warning: declaration does not declare anything
> nsterm.m: In function 'ns_frame_scale_factor':
> nsterm.m:807: warning: 'NSWindow' may not respond to '-backingScaleFactor'
> nsterm.m:807: warning: (Messages without a matching method signature
> nsterm.m:807: warning: will be assumed to return 'id' and accept
> nsterm.m:807: warning: '...' as arguments.)
> nsterm.m:807: error: incompatible types in return
> nsterm.m: In function '-[EmacsWindow initWithEmacsFrame:fullscreen:screen:]':
> nsterm.m:8405: warning: 'EmacsWindow' may not respond to '-setTabbingMode:'
> nsterm.m: In function '-[EmacsWindow setParentChildRelationships]':
> nsterm.m:8478: warning: 'EmacsWindow' may not respond to '-setAccessibilitySubrole:'
> nsterm.m:8480: warning: 'EmacsWindow' may not respond to '-setAccessibilitySubrole:'
> make[1]: *** [nsterm.o] Error 1
> make: *** [src] Error 2
> ~/Desktop/emacs $ 
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
>> Date: [04-17-2022 18:39:41] <18 Apr 2022 09:39:41 +0800>
>> From: Po Lu <luangruo@yahoo.com>
>> * * *

This should fix the setTabbingMode warning, but what's the value of
MAC_OS_X_VERSION_MAX_ALLOWED on your system?  I guess it should be
`1060', not higher, not lower.

diff --git a/src/nsterm.m b/src/nsterm.m
index 550f29212e..fd6e67a8cb 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -751,7 +751,19 @@ Free a pool and temporary objects it refers to (callable from C)
       EmacsView *parentView = FRAME_NS_VIEW (FRAME_PARENT_FRAME (f));
       parentRect = [parentView convertRect:[parentView frame]
                                     toView:nil];
-      parentRect = [[parentView window] convertRectToScreen:parentRect];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+      if ([[parentView window] respondsToSelector: @selector(convertRectToScreen:)])
+#endif
+	parentRect = [[parentView window] convertRectToScreen: parentRect];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+      else
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070	\
+  || defined (NS_IMPL_GNUSTEP)
+	parentRect.origin = [[parentView window] convertBaseToScreen: parentRect.origin];
+#endif
     }
   else
     parentRect = [[[NSScreen screens] objectAtIndex:0] frame];
@@ -789,7 +801,14 @@ Free a pool and temporary objects it refers to (callable from C)
 ns_frame_scale_factor (struct frame *f)
 {
 #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > 1060
-  return [[FRAME_NS_VIEW (f) window] backingScaleFactor];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+  if ([[FRAME_NS_VIEW (f) window] respondsToSelector: @selector(convertRectToScreen:)])
+#endif
+    return [[FRAME_NS_VIEW (f) window] backingScaleFactor];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+  else
+    return [[FRAME_NS_VIEW (f) window] userSpaceScaleFactor];
+#endif
 #else
   return [[FRAME_NS_VIEW (f) window] userSpaceScaleFactor];
 #endif
@@ -6869,7 +6888,7 @@ - (void)otherMouseDragged: (NSEvent *)e
   [self mouseMoved: e];
 }
 
-#ifdef NS_IMPL_COCOA
+#if defined NS_IMPL_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
 - (void) magnifyWithEvent: (NSEvent *) event
 {
   NSPoint pt = [self convertPoint: [event locationInWindow] fromView: nil];
@@ -6886,11 +6905,18 @@ - (void) magnifyWithEvent: (NSEvent *) event
 
       if ([event phase] == NSEventPhaseBegan)
 	{
-	  last_scale = 1.0 + [event magnification];
-	  emacs_event->arg = list4 (make_float (0.0),
-				    make_float (0.0),
-				    make_float (last_scale),
-				    make_float (0.0));
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+	  if ([event respondsToSelector: @selector(magnification)])
+	    {
+#endif
+	      last_scale = 1.0 + [event magnification];
+	      emacs_event->arg = list4 (make_float (0.0),
+					make_float (0.0),
+					make_float (last_scale),
+					make_float (0.0));
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+	    }
+#endif
 	}
       else
 	/* Report a tiny change so that Lisp code doesn't think this
@@ -8381,7 +8407,7 @@ - (instancetype) initWithEmacsFrame:(struct frame *)f
       /* macOS Sierra automatically enables tabbed windows.  We can't
          allow this to be enabled until it's available on a Free system.
          Currently it only happens by accident and is buggy anyway.  */
-#ifdef NS_IMPL_COCOA
+#if defined NS_IMPL_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
       if ([self respondsToSelector:@selector(setTabbingMode:)])
         [self setTabbingMode:NSWindowTabbingModeDisallowed];
 #endif
@@ -8451,14 +8477,16 @@ - (void)setParentChildRelationships
      behaviors early otherwise child windows may not go fullscreen as
      expected later.  */
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
-  if ([child respondsToSelector:@selector(setAccessibilitySubrole:)])
+  if ([self respondsToSelector:@selector(setAccessibilitySubrole:)])
 #endif
     /* Set the accessibility subroles.  */
     if (parentFrame)
       [self setAccessibilitySubrole:NSAccessibilityFloatingWindowSubrole];
     else
       [self setAccessibilitySubrole:NSAccessibilityStandardWindowSubrole];
+#endif
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
   [ourView updateCollectionBehavior];
@@ -8484,7 +8512,7 @@ - (void)setParentChildRelationships
 
 #ifdef NS_IMPL_COCOA
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
-      if ([ourView respondsToSelector:@selector (toggleFullScreen)]
+      if ([ourView respondsToSelector:@selector (toggleFullScreen)])
 #endif
           /* If we are the descendent of a fullscreen window and we
              have no new parent, go fullscreen.  */
@@ -8509,11 +8537,11 @@ - (void)setParentChildRelationships
 
 #ifdef NS_IMPL_COCOA
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
-      if ([ourView respondsToSelector:@selector (toggleFullScreen)]
+      if ([ourView respondsToSelector:@selector (toggleFullScreen)])
 #endif
-          /* Child frames must not be fullscreen.  */
-          if ([ourView fsIsNative] && [ourView isFullscreen])
-            [ourView toggleFullScreen:self];
+	/* Child frames must not be fullscreen.  */
+	if ([ourView fsIsNative] && [ourView isFullscreen])
+	  [ourView toggleFullScreen:self];
 #endif
 
       [parentWindow addChildWindow:self



  reply	other threads:[~2022-04-18  2:53 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18  2:24 Emacs 28 on OSX: emacsclient.c:1415: warning: implicit declaration of function 'openat' Keith David Bershatsky
2022-04-18  2:53 ` Po Lu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-04-26  2:56 Keith David Bershatsky
2022-04-26  3:14 ` Po Lu
2022-04-25  5:17 Keith David Bershatsky
2022-04-25  5:43 ` Po Lu
2022-04-25  9:56   ` Alan Third
2022-04-25 10:30     ` Po Lu
2022-04-25 18:07       ` Alan Third
2022-04-26  0:10         ` Po Lu
2022-04-25  3:46 Keith David Bershatsky
2022-04-25  4:13 ` Po Lu
2022-04-25  1:49 Keith David Bershatsky
2022-04-25  3:09 ` Po Lu
2022-04-25  1:35 Keith David Bershatsky
2022-04-25 18:08 ` Alan Third
2022-04-24 17:02 Keith David Bershatsky
2022-04-24 19:22 ` Alan Third
2022-04-24  0:08 Keith David Bershatsky
2022-04-24  9:03 ` Alan Third
2022-04-23  4:33 Keith David Bershatsky
2022-04-23 22:04 ` Alan Third
2022-04-22 21:29 Keith David Bershatsky
2022-04-23 22:13 ` Alan Third
2022-04-22 21:23 Keith David Bershatsky
2022-04-21 22:40 Keith David Bershatsky
2022-04-21 22:44 ` Alan Third
2022-04-21 20:51 Keith David Bershatsky
2022-04-21 22:22 ` Alan Third
2022-04-21 17:52 Keith David Bershatsky
2022-04-21 19:21 ` Alan Third
2022-04-21  2:22 Keith David Bershatsky
2022-04-21  0:51 Keith David Bershatsky
2022-04-21  2:05 ` Po Lu
2022-04-21  5:09 ` Alan Third
2022-04-20 13:55 Keith David Bershatsky
2022-04-20 16:48 ` Alan Third
2022-04-19  4:36 Keith David Bershatsky
2022-04-19  4:38 ` Po Lu
2022-04-19  1:24 Keith David Bershatsky
2022-04-19  2:35 ` Po Lu
2022-04-19  4:19   ` Alan Third
2022-04-19  4:24     ` Po Lu
2022-04-19  6:04     ` Eli Zaretskii
2022-04-20  1:23     ` Po Lu
2022-04-20  8:07       ` Alan Third
2022-04-19  2:56 ` Paul Eggert
2022-04-18 20:43 Keith David Bershatsky
2022-04-18 19:51 Keith David Bershatsky
2022-04-18 19:54 ` Paul Eggert
2022-04-19  1:00 ` Po Lu
2022-04-18  0:38 Keith David Bershatsky
2022-04-18  0:58 ` Paul Eggert
2022-04-18  1:39 ` Po Lu
2022-04-17 21:57 Keith David Bershatsky
2022-04-17 23:21 ` Paul Eggert
2022-04-17 18:45 Keith David Bershatsky
2022-04-17 20:37 ` Alan Third
2022-04-17 20:37 ` Paul Eggert
2022-04-15 19:11 Keith David Bershatsky
2022-04-17  9:01 ` Mattias Engdegård
2022-04-17 17:49   ` Paul Eggert
2022-04-17 19:12     ` Eli Zaretskii
2022-04-17 20:36       ` Paul Eggert
2022-04-18  4:49         ` Eli Zaretskii

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=87pmlfksp8.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=athird@googlemail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=esq@lawlist.com \
    --cc=mattiase@acm.org \
    /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.