GithubHelp home page GithubHelp logo

Comments (4)

glouel avatar glouel commented on June 2, 2024

I can confirm I had noticed something like that, my guess was like yours, whatever they use for "bridging" to the wallpaper is still there (maybe our friend WallpaperAgent) and is messing up subsequent relaunches because some events didn't happen fully (I would guess the full transition to slowed down video + conversion to a fixed wallpaper). Waiting 10s before tries works fine.

What I noticed is that things do clear up though on subsequent proper launch/exit (so if you have 2 screens, you have 2 instances remaining for a bit, you launch again, you get 4, but the 4 will quit properly).

One of "those things" 🤷

from aerial.

xmddmx avatar xmddmx commented on June 2, 2024

After hacking around, I realized that what I really need is the ability to ignore mouse events while the lock screen password prompt is up.

I tried a bunch of ideas, and the closest I got was detecting if the coreautha process had a window open:

    if let info = CGWindowListCopyWindowInfo(.optionAll,kCGNullWindowID) as? [[ String : Any]] {
        for dict in info {
            let owner    = dict["kCGWindowOwnerName"] as? String ?? "none"
            if (owner == "coreautha") {
                NSLog("\(dict)")
            }
   }

Unfortunately in Sonoma, the 'coreautha' window is opened at the "Lock screen after ..." timeout, and there is no way to tell from the data if it's visible or not visible.

Regardless of whether the password prompt is visible or not, I always see something like this:

[
  "kCGWindowSharingState": 0, 
  "kCGWindowLayer": 1000, 
  "kCGWindowNumber": 518, 
  "kCGWindowOwnerName": coreautha, 
  "kCGWindowOwnerPID": 706, 
  "kCGWindowMemoryUsage": 2160, 
  "kCGWindowAlpha": 1, 
  "kCGWindowBounds": {
    Height = 0;
    Width = 0;
    X = 0;
    Y = 0;
    }, 
  "kCGWindowStoreType": 1]

the bounds are always 0,0,0,0 and Alpha is always 1, regardless of whether the lock screen password dialog is on or off...

from aerial.

glouel avatar glouel commented on June 2, 2024

Interesting, did you try looking for "com.apple.screenIsUnlocked" in distributed notifications ? I believe this is what you seek.

Edit : This is what I used to use before, I changed it to willstop for "some reason" that I can't quite remember right now.

Side note, the 0,0 thing kinda makes me think of the good old days of absolute full screen modes on other OSes. They seem to replicate that a bit here with making whatever the window is believe it's owning the entire screen, but that model fails hard with multiple monitors.

from aerial.

xmddmx avatar xmddmx commented on June 2, 2024

com.apple.screenIsUnlocked : my screensaver process is definitely not receiving those in Sonoma at all (although I can see they are being sent at the os level)

-[SessionAgentNotificationCenter sendDistributedNotification:forUserID:] | sendDistributedNotification: com.apple.screenIsUnlocked, with userID:501

I'm wondering if there's some way to dig into the coreautha (or loginwindow) processes and figure out if they are frontmost or not sleeping or similar...

from aerial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.