p0deje / Maccy

Lightweight clipboard manager for macOS
https://maccy.app
MIT License
11.84k stars 510 forks source link

Maccy will not stay open if cursor is inside a password field as of macOS 14.4 #743

Open jnubz opened 6 months ago

jnubz commented 6 months ago

Before Submitting Your Bug Report

Maccy Version (see 'About' window)

0.30.0

macOS Version

14.4

Maccy Settings

{
    "KeyboardShortcuts_delete" = "{\\"carbonKeyCode\\":51,\\"carbonModifiers\\":2048}";
    "KeyboardShortcuts_pin" = "{\\"carbonModifiers\\":2048,\\"carbonKeyCode\\":35}";
    "KeyboardShortcuts_popup" = "{\\"carbonModifiers\\":2560,\\"carbonKeyCode\\":18}";
    "LaunchAtLogin__hasMigrated" = 1;
    "NSStatusItem Preferred Position Item-0" = 5897;
    "NSWindow Frame SUStatusFrame" = "1520 961 400 134 0 0 3440 1415 ";
    "NSWindow Frame SUUpdateAlert" = "2570 492 620 398 1920 0 1920 1055 ";
    "NSWindow Frame com.sindresorhus.Preferences.FrameAutosaveName" = "1499 543 542 436 0 0 3440 1415 ";
    "NSWindow Frame com.sindresorhus.Settings.FrameAutosaveName" = "3037 380 542 436 1920 0 1920 1055 ";
    SUEnableAutomaticChecks = 1;
    SUHasLaunchedBefore = 1;
    SULastCheckTime = "2024-03-06 15:27:25 +0000";
    SUUpdateGroupIdentifier = 72295520;
    WebKitDefaultFontSize = 13;
    WebKitJavaEnabled = 0;
    WebKitJavaScriptEnabled = 0;
    WebKitPluginsEnabled = 0;
    WebKitStandardFont = "-apple-system-font";
    WebKitUserStyleSheetEnabledPreferenceKey = 1;
    WebKitUserStyleSheetLocationPreferenceKey = "/Applications/Maccy.app/Contents/Frameworks/Sparkle.framework/Resources/ReleaseNotesColorStyle.css";
    enabledPasteboardTypes =     (
        "public.tiff",
        "public.html",
        "public.rtf",
        "public.png",
        "public.file-url",
        "public.utf8-plain-text"
    );
    history = {length = 42, bytes = 0x62706c69 73743030 a0080000 00000000 ... 00000000 00000009 };
    ignoreEvents = 0;
    ignoredPasteboardTypes =     (
        "de.petermaurer.TransientPasteboardType",
        "Pasteboard generator type",
        "com.typeit4me.clipping",
        "com.agilebits.onepassword",
        "net.antelle.keeweb"
    );
    migrations =     {
        "2020-02-22-history-item-add-copied-at" = 1;
        "2020-02-22-history-item-add-number-of-copies" = 1;
        "2020-04-18-switch-storage-to-core-data" = 1;
        "2020-04-25-allow-custom-ignored-types" = 1;
        "2020-06-19-use-keyboardshortcuts" = 1;
        "2020-09-01-ignore-keeweb" = 1;
        "2021-02-20-allow-to-customize-supported-types" = 1;
        "2021-06-28-add-title-to-history-item" = 1;
        "2021-10-16-remove-dynamic-pasteboard-types" = 1;
        "2022-08-01-rename-suppress-clear-alert" = 1;
        "2022-11-14-add-html-rtf-to-supported-types" = 1;
        "2023-01-22-add-regexp-search-mode" = 1;
    };
    pasteByDefault = 1;
    removeFormattingByDefault = 1;
}

Description

When manually invoking or using the keyboard shortcut, the clipboard pop up will only appear for a split second if the focus is inside a browser password field. This happens in Chrome, Safari and Firefox. Maybe others.

This began during the beta testing of 14.4, but I didn't want to break NDA.

Steps to Reproduce

  1. Go to a website login page ( Facebook.com or Gmail.com can be used to reproduce)
  2. Click password field and ensure the cursor is blinking in the field
  3. try to activate Maccy clipboard menu. It appears for a second, but there is no way to use it.

Current workaround is to click away from all text fields, load up the clipboard item you need, then manually paste in the password field.

p0deje commented 6 months ago

Another workaround is to enable "Avoid taking application focus" in advanced preferences.

I'll see if there is a better way to handle password fields, the current logic no longer seems to work: https://github.com/p0deje/Maccy/blob/64a95eaeab019226c84d13ea4184654f10764641/Maccy/Menu/MenuHeader/MenuHeaderView.swift#L204-L208

jnubz commented 6 months ago

Thank you! Enabling "Avoid taking application focus" fixed it. Are there any features I might be used to using that this will change? Just curious to know why I might prefer it having app focus.

Thanks again. Maccy has been one of my favorite tools for almost 2 years now.

p0deje commented 6 months ago

Are there any features I might be used to using that this will change?

you are losing keyboard helpers such as Korean input handling or accented letters (when you hold, for example, "e" key for few seconds)

p0deje commented 6 months ago

Something tells the menu to close itself right after opening. It could be some macOS security mechanism and I'm not sure how to work it around.

Frankly, at this point, I feel like I need to rewrite Maccy from NSMenu to NSPopover and be done with all the menu-related hacks. This is however a massive effort so not sure when I might start working on this.

anupsabraham commented 5 months ago

I've been reopening maccy using spotlight search every time this happens. That seems to work even though it involves a lot of keypresses.

For me, this is happening in iTerm as well, not just for password inputs.

jagibson commented 5 months ago

I'm experiencing this in iTerm2 after updating to 14.4. Enabling "Avoid taking application focus" seems to be a good workaround.

p0deje commented 5 months ago

I'm experiencing this in iTerm2 after updating to 14.4. Enabling "Avoid taking application focus" seems to be a good workaround.

This is when entering password in a command such as sudo, right? In other cases it works correctly, doesn't it?

anupsabraham commented 5 months ago

This is when entering password in a command such as sudo, right? In other cases it works correctly, doesn't it?

No. Happening every time when I try to paste something onto iTerm2

p0deje commented 5 months ago

No. Happening every time when I try to paste something onto iTerm2

What version of macOS/Maccy/iTerm2? Can you please record a small video showing the problem?

jagibson commented 4 months ago

Here's a video

https://github.com/p0deje/Maccy/assets/5667478/098d806b-af30-4931-b6f2-e0d5383aac00

You can see the keyboard shortcut working normally in Notes and in Terminal, but not iTerm2.

MacOS 14.4.1 (Apple Silicon) iTerm2 3.4.23 Maccy 0.30.0 (29)

p0deje commented 4 months ago

There could be something in your iTerm2 configuration that prevents the popup from showing. Can you try enabling "Avoid taking application focus" in Maccy Advanced preferences?

jcugat commented 4 months ago

I had the same issue with iTerm2 as @jagibson and can confirm that enabling Avoid taking application focus fixes the issue @p0deje 👍

jagibson commented 2 months ago

I can also confirm that enabling "Avoid taking application focus" made the issue go away.