Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On MacOS 14 Beta 2 when opened Maccy freezes and disables keyboard until force quit #566

Closed
viktor-yunenko opened this issue Jun 22, 2023 · 14 comments

Comments

@viktor-yunenko
Copy link

viktor-yunenko commented Jun 22, 2023

Firstly thank you for the awesome clipboard manager!

I'm creating this ticket mostly for other people's reference, since this beta has been quite popular. Understandably wouldn't expect it be fixed soon, given how unstable the beta is by itself.

Reproduction: triggering Maccy's shortcut or clicking on it in the Menu Bar stops most of the keys from working. Afterwards a restart or force quitting Maccy through Activity Monitor helps.

Versions:

  • 14 Beta 2 (23A5276g), released on Jun 21st
  • Maccy 0.26.4 from homebrew
@viktor-yunenko viktor-yunenko changed the title On MacOS 14 Beta opening of Maccy disables most of keyboard keys On MacOS 14 Beta 2 opening of Maccy disables most of keyboard keys Jun 22, 2023
@notcgi
Copy link

notcgi commented Jun 22, 2023

also unable to pin

@viktor-yunenko viktor-yunenko changed the title On MacOS 14 Beta 2 opening of Maccy disables most of keyboard keys On MacOS 14 Beta 2 when opened Maccy freezes and disables keyboard until force quit Jun 22, 2023
@BSakura-Miku
Copy link

在MacOS 14 Beta 2、1 出现相同问题

@howardellacott
Copy link

I think this is a macOS bug as the same occurs with Little Snitch, Tailscale and Amphetamine

@p0deje
Copy link
Owner

p0deje commented Jun 25, 2023

I can reproduce the issue, but no idea how to fix it yet.

@xezrunner
Copy link

xezrunner commented Jun 25, 2023

EDIT 2: The patch breaks searching when the search field is hidden.
I fixed the app hanging and crashing in #569.
However, at least during debugging, the clipboard contents don't appear to get recorded. I think that is unrelated - perhaps some clipboard API has changed with Sonoma Beta 2.
EDIT: I had the Turn off option enabled in Advanced. Copying works.

@xezrunner
Copy link

I can reproduce the issue, but no idea how to fix it yet.

Debugged it a bit, the crash appears to be linked to modifying the frame of the header NSView in the menubar panel in any way.
Seems to be an OS-side crash though, might even be specific to NSViews inside NSMenuItems. Should probably report this to Apple.

@philihub
Copy link

Thank you for working on this! Would there be the possibility for a quick fix for the basic functionality of Maccy so it is at least usable again despite some features not working?

@xezrunner
Copy link

Thank you for working on this! Would there be the possibility for a quick fix for the basic functionality of Maccy so it is at least usable again despite some features not working?

If you are relying on searching within Maccy, I suggest you wait until the next macOS Beta and/or until the Maccy developer releases an update fixing it.
Right now, it looks like searching by just typing after summoning Maccy is broken on Sonoma Beta 2.

If you still want the patch:
You can grab my fork and build the branch with the patch. If you don't have Xcode, here's a precompiled build:
Maccy.app.zip

No idea if updates will work when built with a different "team" setting in Xcode.

@philihub
Copy link

Thank you, @xezrunner! Will gladly take it 👍

@p0deje
Copy link
Owner

p0deje commented Jun 26, 2023

Thanks to @xezrunner who found the problem, I've pushed a fix in e119d2d that solves the crash. However, Maccy still cannot handle events so searching/pinning/etc doesn't work.

@xezrunner
Copy link

xezrunner commented Jun 26, 2023

Thanks to @xezrunner who found the problem, I've pushed a fix in e119d2d that solves the crash. However, Maccy still cannot handle events so searching/pinning/etc doesn't work.

Glad I could help!
Interesting to see how changing the frame in a different function works - they probably moved some layout code around internally, so now Maccy changing the frame during an "awake" function is too early.

I've reported the issue to Apple through the Feedback Assistant regardless, perhaps this was an edge case they didn't think of.

I tried toying around with the event handling issue today as well, but any way I tried to handle events would just simply not work. Will keep looking though.

@p0deje
Copy link
Owner

p0deje commented Jun 28, 2023

I've released 0.26.5 which addresses the crash. Search/pinning/delete still don't work, but let's track the work in #555.

@p0deje p0deje closed this as completed Jun 28, 2023
@xezrunner
Copy link

I've reported the issue to Apple through the Feedback Assistant regardless, perhaps this was an edge case they didn't think of.

image

@p0deje
Copy link
Owner

p0deje commented Jun 28, 2023

@xezrunner Any chance you could also report that InstallEventHandler doesn't call an event handler? The code is in

if let dispatcher = GetEventDispatcherTarget() {
// Create pointer to our event processer.
let eventProcessorPointer = UnsafeMutablePointer<Any>.allocate(capacity: 1)
eventProcessorPointer.initialize(to: processInterceptedEventRef)
let eventHandlerCallback: EventHandlerUPP = { _, eventRef, userData in
guard let event = eventRef else { return noErr }
guard let callbackPointer = userData else { return noErr }
// Call our event processor from pointer.
let eventProcessPointer = UnsafeMutablePointer<(EventRef) -> (Bool)>(OpaquePointer(callbackPointer))
let eventProcessed = eventProcessPointer.pointee(event)
if eventProcessed {
return noErr
} else {
return OSStatus(Carbon.eventNotHandledErr)
}
}
InstallEventHandler(dispatcher, eventHandlerCallback, 2, eventSpecs, eventProcessorPointer, &eventHandler)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants