[Git][wxwidgets/wxwidgets][master] 2 commits: Make background of more controls transparent in wxOSX

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Jan 15, 2026, 12:55:14 PMJan 15
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 5d41b241
    by Stefan Csomor at 2026-01-15T18:24:36+01:00
    Make background of more controls transparent in wxOSX
    
    wxRadioBox, wxRadioButton and wxSlider should also have transparent
    background.
    
    Closes #26092.
    
  • 2f89cd2d
    by Stefan Csomor at 2026-01-15T18:25:56+01:00
    Ensure that application is always shown after launch under macOS
    
    Post dummy event from applicationDidFinishLaunching, otherwise on some
    macOS versions apps might not boot properly if no other events are
    happening.
    
    Closes #26095.
    
    Closes #26098.
    

4 changed files:

Changes:

  • include/wx/osx/radiobox.h
    ... ... @@ -73,6 +73,8 @@ public:
    73 73
         virtual wxString GetString(unsigned int item) const override;
    
    74 74
         virtual void SetString(unsigned int item, const wxString& label) override;
    
    75 75
     
    
    76
    +    virtual bool HasTransparentBackground() override { return true; }
    
    77
    +
    
    76 78
         // protect native font of box
    
    77 79
         virtual bool SetFont( const wxFont &font ) override;
    
    78 80
     // Other external functions
    

  • include/wx/osx/radiobut.h
    ... ... @@ -37,6 +37,8 @@ public:
    37 37
         virtual void SetValue(bool val) override;
    
    38 38
         virtual bool GetValue() const override;
    
    39 39
     
    
    40
    +    virtual bool HasTransparentBackground() override { return true; }
    
    41
    +
    
    40 42
         // implementation
    
    41 43
     
    
    42 44
         void Command(wxCommandEvent& event) override;
    

  • include/wx/osx/slider.h
    ... ... @@ -68,6 +68,8 @@ public:
    68 68
         int GetThumbLength() const override;
    
    69 69
         void SetTick(int tickPos) override;
    
    70 70
     
    
    71
    +    virtual bool HasTransparentBackground() override { return true; }
    
    72
    +
    
    71 73
         void Command(wxCommandEvent& event) override;
    
    72 74
         // osx specific event handling common for all osx-ports
    
    73 75
     
    

  • src/osx/cocoa/utils.mm
    ... ... @@ -76,6 +76,19 @@ void wxBell()
    76 76
     - (void)applicationDidFinishLaunching:(NSNotification *)notification
    
    77 77
     {
    
    78 78
         wxUnusedVar(notification);
    
    79
    +
    
    80
    +    // we must make sure, that there still is an event on the event queue
    
    81
    +    // otherwise stopping the event queue will not advance, because quitting only
    
    82
    +    // gets processed AFTER the handling of the current event
    
    83
    +    // see https://developer.apple.com/documentation/appkit/nsapplication/stop(_:)?language=objc
    
    84
    +    NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
    
    85
    +                                location:NSMakePoint(0.0, 0.0)
    
    86
    +                           modifierFlags:0
    
    87
    +                               timestamp:0
    
    88
    +                            windowNumber:0
    
    89
    +                                 context:nil
    
    90
    +                                 subtype:0 data1:0 data2:0];
    
    91
    +    [NSApp postEvent:event atStart:FALSE];
    
    79 92
         [NSApp stop:nil];
    
    80 93
         wxTheApp->OSXOnDidFinishLaunching();
    
    81 94
     
    

Reply all
Reply to author
Forward
0 new messages