[Git][wxwidgets/wxwidgets][master] OSX part of navigation back from secondary wxFrame on iOS (#25909)

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Oct 23, 2025, 2:43:09 PMOct 23
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 5a454ffa
    by Stefan Csomor at 2025-10-23T20:31:59+02:00
    OSX part of navigation back from secondary wxFrame on iOS (#25909)
    
    Support navigation for iOS full screen mode, when using nested wxFrames, from #25841

3 changed files:

Changes:

  • include/wx/osx/app.h
    ... ... @@ -140,6 +140,10 @@ public:
    140 140
         // override this to return false from a non-bundled console app in order to stay in background ...
    
    141 141
         virtual bool         OSXIsGUIApplication() { return true; }
    
    142 142
     
    
    143
    +    // Returns false on macOS and on windowed iPad apps (iPadOS 26), this is not the same as a fullscreen app window
    
    144
    +    // in a desktop OS which still has options to escape the fullscreen mode, while on an iPhone you cannot.
    
    145
    +    bool                 OSXIsFullScreenApp();
    
    146
    +
    
    143 147
         // Allow the user to disable the tab bar support in the application
    
    144 148
         void                 OSXEnableAutomaticTabbing(bool enable);
    
    145 149
     
    

  • src/osx/carbon/app.cpp
    ... ... @@ -44,6 +44,7 @@
    44 44
     // mac
    
    45 45
     #include "wx/osx/private.h"
    
    46 46
     #include "wx/display.h"
    
    47
    +#include "wx/osx/private/available.h"
    
    47 48
     
    
    48 49
     #if defined(WXMAKINGDLL_CORE)
    
    49 50
     #   include <mach-o/dyld.h>
    
    ... ... @@ -191,6 +192,22 @@ void wxApp::MacReopenApp()
    191 192
         MacNewFile();
    
    192 193
     }
    
    193 194
     
    
    195
    +bool wxApp::OSXIsFullScreenApp()
    
    196
    +{
    
    197
    +#if wxOSX_USE_IPHONE
    
    198
    +
    
    199
    +    if ( WX_IS_IOS_AVAILABLE(26, 0) )
    
    200
    +    {
    
    201
    +        // TODO determine whether we are running as windowed app
    
    202
    +    }
    
    203
    +
    
    204
    +    return true;
    
    205
    +
    
    206
    +#else
    
    207
    +    return false;
    
    208
    +#endif
    
    209
    +}
    
    210
    +
    
    194 211
     #if wxOSX_USE_COCOA_OR_IPHONE
    
    195 212
     void wxApp::OSXOnWillFinishLaunching()
    
    196 213
     {
    

  • src/osx/carbon/frame.cpp
    ... ... @@ -24,6 +24,7 @@
    24 24
     
    
    25 25
     #include "wx/osx/private.h"
    
    26 26
     #include "wx/osx/private/available.h"
    
    27
    +#include "wx/stattext.h"
    
    27 28
     
    
    28 29
     namespace
    
    29 30
     {
    
    ... ... @@ -60,14 +61,37 @@ bool wxFrame::Create(wxWindow *parent,
    60 61
         if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
    
    61 62
             return false;
    
    62 63
     
    
    64
    +    if ( wxTheApp->OSXIsFullScreenApp() )
    
    65
    +    {
    
    66
    +        if ((parent != nullptr) && (HasFlag(wxCAPTION) || HasFlag(wxCLOSE_BOX)))
    
    67
    +        {
    
    68
    +            // We are on the next screen, provide a back button and title
    
    69
    +            // TODO replace with UINavigationBar
    
    70
    +            wxToolBar *tb = CreateToolBar();
    
    71
    +            if (HasFlag(wxCLOSE_BOX))
    
    72
    +            {
    
    73
    +                tb->AddTool( wxID_CLOSE, wxEmptyString, wxOSXCreateSystemBitmapBundle("chevron.backward", wxDefaultSize) );
    
    74
    +                tb->AddStretchableSpace();
    
    75
    +            }
    
    76
    +            if (HasFlag(wxCAPTION))
    
    77
    +            {
    
    78
    +                tb->AddControl( new wxStaticText( tb, wxID_ANY, title ) );
    
    79
    +                tb->AddStretchableSpace();
    
    80
    +            }
    
    81
    +            tb->Realize();
    
    82
    +        }
    
    83
    +    }
    
    84
    +
    
    63 85
         return true;
    
    64 86
     }
    
    65 87
     
    
    66 88
     // get the origin of the client area in the client coordinates
    
    67 89
     wxPoint wxFrame::GetClientAreaOrigin() const
    
    68 90
     {
    
    91
    +    // this gets the size of iOS status bar
    
    69 92
         wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
    
    70 93
     
    
    94
    +    // this adds the size of the toolbar to it
    
    71 95
     #if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__)
    
    72 96
         wxToolBar *toolbar = GetToolBar();
    
    73 97
         if ( toolbar && toolbar->IsShown() )
    
    ... ... @@ -359,18 +383,16 @@ void wxFrame::PositionToolBar()
    359 383
         }
    
    360 384
     #endif
    
    361 385
     
    
    362
    -#ifdef __WXOSX_IPHONE__
    
    363
    -    // TODO integrate this in a better way, on iphone the status bar is not a child of the content view
    
    364
    -    // but the toolbar is
    
    365
    -    ch -= 20;
    
    366
    -#endif
    
    367
    -
    
    368 386
         if (GetToolBar())
    
    369 387
         {
    
    370 388
             const int direction = GetToolBar()->GetDirection();
    
    371 389
             int tx, ty, tw, th;
    
    372 390
     
    
    373 391
             tx = ty = 0 ;
    
    392
    +        wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
    
    393
    +        tx = pt.x;
    
    394
    +        ty = pt.y;
    
    395
    +
    
    374 396
             GetToolBar()->GetSize(&tw, &th);
    
    375 397
     
    
    376 398
             if (direction == wxTB_LEFT)
    


View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help Notification message regarding https://gitlab.com/wxwidgets/wxwidgets/-/commit/5a454ffa9b330d3a5ecef35b200f738df3e65c83 at 1761244985

Reply all
Reply to author
Forward
0 new messages