Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.4.2 + OS X 10.11 (El Capitan): how to remove the "Enter Full Screen" menu item?
Forum Updated to NodeBB v4.3 + New Features

Qt 5.4.2 + OS X 10.11 (El Capitan): how to remove the "Enter Full Screen" menu item?

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 3.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    agarny
    wrote on last edited by SGaist
    #1

    Hi,

    I have just noticed that my application (which, on OS X, works with 10.7 and later) has a new View | Enter Full Screen menu on OS X 10.11 (El Capitan). This menu is not present on 10.10 and before.

    Now, I have been supporting the full screen mode for some time in my application, so I already have a View | Full Screen menu. That 'new' menu is therefore redundant with what my application already offers. I thought I would, on OS X 10.11, remove my 'old' menu and thus have the 'new' one do the job for me. However, after having played with the 'new' menu, I can see that it's not working as I would expect. For example, if I start my application, select the View | Enter Full Screen menu, quit my application and restart it, my application will, as expected, be in full screen mode. However, if I now select what has become the View | Exit Full Screen menu, my application is not in full screen mode, but it's nonetheless maximised while I would have expected it to retrieve the size it had before it entered full screen mode. This is how my 'old' menu works and this is what I would have expected to see.

    So, since the 'new' menu doesn't work as I would expect, I was wondering whether there would be a way to hide that View | Enter Full Screen menu?...

    Cheers, Alan.

    1 Reply Last reply
    1
    • A Offline
      A Offline
      agarny
      wrote on last edited by agarny
      #4

      FWIW, I have now solved that problem (and other similar ones with macOS):

      // Remove (disable) the "Start Dictation..." and "Emoji & Symbols" menu items
      // from the "Edit" menu
      
      [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
      [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledCharacterPaletteMenuItem"];
      
      #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
      // Remove (don't allow) the "Show Tab Bar" menu item from the "View" menu, if
      // supported
      
      if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)])
          NSWindow.allowsAutomaticWindowTabbing = NO;
      #endif
      
      // Remove (don't have) the "Enter Full Screen" menu item from the "View" menu
      
      [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
      
      G 1 Reply Last reply
      2
      • Ramya EzhilarasanR Offline
        Ramya EzhilarasanR Offline
        Ramya Ezhilarasan
        wrote on last edited by
        #2

        Am also looking for disabling OSX full screen menu ... Any solutions found ??

        A 1 Reply Last reply
        0
        • Ramya EzhilarasanR Ramya Ezhilarasan

          Am also looking for disabling OSX full screen menu ... Any solutions found ??

          A Offline
          A Offline
          agarny
          wrote on last edited by
          #3

          @Ramya-Ezhilarasan Personally, I (still) haven't found a solution. Sorry.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            agarny
            wrote on last edited by agarny
            #4

            FWIW, I have now solved that problem (and other similar ones with macOS):

            // Remove (disable) the "Start Dictation..." and "Emoji & Symbols" menu items
            // from the "Edit" menu
            
            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledCharacterPaletteMenuItem"];
            
            #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
            // Remove (don't allow) the "Show Tab Bar" menu item from the "View" menu, if
            // supported
            
            if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)])
                NSWindow.allowsAutomaticWindowTabbing = NO;
            #endif
            
            // Remove (don't have) the "Enter Full Screen" menu item from the "View" menu
            
            [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
            
            G 1 Reply Last reply
            2
            • A agarny

              FWIW, I have now solved that problem (and other similar ones with macOS):

              // Remove (disable) the "Start Dictation..." and "Emoji & Symbols" menu items
              // from the "Edit" menu
              
              [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
              [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledCharacterPaletteMenuItem"];
              
              #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
              // Remove (don't allow) the "Show Tab Bar" menu item from the "View" menu, if
              // supported
              
              if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)])
                  NSWindow.allowsAutomaticWindowTabbing = NO;
              #endif
              
              // Remove (don't have) the "Enter Full Screen" menu item from the "View" menu
              
              [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
              
              G Offline
              G Offline
              ghutchis
              wrote on last edited by
              #5

              @agarny Sorry if I'm a bit oblivious. This seems like you're adding Objective-C (C++) to your project.

              Can you provide some small detail (or a link) on what you do?

              I'm guessing you have your main.m include a mix of Qt and Objective-C when you set things up?

              A 1 Reply Last reply
              0
              • G ghutchis

                @agarny Sorry if I'm a bit oblivious. This seems like you're adding Objective-C (C++) to your project.

                Can you provide some small detail (or a link) on what you do?

                I'm guessing you have your main.m include a mix of Qt and Objective-C when you set things up?

                A Offline
                A Offline
                agarny
                wrote on last edited by
                #6

                @ghutchis, here are some links that should make you understand what I did and how I did it:

                • CMakeLists.txt;
                • src/main.cpp;
                • src/misc/macos.mm; and
                • src/misc/macos.h.

                For another example that shows mixing Qt C++ and Objective C (using QMake this time):

                • WaniKani.pro.

                HTH

                G 1 Reply Last reply
                1
                • A agarny

                  @ghutchis, here are some links that should make you understand what I did and how I did it:

                  • CMakeLists.txt;
                  • src/main.cpp;
                  • src/misc/macos.mm; and
                  • src/misc/macos.h.

                  For another example that shows mixing Qt C++ and Objective C (using QMake this time):

                  • WaniKani.pro.

                  HTH

                  G Offline
                  G Offline
                  ghutchis
                  wrote on last edited by
                  #7

                  @agarny That's great - I was doing almost the same - but after looking at your examples, I realized the code wasn't calling the method in mac.mm.

                  CMake also needed me to add linker flags for Cocoa:
                  set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework Cocoa")

                  Thanks so much for your helpful post!

                  A 1 Reply Last reply
                  0
                  • G ghutchis

                    @agarny That's great - I was doing almost the same - but after looking at your examples, I realized the code wasn't calling the method in mac.mm.

                    CMake also needed me to add linker flags for Cocoa:
                    set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework Cocoa")

                    Thanks so much for your helpful post!

                    A Offline
                    A Offline
                    agarny
                    wrote on last edited by
                    #8

                    @ghutchis, oops, I indeed forgot to provide you with a link for updating the linker flags. Personally, and FWIW, I have the following:

                    SET(LINK_FLAGS_PROPERTIES "${LINK_FLAGS_PROPERTIES} -framework AppKit")
                    
                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved