unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69525: 30.0.50; MacOS: New warnings on stderr
@ 2024-03-03 16:18 Gerd Möllmann
  2024-03-03 16:26 ` Eli Zaretskii
  2024-07-26  9:56 ` Gerd Möllmann
  0 siblings, 2 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-03 16:18 UTC (permalink / raw)
  To: 69525

The following warnings are printed to stderr, which I haven't seen
previously. Maybe canBecomeKeyWindow should be implemented?

2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
2024-03-03 17:10:37.073109+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
2024-03-03 17:13:19.141805+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.

In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin23.3.0, NS
 appkit-2487.40 Version 14.3.1 (Build 23D60)) of 2024-03-01 built on
 Pro.fritz.box
Repository revision: 862dfef88d8e62d12bac3ca2e44e035a2ff5b298
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.3.1





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 16:18 bug#69525: 30.0.50; MacOS: New warnings on stderr Gerd Möllmann
@ 2024-03-03 16:26 ` Eli Zaretskii
  2024-03-03 17:33   ` Gerd Möllmann
  2024-07-26  9:56 ` Gerd Möllmann
  1 sibling, 1 reply; 28+ messages in thread
From: Eli Zaretskii @ 2024-03-03 16:26 UTC (permalink / raw)
  To: Gerd Möllmann, Alan Third; +Cc: 69525

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Date: Sun, 03 Mar 2024 17:18:42 +0100
> 
> The following warnings are printed to stderr, which I haven't seen
> previously. Maybe canBecomeKeyWindow should be implemented?
> 
> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
> 2024-03-03 17:10:37.073109+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
> 2024-03-03 17:13:19.141805+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.

Alan, any ideas or suggestions?





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 16:26 ` Eli Zaretskii
@ 2024-03-03 17:33   ` Gerd Möllmann
  2024-03-03 17:36     ` Gerd Möllmann
  0 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-03 17:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 69525, Alan Third

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Date: Sun, 03 Mar 2024 17:18:42 +0100
>>
>> The following warnings are printed to stderr, which I haven't seen
>> previously. Maybe canBecomeKeyWindow should be implemented?
>>
>> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>> 2024-03-03 17:10:37.073109+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
>> 2024-03-03 17:13:19.141805+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>
> Alan, any ideas or suggestions?

I think this could be related to tab-bar-mode (C-x t 2, ...), which I
started using today. I'm also observing frequest beach balls (freezes)
with tabs.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 17:33   ` Gerd Möllmann
@ 2024-03-03 17:36     ` Gerd Möllmann
  2024-03-03 18:06       ` Alan Third
  0 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-03 17:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 69525, Alan Third

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>>> Date: Sun, 03 Mar 2024 17:18:42 +0100
>>>
>>> The following warnings are printed to stderr, which I haven't seen
>>> previously. Maybe canBecomeKeyWindow should be implemented?
>>>
>>> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
>>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>>> 2024-03-03 17:10:37.073109+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
>>> 2024-03-03 17:13:19.141805+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>>
>> Alan, any ideas or suggestions?
>
> I think this could be related to tab-bar-mode (C-x t 2, ...), which I
> started using today. I'm also observing frequest beach balls (freezes)
> with tabs.

Beach balls of death, i.e. Emacs doesn't seem to recover.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 17:36     ` Gerd Möllmann
@ 2024-03-03 18:06       ` Alan Third
  2024-03-03 19:29         ` Gerd Möllmann
                           ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Alan Third @ 2024-03-03 18:06 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, Eli Zaretskii

On Sun, Mar 03, 2024 at 06:36:29PM +0100, Gerd Möllmann wrote:
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> 
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> >>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> >>> Date: Sun, 03 Mar 2024 17:18:42 +0100
> >>>
> >>> The following warnings are printed to stderr, which I haven't seen
> >>> previously. Maybe canBecomeKeyWindow should be implemented?
> >>>
> >>> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].

Odd, Apple's documentation says:

    The value of this property is YES if the window can become the key
    window, otherwise, NO.
    
    Attempts to make the window the key window are abandoned if the
    value of this property is NO. The value of this property is YES if
    the window has a title bar or a resize bar, or NO otherwise.

Is there anything unusual about your frames?

> >>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.

I don't have the first clue about this one. NSTextInputClient has
apparently been around since macOS 10.5, and I haven't heard of this
problem before... EmacsView *should* conform to NSTextInputClient
because it's a subclass of NSView.

> >>
> >> Alan, any ideas or suggestions?
> >
> > I think this could be related to tab-bar-mode (C-x t 2, ...), which I
> > started using today. I'm also observing frequest beach balls (freezes)
> > with tabs.
> 
> Beach balls of death, i.e. Emacs doesn't seem to recover.

Please try reverting 6acb3c5b05a7b9fb32a5336e1bb740f527571ae9. I
expect that'll fix the freezing, but I don't know about the others.
-- 
Alan Third





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 18:06       ` Alan Third
@ 2024-03-03 19:29         ` Gerd Möllmann
  2024-03-04  9:12           ` Gerd Möllmann
  2024-03-04 13:48         ` Gerd Möllmann
  2024-03-05  5:31         ` Gerd Möllmann
  2 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-03 19:29 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Alan Third <alan@idiocy.org> writes:

> On Sun, Mar 03, 2024 at 06:36:29PM +0100, Gerd Möllmann wrote:
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>> 
>> > Eli Zaretskii <eliz@gnu.org> writes:
>> >
>> >>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> >>> Date: Sun, 03 Mar 2024 17:18:42 +0100
>> >>>
>> >>> The following warnings are printed to stderr, which I haven't seen
>> >>> previously. Maybe canBecomeKeyWindow should be implemented?
>> >>>
>> >>> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
>
> Odd, Apple's documentation says:
>
>     The value of this property is YES if the window can become the key
>     window, otherwise, NO.
>     
>     Attempts to make the window the key window are abandoned if the
>     value of this property is NO. The value of this property is YES if
>     the window has a title bar or a resize bar, or NO otherwise.
>
> Is there anything unusual about your frames?

I have menu-bar-mode, toolbar-mode, scroll-bar-mode nil, and I use 1
frame in full screen.

I also tried to use tabs today. That's when I noticed the messagers,
because I started Emacs in LLDB to maybe get an impression where the
freezes come frame with tabs. (No luck so far.)

Don't know how tabs are implemented, maybe these are also some NS
widget/view?

>
>> >>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI]
>-[TUINSCursorUIController activate:]: EmacsView doesn't conform to
>NSTextInputClient protocol.

This also appears when never using tabs in a session, BTW.

> I don't have the first clue about this one. NSTextInputClient has
> apparently been around since macOS 10.5, and I haven't heard of this
> problem before... EmacsView *should* conform to NSTextInputClient
> because it's a subclass of NSView.
>
>> >>
>> >> Alan, any ideas or suggestions?
>> >
>> > I think this could be related to tab-bar-mode (C-x t 2, ...), which I
>> > started using today. I'm also observing frequest beach balls (freezes)
>> > with tabs.
>> 
>> Beach balls of death, i.e. Emacs doesn't seem to recover.
>
> Please try reverting 6acb3c5b05a7b9fb32a5336e1bb740f527571ae9. I
> expect that'll fix the freezing, but I don't know about the others.

Thanks, I'll try that tomorrow.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 19:29         ` Gerd Möllmann
@ 2024-03-04  9:12           ` Gerd Möllmann
  0 siblings, 0 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-04  9:12 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

>> Alan Third <alan@idiocy.org> writes:
>> Please try reverting 6acb3c5b05a7b9fb32a5336e1bb740f527571ae9. I
>> expect that'll fix the freezing, but I don't know about the others.
>
> Thanks, I'll try that tomorrow.

I did revert the commit, but I now think, the freezes might not be
related to this all:

When trying to start Emacs after the revert, Emacs froze. I have a
desktop file that loads Emacs' frame.h. And Emacs freezes only if I load
eglot in my init file, and put eglot-ensure in c-mode-common-hook.

The other freezes I saw yesterday were also while doing C stuff, so they
could be related to using Eglot as well.

Maybe it's some change in Eglot, or, below that, in Emacs process code?
If someone knows if something changed in Eglot and/or Emacs in that
department, I'd be grateful.







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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 18:06       ` Alan Third
  2024-03-03 19:29         ` Gerd Möllmann
@ 2024-03-04 13:48         ` Gerd Möllmann
  2024-03-04 14:43           ` Gerd Möllmann
  2024-03-04 21:40           ` Alan Third
  2024-03-05  5:31         ` Gerd Möllmann
  2 siblings, 2 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-04 13:48 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Alan Third <alan@idiocy.org> writes:

> On Sun, Mar 03, 2024 at 06:36:29PM +0100, Gerd Möllmann wrote:
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>> 
>> > Eli Zaretskii <eliz@gnu.org> writes:
>> >
>> >>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> >>> Date: Sun, 03 Mar 2024 17:18:42 +0100
>> >>>
>> >>> The following warnings are printed to stderr, which I haven't seen
>> >>> previously. Maybe canBecomeKeyWindow should be implemented?
>> >>>
>> >>> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
>
> Odd, Apple's documentation says:
>
>     The value of this property is YES if the window can become the key
>     window, otherwise, NO.
>     
>     Attempts to make the window the key window are abandoned if the
>     value of this property is NO. The value of this property is YES if
>     the window has a title bar or a resize bar, or NO otherwise.
>
> Is there anything unusual about your frames?

Found out how to reproduce this with emacs -Q. In scratch, eval

  (make-frame (list (cons 'parent-frame (selected-frame))
		    (cons 'no-accept-focus t)))

This looks to me like some function in ELPA package consult uses
no-accept-focus t, so that nsterm.m returns NO from canBecomeKeyWindow.
Consult with posframe seems to work anyway, so...

>> >>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>
> I don't have the first clue about this one. NSTextInputClient has
> apparently been around since macOS 10.5, and I haven't heard of this
> problem before... EmacsView *should* conform to NSTextInputClient
> because it's a subclass of NSView.

This doesn't seem to be related to the other warning. To reproduce,
start emacs -Q from a terminal and switch focus between Emacs and
Terminal.  Of course, I have no idea either what it means either.

>
>> >>
>> >> Alan, any ideas or suggestions?
>> >
>> > I think this could be related to tab-bar-mode (C-x t 2, ...), which I
>> > started using today. I'm also observing frequest beach balls (freezes)
>> > with tabs.
>> 
>> Beach balls of death, i.e. Emacs doesn't seem to recover.
>
> Please try reverting 6acb3c5b05a7b9fb32a5336e1bb740f527571ae9. I
> expect that'll fix the freezing, but I don't know about the others.

The commit didn't make a difference, as far as the 2 warnings are
concerned.

With the freezes I'm no step further, BTW, but that's a different
subject, I guess.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-04 13:48         ` Gerd Möllmann
@ 2024-03-04 14:43           ` Gerd Möllmann
  2024-03-04 21:40           ` Alan Third
  1 sibling, 0 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-04 14:43 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Found out how to reproduce this with emacs -Q. In scratch, eval
>
>   (make-frame (list (cons 'parent-frame (selected-frame))
> 		    (cons 'no-accept-focus t)))
>
> This looks to me like some function in ELPA package consult uses
> no-accept-focus t, so that nsterm.m returns NO from canBecomeKeyWindow.
> Consult with posframe seems to work anyway, so...

FYI, it's actually posframe. I've submitted an issue for that

  https://github.com/tumashu/posframe/issues/136





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-04 13:48         ` Gerd Möllmann
  2024-03-04 14:43           ` Gerd Möllmann
@ 2024-03-04 21:40           ` Alan Third
  2024-03-05  4:38             ` Gerd Möllmann
  1 sibling, 1 reply; 28+ messages in thread
From: Alan Third @ 2024-03-04 21:40 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, Eli Zaretskii

On Mon, Mar 04, 2024 at 02:48:52PM +0100, Gerd Möllmann wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > On Sun, Mar 03, 2024 at 06:36:29PM +0100, Gerd Möllmann wrote:
> >> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> >> 
> >> > Eli Zaretskii <eliz@gnu.org> writes:
> >> >
> >> >>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> >> >>> Date: Sun, 03 Mar 2024 17:18:42 +0100
> >> >>>
> >> >>> The following warnings are printed to stderr, which I haven't seen
> >> >>> previously. Maybe canBecomeKeyWindow should be implemented?
> >> >>>
> >> >>> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
> >
> > Odd, Apple's documentation says:
> >
> >     The value of this property is YES if the window can become the key
> >     window, otherwise, NO.
> >     
> >     Attempts to make the window the key window are abandoned if the
> >     value of this property is NO. The value of this property is YES if
> >     the window has a title bar or a resize bar, or NO otherwise.
> >
> > Is there anything unusual about your frames?
> 
> Found out how to reproduce this with emacs -Q. In scratch, eval
> 
>   (make-frame (list (cons 'parent-frame (selected-frame))
> 		    (cons 'no-accept-focus t)))
> 
> This looks to me like some function in ELPA package consult uses
> no-accept-focus t, so that nsterm.m returns NO from canBecomeKeyWindow.
> Consult with posframe seems to work anyway, so...

We should be able to create a frame without the system throwing out
errors, though. I wonder if this is something we're doing (like
makeKeyAndOrderFront being called on the new frame and it not checking
canBecomeKeyWindow) or if there's some other step we need to take to
prevent this. I'm fairly sure that I've never seen these warnings so
presumably they're new since 10.14.

-- 
Alan Third





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-04 21:40           ` Alan Third
@ 2024-03-05  4:38             ` Gerd Möllmann
  2024-03-05 12:59               ` Alan Third
  0 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-05  4:38 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Alan Third <alan@idiocy.org> writes:

>> Found out how to reproduce this with emacs -Q. In scratch, eval
>> 
>>   (make-frame (list (cons 'parent-frame (selected-frame))
>> 		    (cons 'no-accept-focus t)))
>> 
>> This looks to me like some function in ELPA package consult uses
>> no-accept-focus t, so that nsterm.m returns NO from canBecomeKeyWindow.
>> Consult with posframe seems to work anyway, so...
>
> We should be able to create a frame without the system throwing out
> errors, though. 

True.

> I wonder if this is something we're doing (like makeKeyAndOrderFront
> being called on the new frame and it not checking canBecomeKeyWindow)
> or if there's some other step we need to take to prevent this. I'm
> fairly sure that I've never seen these warnings so presumably they're
> new since 10.14.

You are thinking of this in nsterm.m?

  - (void)makeKeyAndOrderFront:(id)sender
  {
    NSTRACE ("[EmacsWindow makeKeyAndOrderFront:]");

    if ([self parentWindow])
      {
        [self orderFront:sender];
        [self makeKeyWindow];
      }
    else
      [super makeKeyAndOrderFront:sender];
  }






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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 18:06       ` Alan Third
  2024-03-03 19:29         ` Gerd Möllmann
  2024-03-04 13:48         ` Gerd Möllmann
@ 2024-03-05  5:31         ` Gerd Möllmann
  2024-07-26 10:33           ` Gerd Möllmann
  2 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-05  5:31 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Alan Third <alan@idiocy.org> writes:

>> >>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>
> I don't have the first clue about this one. NSTextInputClient has
> apparently been around since macOS 10.5, and I haven't heard of this
> problem before... EmacsView *should* conform to NSTextInputClient
> because it's a subclass of NSView.

I've now compared Apple's docss at

  https://developer.apple.com/documentation/appkit/nstextinputclient

with what's in nsterm.m, and I think it's indeed different. (Add usual
disclaimer that I know neither ObjC nor NS.)

  Apple:
  func setMarkedText(Any, selectedRange: NSRange, replacementRange: NSRange)
  Replaces a specified range in the receiver’s text storage with the given string and sets the selection.
  Required

  nsterm.m
  - (void)setMarkedText: (id)aString selectedRange: (NSRange)selRange

  func validAttributesForMarkedText() -> [NSAttributedString.Key]
  Returns an array of attribute names recognized by the receiver.
  Required

  - (NSArray *)validAttributesForMarkedText

  func attributedSubstring(forProposedRange: NSRange, actualRange: NSRangePointer?) -> NSAttributedString?

  - (NSAttributedString *)attributedSubstringFromRange: (NSRange)theRange

  func insertText(Any, replacementRange: NSRange)
  Inserts the given string into the receiver, replacing the specified content.
  Required

  - (void)insertText: (id)aString

Stopped here.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-05  4:38             ` Gerd Möllmann
@ 2024-03-05 12:59               ` Alan Third
  2024-03-05 14:31                 ` Gerd Möllmann
  0 siblings, 1 reply; 28+ messages in thread
From: Alan Third @ 2024-03-05 12:59 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, Eli Zaretskii

On Tue, Mar 05, 2024 at 05:38:26AM +0100, Gerd Möllmann wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > I wonder if this is something we're doing (like makeKeyAndOrderFront
> > being called on the new frame and it not checking canBecomeKeyWindow)
> > or if there's some other step we need to take to prevent this. I'm
> > fairly sure that I've never seen these warnings so presumably they're
> > new since 10.14.
> 
> You are thinking of this in nsterm.m?
> 
>   - (void)makeKeyAndOrderFront:(id)sender
>   {
>     NSTRACE ("[EmacsWindow makeKeyAndOrderFront:]");
> 
>     if ([self parentWindow])
>       {
>         [self orderFront:sender];
>         [self makeKeyWindow];
>       }
>     else
>       [super makeKeyAndOrderFront:sender];
>   }

Yes. I think it's the only place we actually call makeKeyWindow
ourselves, so perhaps it should have a test. Could be worth it just to
see if it makes the messages go away.

So I guess just something like

    if ([self canBecomeKeyWindow])
      [self makeKeyWindow];

-- 
Alan Third





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-05 12:59               ` Alan Third
@ 2024-03-05 14:31                 ` Gerd Möllmann
  0 siblings, 0 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-03-05 14:31 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Alan Third <alan@idiocy.org> writes:

> On Tue, Mar 05, 2024 at 05:38:26AM +0100, Gerd Möllmann wrote:
>> Alan Third <alan@idiocy.org> writes:
>> 
>> > I wonder if this is something we're doing (like makeKeyAndOrderFront
>> > being called on the new frame and it not checking canBecomeKeyWindow)
>> > or if there's some other step we need to take to prevent this. I'm
>> > fairly sure that I've never seen these warnings so presumably they're
>> > new since 10.14.
>> 
>> You are thinking of this in nsterm.m?
>> 
>>   - (void)makeKeyAndOrderFront:(id)sender
>>   {
>>     NSTRACE ("[EmacsWindow makeKeyAndOrderFront:]");
>> 
>>     if ([self parentWindow])
>>       {
>>         [self orderFront:sender];
>>         [self makeKeyWindow];
>>       }
>>     else
>>       [super makeKeyAndOrderFront:sender];
>>   }
>
> Yes. I think it's the only place we actually call makeKeyWindow
> ourselves, so perhaps it should have a test. Could be worth it just to
> see if it makes the messages go away.
>
> So I guess just something like
>
>     if ([self canBecomeKeyWindow])
>       [self makeKeyWindow];

Alas, that didn't work. I replaced the whole method body with the 2
lines, but then the Emacs frame wouldn't show up on start. There are
some calls to makeKeyWindow in other .m files, BTW.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-03 16:18 bug#69525: 30.0.50; MacOS: New warnings on stderr Gerd Möllmann
  2024-03-03 16:26 ` Eli Zaretskii
@ 2024-07-26  9:56 ` Gerd Möllmann
  2024-07-26 18:38   ` Alan Third
  1 sibling, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-26  9:56 UTC (permalink / raw)
  To: 69525; +Cc: Alan Third

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

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> The following warnings are printed to stderr, which I haven't seen
> previously. Maybe canBecomeKeyWindow should be implemented?
>
> 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
> 2024-03-03 17:10:37.073109+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
> 2024-03-03 17:13:19.141805+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>
> In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin23.3.0, NS
>  appkit-2487.40 Version 14.3.1 (Build 23D60)) of 2024-03-01 built on
>  Pro.fritz.box
> Repository revision: 862dfef88d8e62d12bac3ca2e44e035a2ff5b298
> Repository branch: master
> Windowing system distributor 'Apple', version 10.3.2487
> System Description:  macOS 14.3.1

The attached patch fixes this for me, and seems logical.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: makeKeyWindow --]
[-- Type: text/x-patch, Size: 782 bytes --]

From c447ae1512cb274b5f7d47ffe479520c12392c67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd@gnu.org>
Date: Fri, 26 Jul 2024 11:48:24 +0200
Subject: [PATCH] NS: prevent makeKeyWindow warnings (bug#69525)

* src/nsterm.m (ns_raise_frame): Don't makeKeyWindow if frame has
no_accept_focus set.
---
 src/nsterm.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index b9193f62e80..cd6ffabddde 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1413,7 +1413,7 @@ -(void)remove
   block_input ();
   if (FRAME_VISIBLE_P (f))
     {
-      if (make_key)
+      if (make_key && !f->no_accept_focus)
         [[view window] makeKeyAndOrderFront: NSApp];
       else
         [[view window] orderFront: NSApp];
-- 
2.45.2


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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-03-05  5:31         ` Gerd Möllmann
@ 2024-07-26 10:33           ` Gerd Möllmann
  2024-07-26 10:55             ` Eli Zaretskii
  2024-07-26 19:09             ` Alan Third
  0 siblings, 2 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-26 10:33 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Alan Third <alan@idiocy.org> writes:
>
>>> >>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
>>
>> I don't have the first clue about this one. NSTextInputClient has
>> apparently been around since macOS 10.5, and I haven't heard of this
>> problem before... EmacsView *should* conform to NSTextInputClient
>> because it's a subclass of NSView.
>
> I've now compared Apple's docss at
>
>   https://developer.apple.com/documentation/appkit/nstextinputclient
>
> with what's in nsterm.m, and I think it's indeed different. (Add usual
> disclaimer that I know neither ObjC nor NS.)
>
>   Apple:
>   func setMarkedText(Any, selectedRange: NSRange, replacementRange: NSRange)
>   Replaces a specified range in the receiver’s text storage with the given string and sets the selection.
>   Required
>
>   nsterm.m
>   - (void)setMarkedText: (id)aString selectedRange: (NSRange)selRange
>
>   func validAttributesForMarkedText() -> [NSAttributedString.Key]
>   Returns an array of attribute names recognized by the receiver.
>   Required
>
>   - (NSArray *)validAttributesForMarkedText
>
>   func attributedSubstring(forProposedRange: NSRange, actualRange: NSRangePointer?) -> NSAttributedString?
>
>   - (NSAttributedString *)attributedSubstringFromRange: (NSRange)theRange
>
>   func insertText(Any, replacementRange: NSRange)
>   Inserts the given string into the receiver, replacing the specified content.
>   Required
>
>   - (void)insertText: (id)aString
>
> Stopped here.

Apple's documentation says

  Important
  
  NSTextInput protocol is slated for deprecation. Please use the
  NSTextInputClient protocol instead.

I guess that's the reason for the warning, and we should switch to using
NSTextInputClient.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26 10:33           ` Gerd Möllmann
@ 2024-07-26 10:55             ` Eli Zaretskii
  2024-07-26 11:02               ` Gerd Möllmann
  2024-07-26 19:09             ` Alan Third
  1 sibling, 1 reply; 28+ messages in thread
From: Eli Zaretskii @ 2024-07-26 10:55 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, alan

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 69525@debbugs.gnu.org,  Eli Zaretskii <eliz@gnu.org>
> Date: Fri, 26 Jul 2024 12:33:24 +0200
> 
> Apple's documentation says
> 
>   Important
>   
>   NSTextInput protocol is slated for deprecation. Please use the
>   NSTextInputClient protocol instead.
> 
> I guess that's the reason for the warning, and we should switch to using
> NSTextInputClient.

Does this mean the patch you just posted is no longer relevant or
desirable?





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26 10:55             ` Eli Zaretskii
@ 2024-07-26 11:02               ` Gerd Möllmann
  0 siblings, 0 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-26 11:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 69525, alan

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: 69525@debbugs.gnu.org,  Eli Zaretskii <eliz@gnu.org>
>> Date: Fri, 26 Jul 2024 12:33:24 +0200
>> 
>> Apple's documentation says
>> 
>>   Important
>>   
>>   NSTextInput protocol is slated for deprecation. Please use the
>>   NSTextInputClient protocol instead.
>> 
>> I guess that's the reason for the warning, and we should switch to using
>> NSTextInputClient.
>
> Does this mean the patch you just posted is no longer relevant or
> desirable?

No, there are 2 kinds of warnings, with two different reasons.
The patch I sent is for the warning regarding makeKeyWindow.

This mail concerns

  2024-07-26 12:38:12.984973+0200 emacs[61974:18565128] [CursorUI]
  -[TUINSCursorUIController activate:]: EmacsView doesn't conform to
  NSTextInputClient protocol.

And it looks like we have to switch to using NSTextInputClient at some
point instead of using NSTextInput.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26  9:56 ` Gerd Möllmann
@ 2024-07-26 18:38   ` Alan Third
  2024-07-26 19:02     ` Gerd Möllmann
  0 siblings, 1 reply; 28+ messages in thread
From: Alan Third @ 2024-07-26 18:38 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525

On Fri, Jul 26, 2024 at 11:56:21AM +0200, Gerd Möllmann wrote:
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> 
> > The following warnings are printed to stderr, which I haven't seen
> > previously. Maybe canBecomeKeyWindow should be implemented?
> >
> > 2024-03-03 17:10:16.334906+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
> > 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
> > 2024-03-03 17:10:37.073109+0100 emacs[12805:61381] [Window] Warning: -[NSWindow makeKeyWindow] called on EmacsWindow 0x7f7d90a34030 which returned NO from -[NSWindow canBecomeKeyWindow].
> > 2024-03-03 17:13:19.141805+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
> >
> > In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin23.3.0, NS
> >  appkit-2487.40 Version 14.3.1 (Build 23D60)) of 2024-03-01 built on
> >  Pro.fritz.box
> > Repository revision: 862dfef88d8e62d12bac3ca2e44e035a2ff5b298
> > Repository branch: master
> > Windowing system distributor 'Apple', version 10.3.2487
> > System Description:  macOS 14.3.1
> 
> The attached patch fixes this for me, and seems logical.

LGTM
-- 
Alan Third





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26 18:38   ` Alan Third
@ 2024-07-26 19:02     ` Gerd Möllmann
  0 siblings, 0 replies; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-26 19:02 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525

Alan Third <alan@idiocy.org> writes:

> LGTM

Thanks Alan, I've pushed that to emacs-30.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26 10:33           ` Gerd Möllmann
  2024-07-26 10:55             ` Eli Zaretskii
@ 2024-07-26 19:09             ` Alan Third
  2024-07-26 19:24               ` Gerd Möllmann
  1 sibling, 1 reply; 28+ messages in thread
From: Alan Third @ 2024-07-26 19:09 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, Eli Zaretskii

On Fri, Jul 26, 2024 at 12:33:24PM +0200, Gerd Möllmann wrote:
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> 
> > Alan Third <alan@idiocy.org> writes:
> >
> >>> >>> 2024-03-03 17:10:35.434255+0100 emacs[12805:61381] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
> >>
> >> I don't have the first clue about this one. NSTextInputClient has
> >> apparently been around since macOS 10.5, and I haven't heard of this
> >> problem before... EmacsView *should* conform to NSTextInputClient
> >> because it's a subclass of NSView.
> >
> > I've now compared Apple's docss at
> >
> >   https://developer.apple.com/documentation/appkit/nstextinputclient
> >
> > with what's in nsterm.m, and I think it's indeed different. (Add usual
> > disclaimer that I know neither ObjC nor NS.)
> >
> >   Apple:
> >   func setMarkedText(Any, selectedRange: NSRange, replacementRange: NSRange)
> >   Replaces a specified range in the receiver’s text storage with the given string and sets the selection.
> >   Required
> >
> >   nsterm.m
> >   - (void)setMarkedText: (id)aString selectedRange: (NSRange)selRange
> >
> >   func validAttributesForMarkedText() -> [NSAttributedString.Key]
> >   Returns an array of attribute names recognized by the receiver.
> >   Required
> >
> >   - (NSArray *)validAttributesForMarkedText
> >
> >   func attributedSubstring(forProposedRange: NSRange, actualRange: NSRangePointer?) -> NSAttributedString?
> >
> >   - (NSAttributedString *)attributedSubstringFromRange: (NSRange)theRange
> >
> >   func insertText(Any, replacementRange: NSRange)
> >   Inserts the given string into the receiver, replacing the specified content.
> >   Required
> >
> >   - (void)insertText: (id)aString
> >
> > Stopped here.

FYI, up at the top right of the Apple docs you can change from Swift
to Objective C, which will probably make comparisons easier.

> Apple's documentation says
> 
>   Important
>   
>   NSTextInput protocol is slated for deprecation. Please use the
>   NSTextInputClient protocol instead.
> 
> I guess that's the reason for the warning, and we should switch to using
> NSTextInputClient.

Looks that way. AFAICT NSTextInputClient should be available on all
versions of macOS we support and also in GNUstep, although it can be
hard to tell which versions of GNUstep support what.

Some of these functions are just used for normal input, but many of
them are used exclusively for macOS input methods.
-- 
Alan Third





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26 19:09             ` Alan Third
@ 2024-07-26 19:24               ` Gerd Möllmann
  2024-07-26 19:36                 ` Alan Third
  0 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-26 19:24 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Alan Third <alan@idiocy.org> writes:

>> >   - (void)insertText: (id)aString
>> >
>> > Stopped here.
>
> FYI, up at the top right of the Apple docs you can change from Swift
> to Objective C, which will probably make comparisons easier.

Ah thanks, I didn't see that!

>
>> Apple's documentation says
>> 
>>   Important
>>   
>>   NSTextInput protocol is slated for deprecation. Please use the
>>   NSTextInputClient protocol instead.
>> 
>> I guess that's the reason for the warning, and we should switch to using
>> NSTextInputClient.
>
> Looks that way. AFAICT NSTextInputClient should be available on all
> versions of macOS we support and also in GNUstep, although it can be
> hard to tell which versions of GNUstep support what.
>
> Some of these functions are just used for normal input, but many of
> them are used exclusively for macOS input methods.

I find Apple's documentation of the protocol pretty bad, to say the
least, and examples seem to be lacking completely. Don't know if I can
pull that off.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26 19:24               ` Gerd Möllmann
@ 2024-07-26 19:36                 ` Alan Third
  2024-07-27  3:56                   ` Gerd Möllmann
  0 siblings, 1 reply; 28+ messages in thread
From: Alan Third @ 2024-07-26 19:36 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, Eli Zaretskii

On Fri, Jul 26, 2024 at 09:24:36PM +0200, Gerd Möllmann wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> >
> >> Apple's documentation says
> >> 
> >>   Important
> >>   
> >>   NSTextInput protocol is slated for deprecation. Please use the
> >>   NSTextInputClient protocol instead.
> >> 
> >> I guess that's the reason for the warning, and we should switch to using
> >> NSTextInputClient.
> >
> > Looks that way. AFAICT NSTextInputClient should be available on all
> > versions of macOS we support and also in GNUstep, although it can be
> > hard to tell which versions of GNUstep support what.
> >
> > Some of these functions are just used for normal input, but many of
> > them are used exclusively for macOS input methods.
> 
> I find Apple's documentation of the protocol pretty bad, to say the
> least, and examples seem to be lacking completely. Don't know if I can
> pull that off.

Yeah, I was trying to work out what the actual differences are between
them and I suspect they're fairly minimal, but I don't know how we
should handle insertText:replacementRange: vs the current insertText:,
for example.

The new one takes a range and the old one doesn't. IMO it's none of
the window system's business where we insert the text, so do we just
ignore it? That might cause issues if we're dealing with the language
input stuff, so we might need to fiddle with that a bit (it was mostly
contributed by someone who actually used it).

I would agree that Apple's documentation is abysmal. AFAICT most new
features are exclusively documented in WWDC talks, so if you're not
immersed in the Apple eco-system it can be very hard to keep track of
what's changed. I assume that's some sort of marketing ploy.
-- 
Alan Third





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-26 19:36                 ` Alan Third
@ 2024-07-27  3:56                   ` Gerd Möllmann
  2024-07-27  6:37                     ` Eli Zaretskii
  0 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-27  3:56 UTC (permalink / raw)
  To: Alan Third; +Cc: 69525, Eli Zaretskii

Alan Third <alan@idiocy.org> writes:

>> I find Apple's documentation of the protocol pretty bad, to say the
>> least, and examples seem to be lacking completely. Don't know if I can
>> pull that off.
>
> Yeah, I was trying to work out what the actual differences are between
> them and I suspect they're fairly minimal, but I don't know how we
> should handle insertText:replacementRange: vs the current insertText:,
> for example.
>
> The new one takes a range and the old one doesn't. IMO it's none of
> the window system's business where we insert the text, so do we just
> ignore it? That might cause issues if we're dealing with the language
> input stuff, so we might need to fiddle with that a bit (it was mostly
> contributed by someone who actually used it).
>
> I would agree that Apple's documentation is abysmal. AFAICT most new
> features are exclusively documented in WWDC talks, so if you're not
> immersed in the Apple eco-system it can be very hard to keep track of
> what's changed. I assume that's some sort of marketing ploy.

Yeah, could be. Although I wonder what advantage they expect from making
such stuff effectively a secret :-/.

BTW, I found a github repo with lots of Cocoa samples which might be of
help at some point. This one is about NSTextInputClient, it seems:

  https://github.com/HelmutJ/CocoaSampleCode/tree/master/TextInputView

I've read it, but without any further background I find it hard to
understand. Maybe it's helpful for you, though. It does do something
with these ranges, for example.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-27  3:56                   ` Gerd Möllmann
@ 2024-07-27  6:37                     ` Eli Zaretskii
  2024-07-30  6:00                       ` Gerd Möllmann
  0 siblings, 1 reply; 28+ messages in thread
From: Eli Zaretskii @ 2024-07-27  6:37 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, alan

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 69525@debbugs.gnu.org,  Eli Zaretskii <eliz@gnu.org>
> Date: Sat, 27 Jul 2024 05:56:30 +0200
> 
> Alan Third <alan@idiocy.org> writes:
> 
> > I would agree that Apple's documentation is abysmal. AFAICT most new
> > features are exclusively documented in WWDC talks, so if you're not
> > immersed in the Apple eco-system it can be very hard to keep track of
> > what's changed. I assume that's some sort of marketing ploy.
> 
> Yeah, could be. Although I wonder what advantage they expect from making
> such stuff effectively a secret :-/.

Companies that develop proprietary software for macOS can probably
fund courses for their employees, or buy auxiliary documentation that
is not available for free, or ask Apple questions and get answers,
something that could be available only for those who have contracts
with Apple.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-27  6:37                     ` Eli Zaretskii
@ 2024-07-30  6:00                       ` Gerd Möllmann
  2024-07-31  3:22                         ` Gerd Möllmann
  0 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-30  6:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 69525, alan

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

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: 69525@debbugs.gnu.org,  Eli Zaretskii <eliz@gnu.org>
>> Date: Sat, 27 Jul 2024 05:56:30 +0200
>> 
>> Alan Third <alan@idiocy.org> writes:
>> 
>> > I would agree that Apple's documentation is abysmal. AFAICT most new
>> > features are exclusively documented in WWDC talks, so if you're not
>> > immersed in the Apple eco-system it can be very hard to keep track of
>> > what's changed. I assume that's some sort of marketing ploy.
>> 
>> Yeah, could be. Although I wonder what advantage they expect from making
>> such stuff effectively a secret :-/.
>
> Companies that develop proprietary software for macOS can probably
> fund courses for their employees, or buy auxiliary documentation that
> is not available for free, or ask Apple questions and get answers,
> something that could be available only for those who have contracts
> with Apple.

Yeah, maybe :-/.

Meanwhile, I think I pulled this off anyway by studying and mimicking
what others did. At least it works for me on macOS 14.5 just like the
old code did, at least for entering accented characters, which is the
only thing I know how to use.

I'll push that to master, if nobody objects.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: NSTextInputClient --]
[-- Type: text/x-patch, Size: 2683 bytes --]

From 65d5ace8e85111ecbd5035541ab24fdcfc065c7b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd@gnu.org>
Date: Tue, 30 Jul 2024 07:47:44 +0200
Subject: [PATCH] NS: Let EmacsView implement NSTextInputClient

* src/nsterm.h (@interface EmacsView): Implement NSTextInputClient protocol.
* src/nsterm.m: Implement required NSTextInputClient methods, forwarding
to existing NSTextInput methods.
---
 src/nsterm.h |  4 ++--
 src/nsterm.m | 37 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/nsterm.h b/src/nsterm.h
index 5d4810cba4a..f3dcb07a0f1 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -463,9 +463,9 @@ #define NSTRACE_UNSILENCE()
 @class EmacsLayer;
 
 #ifdef NS_IMPL_COCOA
-@interface EmacsView : NSView <NSTextInput, NSWindowDelegate>
+@interface EmacsView : NSView <NSTextInput, NSTextInputClient, NSWindowDelegate>
 #else
-@interface EmacsView : NSView <NSTextInput>
+@interface EmacsView : NSView <NSTextInput, NSTextInputClient>
 #endif
 {
 #ifdef NS_IMPL_COCOA
diff --git a/src/nsterm.m b/src/nsterm.m
index cd6ffabddde..c659ef40c73 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7049,9 +7049,44 @@ In that case we use UCKeyTranslate (ns_get_shifted_character)
   [nsEvArray removeObject: theEvent];
 }
 
+/***********************************************************************
+			   NSTextInputClient
+ ***********************************************************************/
 
-/* <NSTextInput> implementation (called through [super interpretKeyEvents:]).  */
+- (void) insertText: (id) string
+   replacementRange: (NSRange) replacementRange
+{
+  if ([string isKindOfClass:[NSAttributedString class]])
+    string = [string string];
+  [self unmarkText];
+  [self insertText:string];
+}
+
+- (void) setMarkedText: (id) string
+	 selectedRange: (NSRange) selectedRange
+      replacementRange: (NSRange) replacementRange
+{
+  [self setMarkedText: string selectedRange: selectedRange];
+}
+
+- (nullable NSAttributedString *)
+  attributedSubstringForProposedRange: (NSRange) range
+			  actualRange: (nullable NSRangePointer) actualRange
+{
+  return nil;
+}
 
+- (NSRect) firstRectForCharacterRange: (NSRange) range
+			  actualRange: (nullable NSRangePointer) actualRange
+{
+  return NSZeroRect;
+}
+
+/***********************************************************************
+			      NSTextInput
+ ***********************************************************************/
+
+/* <NSTextInput> implementation (called through [super interpretKeyEvents:]).  */
 
 /* <NSTextInput>: called when done composing;
    NOTE: also called when we delete over working text, followed
-- 
2.45.2


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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-30  6:00                       ` Gerd Möllmann
@ 2024-07-31  3:22                         ` Gerd Möllmann
  2024-07-31 13:51                           ` Eli Zaretskii
  0 siblings, 1 reply; 28+ messages in thread
From: Gerd Möllmann @ 2024-07-31  3:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 69525, alan

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> I'll push that to master, if nobody objects.

Pushed to emacs-30 instead, because it looks safe. Closing.





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

* bug#69525: 30.0.50; MacOS: New warnings on stderr
  2024-07-31  3:22                         ` Gerd Möllmann
@ 2024-07-31 13:51                           ` Eli Zaretskii
  0 siblings, 0 replies; 28+ messages in thread
From: Eli Zaretskii @ 2024-07-31 13:51 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 69525, alan

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 69525@debbugs.gnu.org,  alan@idiocy.org
> Date: Wed, 31 Jul 2024 05:22:10 +0200
> 
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> 
> > I'll push that to master, if nobody objects.
> 
> Pushed to emacs-30 instead, because it looks safe. Closing.

Famous last words.  You should have installed on master.





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

end of thread, other threads:[~2024-07-31 13:51 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03 16:18 bug#69525: 30.0.50; MacOS: New warnings on stderr Gerd Möllmann
2024-03-03 16:26 ` Eli Zaretskii
2024-03-03 17:33   ` Gerd Möllmann
2024-03-03 17:36     ` Gerd Möllmann
2024-03-03 18:06       ` Alan Third
2024-03-03 19:29         ` Gerd Möllmann
2024-03-04  9:12           ` Gerd Möllmann
2024-03-04 13:48         ` Gerd Möllmann
2024-03-04 14:43           ` Gerd Möllmann
2024-03-04 21:40           ` Alan Third
2024-03-05  4:38             ` Gerd Möllmann
2024-03-05 12:59               ` Alan Third
2024-03-05 14:31                 ` Gerd Möllmann
2024-03-05  5:31         ` Gerd Möllmann
2024-07-26 10:33           ` Gerd Möllmann
2024-07-26 10:55             ` Eli Zaretskii
2024-07-26 11:02               ` Gerd Möllmann
2024-07-26 19:09             ` Alan Third
2024-07-26 19:24               ` Gerd Möllmann
2024-07-26 19:36                 ` Alan Third
2024-07-27  3:56                   ` Gerd Möllmann
2024-07-27  6:37                     ` Eli Zaretskii
2024-07-30  6:00                       ` Gerd Möllmann
2024-07-31  3:22                         ` Gerd Möllmann
2024-07-31 13:51                           ` Eli Zaretskii
2024-07-26  9:56 ` Gerd Möllmann
2024-07-26 18:38   ` Alan Third
2024-07-26 19:02     ` Gerd Möllmann

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).