[Git][wxwidgets/wxwidgets][3.2] 12 commits: Fix TAB behaviour in a panel with notebook as only active child

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Aug 30, 2025, 4:08:55 PM (9 days ago) Aug 30
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch 3.2 at wxWidgets / wxWidgets

Commits:

  • 082d1fd2
    by Maarten Bent at 2025-07-30T23:29:20+02:00
    Fix TAB behaviour in a panel with notebook as only active child
    
    If a panel contained a notebook and some other element(s) that didn't
    accept focus (e.g. because they were disabled), TAB didn't wrap around
    correctly. Fix this by ensuring the focus gets to the notebook itself in
    this case by handling it in wxNotebook itself if the parent didn't do
    anything.
    
    See #25443.
    
    (cherry picked from commit a2ed8ac9e6239740902ca2d5062079b2b5673e50)
    
  • 769bddb9
    by Vadim Zeitlin at 2025-07-30T23:33:34+02:00
    Do generate wxEVT_CHAR for Ctrl-Letter even in non US layouts
    
    Use the key translated to the US layout by XKB and not the actual
    character produced by the key in the current layout when determining
    whether to generate wxEVT_CHAR for key presses with Ctrl or not.
    
    This ensures that we produce the expected events for Ctrl-Latter in all
    layouts and not just the ones using Latin letters.
    
    See #25384, #25385.
    
    (cherry picked from commit 57c33bb9edb226648bbde1b4425ccaa932cf46a7)
    
  • 7be5d6b6
    by Vadim Zeitlin at 2025-07-30T23:35:23+02:00
    Really fix generic wxActivityIndicator dots contrast
    
    These dots should just use the window foreground colour instead of using
    the hardcoded colour -- it will still be the same as before by default
    but could be different (and better) now if different colours are used
    for the window.
    
    See #25405.
    
    (cherry picked from commit c0089d90b047cdf012d5c10f7de65acf00e5ae0f)
    
  • 99daac0e
    by Vadim Zeitlin at 2025-07-30T23:38:01+02:00
    Make wxPlatformInfo::Get() thread-safe
    
    Protect gs_platInfo initialization with a critical section to ensure
    that we don't try to do it in parallel from more than one thread,
    resulting in crashes.
    
    See #25459, #25464.
    
    (cherry picked from commit a26eda72e88681aed9db3ae823f244e9a7cce402)
    
  • a456327d
    by Vadim Zeitlin at 2025-08-01T00:40:50+02:00
    Fix assert checking for wxSocket flags compatibility
    
    While wxSOCKET_NOWAIT is incompatible with wxSOCKET_WAITALL, using
    wxSOCKET_NOWAIT_READ and wxSOCKET_WAITALL_WRITE should be allowed, but
    it was not.
    
    Fix this and also split the assert in two for a bit more clarity.
    
    See #17114, #25665.
    
    (cherry picked from commit 943e4fb18d7b2a3b717628dcc576132837945905)
    
  • 30c0f6a6
    by Vadim Zeitlin at 2025-08-02T15:22:14+02:00
    Fix readlink problem in configure build under macOS < 12
    
    Don't use "readlink -f" as readlink doesn't support this option in macOS
    11 and earlier. Just construct the full path ourselves instead.
    
    Closes #25675.
    
  • c84d5301
    by Vadim Zeitlin at 2025-08-13T23:13:28+02:00
    Fix wrong documentation of wxObjectDataPtr ctor
    
    This ctor was wrongly documented back in cfa9866bf5 (revision
    contributed by Utensil Candel, 2008-03-30) to call IncRef() on the
    pointer passed to it but in fact it just takes ownership of it.
    
    See #25692.
    
    (cherry picked from commit ea0a01879f09721eb97e4dfb879971fda6431130)
    
  • c13eadfb
    by Václav Slavík at 2025-08-17T23:44:48+02:00
    Fix MSVS debug visualizer of wxStrings
    
    Fix the visualizer to display full Unicode string.
    
    Previously, only the first character was shown in recent versions of
    Visual Studio. This was due to the use of "sb" format specifier meaning
    an ANSI string.
    
    Use condition expressions to cover both wchar_t and UTF-8 builds.
    
    Correct the specifier for UTF-8 case to be "s8b" so that it interprets
    and displays UTF-8 correctly.
    
    See #25684.
    
    (cherry picked from commit 77dd42f3c6f5198f50874955fcb25e91dac9f083)
    
  • da73abbd
    by Vadim Zeitlin at 2025-08-18T00:17:07+02:00
    Don't bother resetting wxStaticBitmap image when destroying it
    
    This results in sending a WM_PAINT to the control parent which may be
    rather unexpected if it happens while it is itself being destroyed, see
    the fix for #25499 in the parent commit, so don't do it when Free() is
    called from dtor.
    
    And it is also unnecessary to do it when Free() is called from
    DoUpdateImage(), as it calls MSWReplaceImageHandle() with another,
    valid, handle right next anyhow.
    
    See #25518.
    
    (cherry picked from commit 3e32a9abe1e05f0cddb17c791a59977bed8e8cff)
    
  • 9b0dd381
    by Vadim Zeitlin at 2025-08-18T00:17:07+02:00
    Reduce GDI resource usage in wxMSW wxStaticBitmap
    
    Free unused bitmaps in wxMSW wxStaticBitmap to reduce GDI resource usage
    in this class.
    
    See #25698, #25699.
    
    (cherry picked from commit a39832140e8a854c9854fc7f7b32f563f9df1365)
    
  • c363545d
    by Vadim Zeitlin at 2025-08-22T00:49:21+02:00
    Fix window size after unmaximizing it in XFCE/MATE
    
    Workaround for Mutter from 9537141500 (Fix handling window total size
    under GNOME with X11, 2025-04-28) broke the well behaving WMs used by
    other desktop environments, such as XFCE, as it resulted in the window
    size being mistakenly adjusted after the decorations size was changed
    due to restoring a previous maximized window.
    
    Prevent this from happening by not adjusting the size after the window
    has been already mapped.
    
    See #25348, #25349, #25708, #25711.
    
    (cherry picked from commit 9b7371954364413608d93b210a9b0d2738a1f6a4)
    
  • 323016cd
    by jey5nd6 at 2025-08-23T20:20:47+02:00
    Fix showing extra controls in wxFileDialog under macOS
    
    These controls were not shown due to a forgotten colon in the test for
    setAccessoryViewDisclosed support added in e765756555 (OSX file dialog
    extensions (#2592), 2021-11-26).
    
    Fix this simply by adding the colon, which is part of the method name,
    but also avoid calling this method for save file dialogs which not only
    don't need it, but result in an immediate application exit if it is
    called on them.
    
    See #25717.
    
    (combined cherry pick from 426f745c6b069e9cd71a47a2272f5d6e07a9c6df and
    32ea27c34f4b88eb6d407c223d0b91c5c884554b)
    

16 changed files:

Changes:

  • configure
    ... ... @@ -34271,15 +34271,17 @@ rm -f core conftest.err conftest.$ac_objext \
    34271 34271
                 DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
    
    34272 34272
                 cat <<EOF >change-install-names
    
    34273 34273
     #!/bin/sh
    
    34274
    +set -e
    
    34275
    +libdir=\$(cd lib ; pwd -P)
    
    34274 34276
     libnames=\$(cd lib ; ls -1 libwx*${WX_RELEASE}.dylib)
    
    34275 34277
     changes=''
    
    34276 34278
     for dep in \${libnames} ; do
    
    34277
    -    target=\$(readlink -f \${4}/\${dep})
    
    34278
    -    changes="\${changes} -change \${target} \${3}/\${dep}"
    
    34279
    +    target=\$(readlink \${4}/\${dep})
    
    34280
    +    changes="\${changes} -change \${libdir}\${target} \${3}/\${dep}"
    
    34279 34281
     done
    
    34280 34282
     for i in \${libnames} ; do
    
    34281
    -    lib=\$(readlink -f \${1}/\${i})
    
    34282
    -    ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${lib}
    
    34283
    +    lib=\$(readlink \${1}/\${i})
    
    34284
    +    ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${libdir}/\${lib}
    
    34283 34285
     done
    
    34284 34286
     
    
    34285 34287
     if test -f "\${2}/wxrc-${WX_RELEASE}" ; then
    

  • configure.in
    ... ... @@ -4142,15 +4142,17 @@ if test "$wxUSE_SHARED" = "yes"; then
    4142 4142
                 DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
    
    4143 4143
                 cat <<EOF >change-install-names
    
    4144 4144
     #!/bin/sh
    
    4145
    +set -e
    
    4146
    +libdir=\$(cd lib ; pwd -P)
    
    4145 4147
     libnames=\$(cd lib ; ls -1 libwx*${WX_RELEASE}.dylib)
    
    4146 4148
     changes=''
    
    4147 4149
     for dep in \${libnames} ; do
    
    4148
    -    target=\$(readlink -f \${4}/\${dep})
    
    4149
    -    changes="\${changes} -change \${target} \${3}/\${dep}"
    
    4150
    +    target=\$(readlink \${4}/\${dep})
    
    4151
    +    changes="\${changes} -change \${libdir}\${target} \${3}/\${dep}"
    
    4150 4152
     done
    
    4151 4153
     for i in \${libnames} ; do
    
    4152
    -    lib=\$(readlink -f \${1}/\${i})
    
    4153
    -    ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${lib}
    
    4154
    +    lib=\$(readlink \${1}/\${i})
    
    4155
    +    ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${libdir}/\${lib}
    
    4154 4156
     done
    
    4155 4157
     
    
    4156 4158
     if test -f "\${2}/wxrc-${WX_RELEASE}" ; then
    

  • docs/changes.txt
    ... ... @@ -255,18 +255,23 @@ Changes in behaviour which may result in build errors
    255 255
     All:
    
    256 256
     
    
    257 257
     - Backport several CMake enhancements from 3.3 (Maarten Bent, #25448).
    
    258
    +- Fix using wxSOCKET_NOWAIT_READ and wxSOCKET_WAITALL_WRITE together (#17114).
    
    259
    +- Make wxPlatformInfo::Get() thread-safe (#25459).
    
    258 260
     
    
    259 261
     All (GUI):
    
    260 262
     
    
    261 263
     - Respect menu path style in wxFileHistory::AddFilesToMenu() (Bill Su, #25451).
    
    262 264
     - Don't assert in wxGridSizer::Calc{Cols,Rows}() if sizer is empty (#25641).
    
    263 265
     - Fix calling wxDataViewCtrl::Collapse() from event handler (#25631).
    
    266
    +- Improve wxActivityIndicator dots colour contrast with background (#25405).
    
    264 267
     
    
    265 268
     wxGTK:
    
    266 269
     
    
    267 270
     - Fix handling total window size with GNOME with X11 (#25348).
    
    268 271
     - Fix height of read-only wxBitmapComboBox (#25468).
    
    269 272
     - Fix wxGLCanvas scale when using EGL/Wayland in high DPI (Popax21, #23733).
    
    273
    +- Fix missing wxEVT_CHAR for Ctrl-Letter in non-US layouts (#25384).
    
    274
    +- Fix regression when unmaximizing windows under XFCE/MATE (#25708).
    
    270 275
     - Show system default window buttons under Wayland (#25562).
    
    271 276
     
    
    272 277
     wxMSW
    
    ... ... @@ -274,12 +279,17 @@ wxMSW
    274 279
     - Fix regression in wxTreeCtrl indent size in high DPI (Maarten Bent, #25282).
    
    275 280
     - Fix using wxNO_IMPLICIT_WXSTRING_ENCODING with PCH (#25568).
    
    276 281
     - Fix crash when copying wxBitmaps if GDI resources are exhausted (#24703).
    
    282
    +- Fix MSVS debug visualizer for wxString (#25684).
    
    283
    +- Fix TAB behaviour in a panel with notebook as only active child (#25443).
    
    284
    +- Reduce GDI resource usage in wxStaticBitmap (Alex Shvartzkop, #25698).
    
    277 285
     
    
    278 286
     wxOSX:
    
    279 287
     
    
    280 288
     - Fix crash on startup when using Farsi as system language (#25561).
    
    289
    +- Fix showing extra controls in wxFileDialog (jey5nd6, #25717).
    
    281 290
     - Do not activate "Close" button on Cmd-C (nobugshere, #25346).
    
    282 291
     - Fix memory leak in wxColour::Set() (#25569).
    
    292
    +- Fix regression with configure build under macOS < 12 (#25675).
    
    283 293
     
    
    284 294
     
    
    285 295
     3.2.8.1: (released 2025-05-25)
    

  • include/wx/gtk/toplevel.h
    ... ... @@ -94,6 +94,7 @@ public:
    94 94
     
    
    95 95
         // GTK callbacks
    
    96 96
         virtual void GTKHandleRealized() wxOVERRIDE;
    
    97
    +    void GTKHandleMapped();
    
    97 98
     
    
    98 99
         void GTKConfigureEvent(int x, int y);
    
    99 100
     
    

  • include/wx/msw/statbmp.h
    ... ... @@ -133,10 +133,6 @@ private:
    133 133
         // Flag indicating whether we own m_currentHandle, i.e. should delete it.
    
    134 134
         bool m_ownsCurrentHandle;
    
    135 135
     
    
    136
    -    // Replace the image at the native control level with the given HBITMAP or
    
    137
    -    // HICON (which can be 0) and destroy the previous image if necessary.
    
    138
    -    void MSWReplaceImageHandle(WXHANDLE handle);
    
    139
    -
    
    140 136
     
    
    141 137
         wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap);
    
    142 138
         wxDECLARE_EVENT_TABLE();
    

  • interface/wx/object.h
    ... ... @@ -581,7 +581,8 @@ public:
    581 581
             Constructor.
    
    582 582
     
    
    583 583
             @a ptr is a pointer to the reference counted object to which this class points.
    
    584
    -        If @a ptr is not NULL @b T::IncRef() will be called on the object.
    
    584
    +        This object takes ownership of @a ptr, i.e.\ it will call T::DecRef()
    
    585
    +        on it if it is non-null when this object is destroyed or reset.
    
    585 586
         */
    
    586 587
         wxObjectDataPtr(T* ptr = NULL);
    
    587 588
     
    

  • interface/wx/platinfo.h
    ... ... @@ -270,6 +270,11 @@ public:
    270 270
         /**
    
    271 271
             Returns the global wxPlatformInfo object, initialized with the values
    
    272 272
             for the currently running platform.
    
    273
    +
    
    274
    +        Note that this function is thread-safe, i.e. it can be called
    
    275
    +        concurrently from multiple threads without locking (unless wxWidgets
    
    276
    +        was compiled without threads support, i.e. with @c wxUSE_THREADS
    
    277
    +        changed to be 0).
    
    273 278
         */
    
    274 279
         static const wxPlatformInfo& Get();
    
    275 280
     
    

  • misc/msvc/wxWidgets.natvis
    ... ... @@ -13,11 +13,12 @@ http://code.msdn.microsoft.com/windowsdesktop/Writing-type-visualizers-2eae77a2#
    13 13
         <!-- We want to avoid showing 'L' before the string, this is useless and
    
    14 14
              makes the display less readable. But we still do want to put quotes
    
    15 15
              around the string to show that it is, in fact, a string. So we use
    
    16
    -         "sb" qualifier to get rid of L"..." around the string and then add
    
    17
    -		 the quotes back. This also has a (nice) side effect of not doubling
    
    18
    -		 the backslashes inside the string. -->
    
    16
    +         "sub" or "s8b" qualifier to get rid of L"..." around the string and
    
    17
    +         then add the quotes back. This also has a (nice) side effect of not
    
    18
    +         doubling the backslashes inside the string. -->
    
    19 19
         <Type Name="wxString">
    
    20
    -        <DisplayString>"{m_impl,sb}"</DisplayString>
    
    20
    +        <DisplayString Condition="sizeof(m_impl[0])==2">"{m_impl,sub}"</DisplayString> <!-- wxUSE_UNICODE_WCHAR -->
    
    21
    +        <DisplayString Condition="sizeof(m_impl[0])==1">"{m_impl,s8b}"</DisplayString> <!-- wxUSE_UNICODE_UTF8 -->
    
    21 22
             <StringView>m_impl</StringView>
    
    22 23
         </Type>
    
    23 24
     
    

  • src/common/platinfo.cpp
    ... ... @@ -33,11 +33,21 @@
    33 33
         #include "wx/dynlib.h"
    
    34 34
     #endif
    
    35 35
     
    
    36
    +namespace
    
    37
    +{
    
    38
    +
    
    36 39
     // global object
    
    37 40
     // VERY IMPORTANT: do not use the default constructor since it would
    
    38 41
     //                 try to init the wxPlatformInfo instance using
    
    39 42
     //                 gs_platInfo itself!
    
    40
    -static wxPlatformInfo gs_platInfo(wxPORT_UNKNOWN);
    
    43
    +wxPlatformInfo gs_platInfo(wxPORT_UNKNOWN);
    
    44
    +
    
    45
    +#if wxUSE_THREADS
    
    46
    +// Critical section protecting gs_platInfo initialization.
    
    47
    +wxCriticalSection gs_csInit;
    
    48
    +#endif // wxUSE_THREADS
    
    49
    +
    
    50
    +} // anonymous namespace
    
    41 51
     
    
    42 52
     // ----------------------------------------------------------------------------
    
    43 53
     // constants
    
    ... ... @@ -213,12 +223,12 @@ void wxPlatformInfo::InitForCurrentPlatform()
    213 223
     /* static */
    
    214 224
     const wxPlatformInfo& wxPlatformInfo::Get()
    
    215 225
     {
    
    216
    -    static bool initialized = false;
    
    217
    -    if ( !initialized )
    
    218
    -    {
    
    226
    +#if wxUSE_THREADS
    
    227
    +    wxCriticalSectionLocker lockInit(gs_csInit);
    
    228
    +#endif // wxUSE_THREADS
    
    229
    +
    
    230
    +    if ( !gs_platInfo.m_initializedForCurrentPlatform )
    
    219 231
             gs_platInfo.InitForCurrentPlatform();
    
    220
    -        initialized = true;
    
    221
    -    }
    
    222 232
     
    
    223 233
         return gs_platInfo;
    
    224 234
     }
    

  • src/common/socket.cpp
    ... ... @@ -1704,12 +1704,18 @@ void wxSocketBase::SetTimeout(long seconds)
    1704 1704
     
    
    1705 1705
     void wxSocketBase::SetFlags(wxSocketFlags flags)
    
    1706 1706
     {
    
    1707
    -    // Do some sanity checking on the flags used: not all values can be used
    
    1708
    -    // together.
    
    1709
    -    wxASSERT_MSG( !(flags & wxSOCKET_NOWAIT) ||
    
    1710
    -                  !(flags & (wxSOCKET_WAITALL | wxSOCKET_BLOCK)),
    
    1711
    -                  "Using wxSOCKET_WAITALL or wxSOCKET_BLOCK with "
    
    1712
    -                  "wxSOCKET_NOWAIT doesn't make sense" );
    
    1707
    +    // Do some sanity checking on the flags used: we can't not wait at all and
    
    1708
    +    // wait for all data in the same direction (but using wxSOCKET_NOWAIT_READ
    
    1709
    +    // with wxSOCKET_WAITALL_WRITE, or vice versa, is fine).
    
    1710
    +    wxASSERT_MSG( (!(flags & wxSOCKET_NOWAIT_READ) ||
    
    1711
    +                   !(flags & wxSOCKET_WAITALL_READ)) &&
    
    1712
    +                  (!(flags & wxSOCKET_NOWAIT_WRITE) ||
    
    1713
    +                   !(flags & wxSOCKET_WAITALL_WRITE)),
    
    1714
    +                  "wxSOCKET_WAITALL and wxSOCKET_NOWAIT are incompatible" );
    
    1715
    +
    
    1716
    +    // And blocking is not compatible with not waiting, in any direction.
    
    1717
    +    wxASSERT_MSG( !(flags & wxSOCKET_BLOCK) || !(flags & wxSOCKET_NOWAIT),
    
    1718
    +                  "wxSOCKET_BLOCK and wxSOCKET_NOWAIT are incompatible" );
    
    1713 1719
     
    
    1714 1720
         // Blocking sockets are very different from non-blocking ones and we need
    
    1715 1721
         // to [un]register the socket with the event loop if wxSOCKET_BLOCK is
    

  • src/generic/activityindicator.cpp
    ... ... @@ -148,8 +148,7 @@ private:
    148 148
             // the next position every time.
    
    149 149
             gc->Rotate(m_frame*angle);
    
    150 150
     
    
    151
    -        // Choose a contrasting background colour.
    
    152
    -        wxColour colBg = wxSystemSettings::SelectLightDark(*wxBLACK, *wxWHITE);
    
    151
    +        wxColour colDot = m_win->GetForegroundColour();
    
    153 152
     
    
    154 153
             const bool isEnabled = m_win->IsThisEnabled();
    
    155 154
             for ( int n = 0; n < NUM_DOTS; n++ )
    
    ... ... @@ -163,8 +162,8 @@ private:
    163 162
                 // it in 0..wxALPHA_OPAQUE range.
    
    164 163
                 const int opacity = opacityIndex*(wxALPHA_OPAQUE + 1)/NUM_DOTS - 1;
    
    165 164
     
    
    166
    -            colBg.Set(colBg.Red(), colBg.Green(), colBg.Blue(), opacity);
    
    167
    -            gc->SetBrush(colBg);
    
    165
    +            colDot.Set(colDot.Red(), colDot.Green(), colDot.Blue(), opacity);
    
    166
    +            gc->SetBrush(colDot);
    
    168 167
     
    
    169 168
                 gc->FillPath(path);
    
    170 169
                 gc->Rotate(angle);
    

  • src/gtk/toplevel.cpp
    ... ... @@ -453,7 +453,14 @@ gtk_frame_map_callback( GtkWidget*,
    453 453
                             GdkEvent * WXUNUSED(event),
    
    454 454
                             wxTopLevelWindow *win )
    
    455 455
     {
    
    456
    -    const bool wasIconized = win->IsIconized();
    
    456
    +    win->GTKHandleMapped();
    
    457
    +    return false;
    
    458
    +}
    
    459
    +}
    
    460
    +
    
    461
    +void wxTopLevelWindowGTK::GTKHandleMapped()
    
    462
    +{
    
    463
    +    const bool wasIconized = IsIconized();
    
    457 464
         if (wasIconized)
    
    458 465
         {
    
    459 466
             // Because GetClientSize() returns (0,0) when IsIconized() is true,
    
    ... ... @@ -462,21 +469,21 @@ gtk_frame_map_callback( GtkWidget*,
    462 469
             // tlw that was "rolled up" with some WMs.
    
    463 470
             // Queue a resize rather than sending size event directly to allow
    
    464 471
             // children to be made visible first.
    
    465
    -        win->m_useCachedClientSize = false;
    
    466
    -        win->m_clientWidth = 0;
    
    467
    -        gtk_widget_queue_resize(win->m_wxwindow);
    
    472
    +        m_useCachedClientSize = false;
    
    473
    +        m_clientWidth = 0;
    
    474
    +        gtk_widget_queue_resize(m_wxwindow);
    
    468 475
         }
    
    469 476
         // it is possible for m_isShown to be false here, see bug #9909
    
    470
    -    if (win->wxWindowBase::Show(true))
    
    477
    +    if (wxWindowBase::Show(true))
    
    471 478
         {
    
    472
    -        win->GTKDoAfterShow();
    
    479
    +        GTKDoAfterShow();
    
    473 480
         }
    
    474 481
     
    
    475 482
         // restore focus-on-map setting in case ShowWithoutActivating() was called
    
    476
    -    gtk_window_set_focus_on_map(GTK_WINDOW(win->m_widget), true);
    
    483
    +    gtk_window_set_focus_on_map(GTK_WINDOW(m_widget), true);
    
    477 484
     
    
    478
    -    return false;
    
    479
    -}
    
    485
    +    // Deferred show is no longer possible
    
    486
    +    m_deferShowAllowed = false;
    
    480 487
     }
    
    481 488
     
    
    482 489
     //-----------------------------------------------------------------------------
    
    ... ... @@ -1298,7 +1305,7 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
    1298 1305
     
    
    1299 1306
         if (m_width != oldSize.x || m_height != oldSize.y)
    
    1300 1307
         {
    
    1301
    -        m_deferShowAllowed = true;
    
    1308
    +        m_deferShowAllowed = !gtk_widget_get_mapped(m_widget);
    
    1302 1309
             m_useCachedClientSize = false;
    
    1303 1310
     
    
    1304 1311
     #ifdef __WXGTK3__
    

  • src/gtk/window.cpp
    ... ... @@ -1388,20 +1388,21 @@ gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget),
    1388 1388
                 // etc).
    
    1389 1389
                 if ( eventChar.ControlDown() )
    
    1390 1390
                 {
    
    1391
    -                if ( uniChar >= 'a' && uniChar <= 'z' )
    
    1392
    -                    uniChar = toupper(uniChar);
    
    1393
    -
    
    1394
    -                if ( (uniChar >= 'A' && uniChar <= 'Z') ||
    
    1395
    -                        uniChar == '[' ||
    
    1396
    -                        uniChar == '\\' ||
    
    1397
    -                        uniChar == ']' ||
    
    1398
    -                        uniChar == '^' ||
    
    1399
    -                        uniChar == '_' )
    
    1391
    +                // We should already have the corresponding key in US layout,
    
    1392
    +                // translated from GTK using XKB, in the event.
    
    1393
    +                long keyCode = event.m_keyCode;
    
    1394
    +
    
    1395
    +                if ( (keyCode >= 'A' && keyCode <= 'Z') ||
    
    1396
    +                        keyCode == '[' ||
    
    1397
    +                        keyCode == '\\' ||
    
    1398
    +                        keyCode == ']' ||
    
    1399
    +                        keyCode == '^' ||
    
    1400
    +                        keyCode == '_' )
    
    1400 1401
                     {
    
    1401 1402
                         // Convert to ASCII control character.
    
    1402
    -                    uniChar &= 0x1f;
    
    1403
    +                    keyCode &= 0x1f;
    
    1403 1404
                     }
    
    1404
    -                else if ( uniChar != ' ' )
    
    1405
    +                else if ( keyCode != ' ' )
    
    1405 1406
                     {
    
    1406 1407
                         // For the printable characters other than Space (for which
    
    1407 1408
                         // we still do generate CHAR event, for compatibility with
    
    ... ... @@ -1413,9 +1414,9 @@ gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget),
    1413 1414
                         break;
    
    1414 1415
                     }
    
    1415 1416
     
    
    1416
    -                eventChar.m_keyCode = uniChar;
    
    1417
    +                eventChar.m_keyCode = keyCode;
    
    1417 1418
     #if wxUSE_UNICODE
    
    1418
    -                eventChar.m_uniChar = uniChar;
    
    1419
    +                eventChar.m_uniChar = keyCode;
    
    1419 1420
     #endif // wxUSE_UNICODE
    
    1420 1421
                 }
    
    1421 1422
                 else // Not a control character.
    

  • src/msw/notebook.cpp
    ... ... @@ -1070,8 +1070,14 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
    1070 1070
                 else if ( parent )
    
    1071 1071
                 {
    
    1072 1072
                     event.SetCurrentFocus(this);
    
    1073
    -                parent->HandleWindowEvent(event);
    
    1074
    -            }
    
    1073
    +                if ( !parent->HandleWindowEvent(event) )
    
    1074
    +                {
    
    1075
    +                    // if the parent didn't handle this event, the notebook
    
    1076
    +                    // must be its only child accepting focus, so take it
    
    1077
    +                    event.Skip(false);
    
    1078
    +                    SetFocus();
    
    1079
    +                }
    
    1080
    +             }
    
    1075 1081
             }
    
    1076 1082
         }
    
    1077 1083
     }
    

  • src/msw/statbmp.cpp
    ... ... @@ -162,8 +162,6 @@ void wxStaticBitmap::Free()
    162 162
     {
    
    163 163
         m_bitmap.UnRef();
    
    164 164
     
    
    165
    -    MSWReplaceImageHandle(0);
    
    166
    -
    
    167 165
         if ( m_ownsCurrentHandle )
    
    168 166
         {
    
    169 167
             ::DeleteObject(m_currentHandle);
    
    ... ... @@ -225,19 +223,6 @@ void wxStaticBitmap::DoPaintManually(wxPaintEvent& WXUNUSED(event))
    225 223
                       true /* use mask */);
    
    226 224
     }
    
    227 225
     
    
    228
    -void wxStaticBitmap::MSWReplaceImageHandle(WXHANDLE handle)
    
    229
    -{
    
    230
    -    HGDIOBJ oldHandle = (HGDIOBJ)::SendMessage(GetHwnd(), STM_SETIMAGE,
    
    231
    -                  m_icon.IsOk() ? IMAGE_ICON : IMAGE_BITMAP, (LPARAM)handle);
    
    232
    -    // detect if this is still the handle we passed before or
    
    233
    -    // if the static-control made a copy of the bitmap!
    
    234
    -    if (oldHandle != 0 && oldHandle != (HGDIOBJ) m_currentHandle)
    
    235
    -    {
    
    236
    -        // the static control made a copy and we are responsible for deleting it
    
    237
    -        ::DeleteObject((HGDIOBJ) oldHandle);
    
    238
    -    }
    
    239
    -}
    
    240
    -
    
    241 226
     void wxStaticBitmap::DoUpdateImage(const wxSize& sizeOld, bool wasIcon)
    
    242 227
     {
    
    243 228
         const wxSize sizeNew = GetImageSize();
    
    ... ... @@ -298,7 +283,31 @@ void wxStaticBitmap::DoUpdateImage(const wxSize& sizeOld, bool wasIcon)
    298 283
                 .TurnOn(isIcon ? SS_ICON : SS_BITMAP);
    
    299 284
         }
    
    300 285
     
    
    301
    -    MSWReplaceImageHandle(m_currentHandle);
    
    286
    +
    
    287
    +    // Update the handle used by the native control.
    
    288
    +    const WPARAM imageType = m_icon.IsOk() ? IMAGE_ICON : IMAGE_BITMAP;
    
    289
    +
    
    290
    +    const HGDIOBJ currentHandle = (HGDIOBJ)m_currentHandle;
    
    291
    +    const HGDIOBJ oldHandle = (HGDIOBJ)
    
    292
    +        ::SendMessage(GetHwnd(), STM_SETIMAGE, imageType, (LPARAM)currentHandle);
    
    293
    +
    
    294
    +    // detect if this is still the handle we passed before or
    
    295
    +    // if the static-control made a copy of the bitmap!
    
    296
    +    if ( oldHandle != 0 && oldHandle != currentHandle )
    
    297
    +    {
    
    298
    +        // the static control made a copy and we are responsible for deleting it
    
    299
    +        ::DeleteObject(oldHandle);
    
    300
    +    }
    
    301
    +
    
    302
    +    // Also check if we need to keep our current handle, it may be unnecessary
    
    303
    +    // if the native control doesn't actually use it.
    
    304
    +    const HGDIOBJ newHandle = (HGDIOBJ)
    
    305
    +        ::SendMessage(GetHwnd(), STM_GETIMAGE, imageType, 0);
    
    306
    +    if ( newHandle != currentHandle )
    
    307
    +    {
    
    308
    +        // The control made a copy of the image and we don't need to keep it.
    
    309
    +        Free();
    
    310
    +    }
    
    302 311
     
    
    303 312
         if ( sizeNew != sizeOld )
    
    304 313
         {
    

  • src/osx/cocoa/filedlg.mm
    ... ... @@ -513,8 +513,12 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
    513 513
             [accView removeFromSuperview];
    
    514 514
             [panel setAccessoryView:accView];
    
    515 515
     
    
    516
    +        // We need to explicitly show the accessory view for "Open" file
    
    517
    +        // dialogs, but doing it for "Save" dialogs is not only unnecessary but
    
    518
    +        // results in an immediate application abort (see #25717).
    
    516 519
             wxCLANG_WARNING_SUPPRESS(undeclared-selector)
    
    517
    -        if ([panel respondsToSelector:@selector(setAccessoryViewDisclosed)])
    
    520
    +        if (!HasFlag(wxFD_SAVE) &&
    
    521
    +                [panel respondsToSelector:@selector(setAccessoryViewDisclosed:)])
    
    518 522
             {
    
    519 523
                 [(id)panel setAccessoryViewDisclosed:YES];
    
    520 524
             }
    

Reply all
Reply to author
Forward
0 new messages