Skip to content

macOS: hotplugging a monitor marks it as removed #12016

Closed
@slouken

Description

@slouken

When I plug a second monitor into my Mac Mini M1 running macOS 15.1.1, I get an event that the display was added, then immediately removed.

The debug output shows:

2025-01-18 08:58:31.192 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:31.192 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:31.192 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:31.194 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:31.221 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:31.221 testsprite[71613:27427842]  - kCGDisplayMovedFlag
2025-01-18 08:58:31.221 testsprite[71613:27427842]  - kCGDisplaySetModeFlag
2025-01-18 08:58:31.221 testsprite[71613:27427842]  - kCGDisplayAddFlag
2025-01-18 08:58:31.221 testsprite[71613:27427842]  - kCGDisplayEnabledFlag
2025-01-18 08:58:31.221 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 08:58:31.222 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:31.222 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 08:58:31.226 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:31.226 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:31.226 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:31.226 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:31.227 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:31.227 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:31.246 testsprite[71613:27427842] SDL_EVENT_DISPLAY_ADDED 8
2025-01-18 08:58:31.246 testsprite[71613:27427842] Display 1 '1': 2560x1440 at 0,0
2025-01-18 08:58:31.246 testsprite[71613:27427842] Display 8 '8': 1920x1080 at -1920,84
2025-01-18 08:58:31.246 testsprite[71613:27427842] SDL_EVENT_DISPLAY_MOVED 8
2025-01-18 08:58:31.246 testsprite[71613:27427842] Display 1 '1': 2560x1440 at 0,0
2025-01-18 08:58:31.246 testsprite[71613:27427842] Display 8 '8': 1920x1080 at -1920,84
2025-01-18 08:58:33.000 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.000 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.000 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:33.000 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayMovedFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplaySetModeFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayAddFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayRemoveFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayEnabledFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayDisabledFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
add and remove
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.004 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:33.004 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.006 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.006 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 08:58:33.006 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:33.006 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 08:58:33.006 testsprite[71613:27427842] SDL_EVENT_DISPLAY_REMOVED 8
2025-01-18 08:58:33.006 testsprite[71613:27427842] Display 1 '1': 2560x1440 at 0,0
2025-01-18 08:58:33.048 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.048 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.048 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:33.048 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 08:58:33.065 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 08:58:33.065 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 08:58:34.565 testsprite[71613:27427842] 1147.00 frames per second

For reference, when the display is removed, the sequence is:

2025-01-18 09:03:53.828 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 09:03:53.828 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 09:03:53.828 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 09:03:53.828 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 09:03:53.845 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=2
2025-01-18 09:03:53.845 testsprite[71613:27427842]  - kCGDisplayRemoveFlag
2025-01-18 09:03:53.845 testsprite[71613:27427842]  - kCGDisplayDisabledFlag
2025-01-18 09:03:53.845 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 09:03:53.845 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 09:03:53.845 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 09:03:53.846 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 09:03:53.846 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 09:03:53.846 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1

When I connect an iPad as a second display, the sequence is:

2025-01-18 09:05:17.922 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 09:05:17.922 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 09:05:17.922 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=5
2025-01-18 09:05:17.922 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 09:05:17.976 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=5
2025-01-18 09:05:17.976 testsprite[71613:27427842]  - kCGDisplayMovedFlag
2025-01-18 09:05:17.976 testsprite[71613:27427842]  - kCGDisplaySetModeFlag
2025-01-18 09:05:17.976 testsprite[71613:27427842]  - kCGDisplayAddFlag
2025-01-18 09:05:17.976 testsprite[71613:27427842]  - kCGDisplayEnabledFlag
2025-01-18 09:05:17.976 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 09:05:17.984 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 09:05:17.984 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 09:05:18.104 testsprite[71613:27427842] SDL_EVENT_DISPLAY_ADDED 9
2025-01-18 09:05:18.105 testsprite[71613:27427842] Display 1 '1': 2560x1440 at 0,0
2025-01-18 09:05:18.105 testsprite[71613:27427842] Display 9 '9': 1288x946 at -1288,0
2025-01-18 09:05:18.105 testsprite[71613:27427842] SDL_EVENT_DISPLAY_MOVED 9
2025-01-18 09:05:18.105 testsprite[71613:27427842] Display 1 '1': 2560x1440 at 0,0
2025-01-18 09:05:18.105 testsprite[71613:27427842] Display 9 '9': 1288x946 at -1288,0

and when I remove it, the sequence is:

2025-01-18 09:05:59.777 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=5
2025-01-18 09:05:59.777 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 09:05:59.777 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 09:05:59.777 testsprite[71613:27427842]  - kCGDisplayBeginConfigurationFlag
2025-01-18 09:05:59.831 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=5
2025-01-18 09:05:59.831 testsprite[71613:27427842]  - kCGDisplayRemoveFlag
2025-01-18 09:05:59.831 testsprite[71613:27427842]  - kCGDisplayDisabledFlag
2025-01-18 09:05:59.831 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 09:05:59.831 testsprite[71613:27427842] COCOA DISPLAY RECONFIG CALLBACK! display=1
2025-01-18 09:05:59.831 testsprite[71613:27427842]  - kCGDisplayDesktopShapeChangedFlag
2025-01-18 09:05:59.834 testsprite[71613:27427842] SDL_EVENT_DISPLAY_REMOVED 9
2025-01-18 09:05:59.834 testsprite[71613:27427842] Display 1 '1': 2560x1440 at 0,0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions