Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6720513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:13:16+00:00 2026-05-26T09:13:16+00:00

When changing the dock position Cocoa is firing a NSApplicationDidChangeScreenParametersNotification: The problem is that

  • 0

When changing the dock position Cocoa is firing a NSApplicationDidChangeScreenParametersNotification:

The problem is that as for Apple Docs, it should be raised only when

Posted when the configuration of the displays attached to the computer
is changed. The configuration change can be made either
programmatically or when the user changes settings in the Displays
control panel. The notification object is sharedApplication. This
notification does not contain a userInfo dictionary.

So if you want to update your application windows when attach a new display (e.g. changing/moving the frame of some HUD window/etc), you will have a fake notification coming the dock.
Also there’s no userInfo dictionary attached to this notification, so I had no chance to check whenever was the dock or a new display controller.

So how to handle this?

A possible solution is to check the [NSScreen mainScreen] size when the notification si fired.
If this NSSize changes, that notification comes from a new display attached, not from the dock:

static NSSize mainScreenSize;

-(void)handleApplicationDidChangeScreenParameters:(NSNotification *)notification {


    NSSize screenSize = [[NSScreen mainScreen] frame].size;


    if( screenSize.width != mainScreenSize.width || screenSize.height != mainScreenSize.height ) { // screen size changed

        mainScreenSize =  [[NSScreen mainScreen] frame].size;
        [myWindowController updateContent];
        [[myWindow contentView] setNeedsDisplay:YES]; // update custom window

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:13:17+00:00Added an answer on May 26, 2026 at 9:13 am

    The notification is fired because the main screen’s visibleFrame (which excludes the space occupied by the Dock) depends on the position of the Dock.

    So if the visibleFrame of the main screen changes, you can be sure that the notification is the result of the Dock being moved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

changing a static resource during runtine is something that sounds not possible. I have
When changing the password-hashing algorithm for an application, how should the system migrate the
Is changing the session-timeout param in web.xml the only way to end a user's
I am currently changing my android app so that it supports the action bar
Have you ever attempted using Swing only to end up changing courses because it
Changing code on a production system to quick-fix a problem is seductive. Even if
I was hoping that changing into create-session=stateless would be the end of it to
After changing the BaseSDK of my project to 10.6 I noticed that my custom
I found this: Changing Compiler to llvm-clang on existing iPhone Project But that does
I'm changing the .GlobalPreferences NSUserSubstitutions preference through the NSUserDefaults class (through PyObjC, but that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.