[Git][wxwidgets/wxwidgets][3.2] 10 commits: Always automatically define WX_PRECOMP for MSVC when not disabled

2 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Jul 8, 2024, 9:02:25 AMJul 8
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch 3.2 at wxWidgets / wxWidgets

Commits:

  • 1e8a937f
    by Maarten Bent at 2024-06-22T15:58:58+02:00
    Always automatically define WX_PRECOMP for MSVC when not disabled
    
    Configure builds were excluded, but this would also exclude CMake
    because it uses the same __WX_SETUP_H__ define.
    
    This was done back in 248eaddf7a when there were more Windows compilers,
    of which some probably used configure. But over time he check has been
    reduced to only __VISUALC__ which isn't used with configure. So there is
    no reason to keep this check.
    
    See #24353, #24632.
    
    (cherry picked from commit 4d6bcd833fdd8580582469fe264740a45b9a4193)
    
  • 4f1b3ae5
    by Bill Su at 2024-07-04T01:19:07+02:00
    Make wxWindow::PopupMenu() call wxMenu::UpdateUI()
    
    This ensures that the state of the menu items corresponds to the state
    set by wxEVT_UPDATE_UI handlers.
    
    See #24641, #24642.
    
    (cherry picked from commit f01e1a97d11fa2d57649bedaddc60a06f796409b)
    
  • 4f9b5445
    by Tobias Taschner at 2024-07-04T01:19:55+02:00
    Include macOS 15 name in wxGetOsDescription()
    
    Recognize the latest macOS version too.
    
    See #24647.
    
    (cherry picked from commit d9e332b8cc38617a62d901ea9c00408b852d4161)
    
  • 7712b0ce
    by PB at 2024-07-04T01:20:10+02:00
    Update the Windows versions table in wxGetOsVersion() docs
    
    Update Windows Server information.
    
    Additionally, add a note to wxGetOsDescription() source to
    keep the table in docs in the sync with the code.
    
    See #24653.
    
    (cherry picked from commit 73e28e2b6534b64805bd2a56dab92ca38e171696)
    
  • abe197df
    by Alex Contreras at 2024-07-08T00:14:09+02:00
    Improve precision of wxScrollBar position in wxOSX
    
    Use doubleValue instead of floatValue when retrieving scrollbar position
    for consistency with setDoubleValue: used when setting it.
    
    This avoids problems due to rounding that could result in noticeable
    effects when using wxListCtrl with many (millions of) items.
    
    See #24669, #24670.
    
    (cherry picked from commit ec77927803af0e952a2bf93c37f6e51c5a31e869)
    
  • d41ca482
    by Stefan Csomor at 2024-07-08T00:19:03+02:00
    Fix regression with not accepting keyboard focus in wxOSX
    
    Support keyboard focus even when NSClipView has to be used, fixing
    multiple problems which resulted due to not taking focus before, notably
    in wxListCtrl and wxTreeCtrl.
    
    See #24605, #24667, #24678.
    
    (cherry picked from commit fbf4ac52d80d06c523a0a7aad6d1dc369980619c)
    
  • 18b2f9c1
    by Alex Contreras at 2024-07-08T00:21:41+02:00
    Update macos-11 runners to macos-12
    
    Github has deprecated macos-11 runners; update to use the oldest
    supported runners for CI
    
    See #24684.
    
    (cherry picked from commit e0509604d4675137f5e7cc64d9be58f3bba94ef8)
    
  • 816f2854
    by Vadim Zeitlin at 2024-07-08T00:22:03+02:00
    Update configure CI jobs to use macOS 12 runners too
    
    See #24684.
    
    (cherry picked from commit 3dcec41ed391d08db447cfa1527d8f9709607019)
    
  • 0bcf3e41
    by Vadim Zeitlin at 2024-07-08T00:50:06+02:00
    Try to work around not being able to use Ubuntu 18.04 any more
    
    Set the magic environment variable supposed to allow to still use Node
    12 for now.
    
    (cherry picked from commit 40432a2d0ad97d55d01ab793e53be0ea70a40809)
    
  • 0787d62f
    by Vadim Zeitlin at 2024-07-08T15:01:11+02:00
    Fix crash when handling diagonal scroll events in wxOSX
    
    Commit a0b4c5f14b (Generate correct events for diagonal trackpad
    scrolling under Mac, 2024-06-09) introduced a crash due to the use of a
    reference which became dangling after resizing the vector, which could
    result in a reallocation.
    
    Fix this by replacing the reference with a pointer and resetting this
    pointer after resize.
    
    See #24516, #24601, #24649.
    
    (cherry picked from commit 35040847c208682ec3d0cac559c06329446573fc)
    

11 changed files:

Changes:

  • .github/workflows/ci.yml
    ... ... @@ -129,6 +129,7 @@ jobs:
    129 129
           wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }}
    
    130 130
           wxUSE_ASAN: ${{ matrix.use_asan && 1 || 0 }}
    
    131 131
           wxUSE_XVFB: ${{ matrix.use_xvfb && 1 || 0 }}
    
    132
    +      ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
    
    132 133
     
    
    133 134
         steps:
    
    134 135
           - name: Set up build system
    

  • .github/workflows/ci_cmake.yml
    ... ... @@ -59,12 +59,12 @@ jobs:
    59 59
                 runner: ubuntu-22.04
    
    60 60
                 cmake_generator: Unix Makefiles
    
    61 61
                 cmake_samples: ALL
    
    62
    -          - name: macOS 11 wxOSX
    
    63
    -            runner: macos-11
    
    62
    +          - name: macOS 12 wxOSX
    
    63
    +            runner: macos-12
    
    64 64
                 cmake_generator: Xcode
    
    65 65
                 cmake_defines: -DCMAKE_CXX_STANDARD=11
    
    66
    -          - name: macOS 11 wxIOS
    
    67
    -            runner: macos-11
    
    66
    +          - name: macOS 12 wxIOS
    
    67
    +            runner: macos-12
    
    68 68
                 cmake_generator: Xcode
    
    69 69
                 cmake_defines: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_FIND_ROOT_PATH=/usr/local -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
    
    70 70
                 cmake_samples: OFF
    

  • .github/workflows/ci_mac.yml
    ... ... @@ -99,12 +99,12 @@ jobs:
    99 99
               runner: self-hosted
    
    100 100
               arch: arm64
    
    101 101
               configure_flags: --with-cxx=14 --enable-universal_binary=arm64,x86_64 --disable-shared --disable-debug --enable-optimise
    
    102
    -        - name: wxMac macOS 11
    
    103
    -          runner: macos-11
    
    102
    +        - name: wxMac macOS 12
    
    103
    +          runner: macos-12
    
    104 104
               arch: x86_64
    
    105 105
               configure_flags: --disable-sys-libs
    
    106 106
             - name: wxiOS
    
    107
    -          runner: macos-11
    
    107
    +          runner: macos-12
    
    108 108
               arch: x86_64
    
    109 109
               configure_flags: --with-osx_iphone --enable-monolithic  --disable-sys-libs --host=i686-apple-darwin_sim --build=x86_64-apple-darwin17.7.0
    
    110 110
               xcode_sdk: iphonesimulator
    

  • docs/changes.txt
    ... ... @@ -270,12 +270,15 @@ wxGTK:
    270 270
     wxMSW:
    
    271 271
     
    
    272 272
     - More Windows Server versions in wxGetOsDescription() (PB, #24598, #24603).
    
    273
    +- Fix using wx/wxprec.h with vcpkg (Maarten Bent, #24353, #24632).
    
    273 274
     
    
    274 275
     wxOSX:
    
    275 276
     
    
    277
    +- Fix regression with not accepting focus under macOS 14+ (#24605, #24667).
    
    276 278
     - Improve wxSlider ticks appearance (Hartwig Wiesmann, #24532).
    
    277 279
     - Fix wrong wxSlider label in some cases (Hartwig Wiesmann, #24539).
    
    278 280
     - Fix handling diagonal scrolling when using trackpad (#24516).
    
    281
    +- Improve wxScrollBar precision (Alex Contreras, #24669).
    
    279 282
     
    
    280 283
     
    
    281 284
     3.2.5: (released 2024-05-14)
    
    ... ... @@ -310,6 +313,7 @@ All (GUI):
    310 313
     - Make text in wxGenericMessageDialog more readable (Jeff Young, #24412).
    
    311 314
     - Fix handling non-square bitmaps in wxBitmapBundle (#24433, #24434).
    
    312 315
     - Add wxTE_PROCESS_ENTER to wxSpinCtrl[Double] XRC handlers (JohnKnow, #24481).
    
    316
    +- Update popup menu UI before showing it (Bill Su, #24641).
    
    313 317
     
    
    314 318
     wxGTK:
    
    315 319
     
    
    ... ... @@ -354,6 +358,7 @@ wxOSX:
    354 358
     - Fix translations when using zh-Hans-CN locale (#24396).
    
    355 359
     - Add filters support to wxFileDialog::ShowWindowModal() (Gammasoft, #24438).
    
    356 360
     - Fix installation on some Apple Silicon Macs (Thomas Holder, #23143, #24524).
    
    361
    +- Recognize macOS 15 Sequoia in wxGetOsDescription() (Tobias Taschner, #24647).
    
    357 362
     
    
    358 363
     wxQt:
    
    359 364
     
    

  • include/wx/wxprec.h
    ... ... @@ -11,14 +11,10 @@
    11 11
     // compiler detection; includes setup.h
    
    12 12
     #include "wx/defs.h"
    
    13 13
     
    
    14
    -// check if to use precompiled headers: do it for most Windows compilers unless
    
    15
    -// explicitly disabled by defining NOPCH
    
    16
    -#if defined(__VISUALC__)
    
    17
    -    // If user did not request NOCPH and we're not building using configure
    
    18
    -    // then assume user wants precompiled headers.
    
    19
    -    #if !defined(NOPCH) && !defined(__WX_SETUP_H__)
    
    20
    -        #define WX_PRECOMP
    
    21
    -    #endif
    
    14
    +// check if to use precompiled headers: do it for MSVC unless explicitly
    
    15
    +// disabled by defining NOPCH
    
    16
    +#if !defined(WX_PRECOMP) && defined(__VISUALC__) && !defined(NOPCH)
    
    17
    +    #define WX_PRECOMP
    
    22 18
     #endif
    
    23 19
     
    
    24 20
     #ifdef WX_PRECOMP
    

  • interface/wx/utils.h
    ... ... @@ -962,13 +962,13 @@ wxString wxGetOsDescription();
    962 962
                 <td>Windows 11</td>
    
    963 963
                 <td>10</td>
    
    964 964
                 <td>0</td>
    
    965
    -            <td>&gt;= 22000</td>
    
    965
    +            <td>&ge; 22000</td>
    
    966 966
             </tr>
    
    967 967
             <tr>
    
    968 968
                 <td>Windows Server 2022</td>
    
    969 969
                 <td>10</td>
    
    970 970
                 <td>0</td>
    
    971
    -            <td>&gt;= 22000</td>
    
    971
    +            <td>20348</td>
    
    972 972
             </tr>
    
    973 973
             <tr>
    
    974 974
                 <td>Windows 10</td>
    
    ... ... @@ -976,11 +976,17 @@ wxString wxGetOsDescription();
    976 976
                 <td>0</td>
    
    977 977
                 <td></td>
    
    978 978
             </tr>
    
    979
    +        <tr>
    
    980
    +            <td>Windows Server 2019</td>
    
    981
    +            <td>10</td>
    
    982
    +            <td>0</td>
    
    983
    +            <td>17763</td>
    
    984
    +        </tr>
    
    979 985
             <tr>
    
    980 986
                 <td>Windows Server 2016</td>
    
    981 987
                 <td>10</td>
    
    982 988
                 <td>0</td>
    
    983
    -            <td></td>
    
    989
    +            <td>14393</td>
    
    984 990
             </tr>
    
    985 991
             <tr>
    
    986 992
                 <td>Windows 8.1</td>
    
    ... ... @@ -1049,7 +1055,7 @@ wxString wxGetOsDescription();
    1049 1055
                 <td></td>
    
    1050 1056
             </tr>
    
    1051 1057
         </table>
    
    1052
    -    See the <a href="http://msdn.microsoft.com/en-us/library/ms724832(VS.85).aspx">MSDN</a>
    
    1058
    +    See the <a href="https://learn.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version">Microsoft documentation</a>
    
    1053 1059
         for more info about the values above.
    
    1054 1060
     
    
    1055 1061
         @see wxGetOsDescription(), wxPlatformInfo
    

  • src/common/wincmn.cpp
    ... ... @@ -3071,6 +3071,7 @@ bool wxWindowBase::PopupMenu(wxMenu *menu, int x, int y)
    3071 3071
             setInvokingWin(*menu, static_cast<wxWindow *>(this));
    
    3072 3072
     
    
    3073 3073
         wxCurrentPopupMenu = menu;
    
    3074
    +    menu->UpdateUI();
    
    3074 3075
         const bool rc = DoPopupMenu(menu, x, y);
    
    3075 3076
         wxCurrentPopupMenu = NULL;
    
    3076 3077
     
    

  • src/msw/utils.cpp
    ... ... @@ -1107,6 +1107,7 @@ static const int FIRST_WINDOWS11_BUILD = 22000;
    1107 1107
     
    
    1108 1108
     } // anonymous namespace
    
    1109 1109
     
    
    1110
    +// When adding a new version, update also the table in wxGetOsVersion() docs.
    
    1110 1111
     wxString wxGetOsDescription()
    
    1111 1112
     {
    
    1112 1113
         wxString str;
    

  • src/osx/cocoa/scrolbar.mm
    ... ... @@ -63,7 +63,7 @@ public :
    63 63
     
    
    64 64
         virtual wxInt32 GetValue() const wxOVERRIDE
    
    65 65
         {
    
    66
    -        return wxRound([(wxNSScroller*) m_osxView floatValue] * m_maximum);
    
    66
    +        return wxRound([(wxNSScroller*) m_osxView doubleValue] * m_maximum);
    
    67 67
         }
    
    68 68
     
    
    69 69
         virtual wxInt32 GetMaximum() const wxOVERRIDE
    

  • src/osx/cocoa/utils_base.mm
    ... ... @@ -113,6 +113,9 @@ wxString wxGetOsDescription()
    113 113
                 case 14:
    
    114 114
                     osName = "Sonoma";
    
    115 115
                     break;
    
    116
    +            case 15:
    
    117
    +                osName = "Sequoia";
    
    118
    +                break;
    
    116 119
             }
    
    117 120
         }
    
    118 121
     #else
    

  • src/osx/cocoa/window.mm
    ... ... @@ -598,22 +598,25 @@ wxWidgetCocoaImpl::MouseEvents
    598 598
     wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent )
    
    599 599
     {
    
    600 600
         MouseEvents wxevents(1);
    
    601
    -    auto& wxevent = wxevents.front();
    
    601
    +
    
    602
    +    // This pointer may be invalidated by resizing the vector and has to be
    
    603
    +    // reset in this case.
    
    604
    +    wxMouseEvent* wxevent = &wxevents.front();
    
    602 605
     
    
    603 606
         int eventType = [nsEvent type];
    
    604 607
         UInt32 modifiers = [nsEvent modifierFlags] ;
    
    605 608
         
    
    606
    -    SetupCoordinates(wxevent.m_x, wxevent.m_y, nsEvent);
    
    609
    +    SetupCoordinates(wxevent->m_x, wxevent->m_y, nsEvent);
    
    607 610
     
    
    608 611
         // these parameters are not given for all events
    
    609 612
         UInt32 button = [nsEvent buttonNumber];
    
    610 613
         UInt32 clickCount = 0;
    
    611 614
     
    
    612
    -    wxevent.m_shiftDown = modifiers & NSShiftKeyMask;
    
    613
    -    wxevent.m_rawControlDown = modifiers & NSControlKeyMask;
    
    614
    -    wxevent.m_altDown = modifiers & NSAlternateKeyMask;
    
    615
    -    wxevent.m_controlDown = modifiers & NSCommandKeyMask;
    
    616
    -    wxevent.SetTimestamp( (int)([nsEvent timestamp] * 1000) ) ;
    
    615
    +    wxevent->m_shiftDown = modifiers & NSShiftKeyMask;
    
    616
    +    wxevent->m_rawControlDown = modifiers & NSControlKeyMask;
    
    617
    +    wxevent->m_altDown = modifiers & NSAlternateKeyMask;
    
    618
    +    wxevent->m_controlDown = modifiers & NSCommandKeyMask;
    
    619
    +    wxevent->SetTimestamp( (int)([nsEvent timestamp] * 1000) ) ;
    
    617 620
     
    
    618 621
         UInt32 mouseChord = 0;
    
    619 622
     
    
    ... ... @@ -688,21 +691,21 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent )
    688 691
             mouseChord = ((mouseChord & ~1U) | 2U);
    
    689 692
     
    
    690 693
         if(mouseChord & 1U)
    
    691
    -                wxevent.m_leftDown = true ;
    
    694
    +                wxevent->m_leftDown = true ;
    
    692 695
         if(mouseChord & 2U)
    
    693
    -                wxevent.m_rightDown = true ;
    
    696
    +                wxevent->m_rightDown = true ;
    
    694 697
         if(mouseChord & 4U)
    
    695 698
         {
    
    696 699
             switch ( button )
    
    697 700
             {
    
    698 701
                 default:
    
    699
    -                wxevent.m_middleDown = true ;
    
    702
    +                wxevent->m_middleDown = true ;
    
    700 703
                     break;
    
    701 704
                 case 3:
    
    702
    -                wxevent.m_aux1Down = true ;
    
    705
    +                wxevent->m_aux1Down = true ;
    
    703 706
                     break;
    
    704 707
                 case 4:
    
    705
    -                wxevent.m_aux2Down = true ;
    
    708
    +                wxevent->m_aux2Down = true ;
    
    706 709
                     break;
    
    707 710
             }
    
    708 711
         }
    
    ... ... @@ -716,23 +719,23 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent )
    716 719
                 switch ( button )
    
    717 720
                 {
    
    718 721
                     case 0 :
    
    719
    -                    wxevent.SetEventType( clickCount > 1 ? wxEVT_LEFT_DCLICK : wxEVT_LEFT_DOWN )  ;
    
    722
    +                    wxevent->SetEventType( clickCount > 1 ? wxEVT_LEFT_DCLICK : wxEVT_LEFT_DOWN )  ;
    
    720 723
                         break ;
    
    721 724
     
    
    722 725
                     case 1 :
    
    723
    -                    wxevent.SetEventType( clickCount > 1 ? wxEVT_RIGHT_DCLICK : wxEVT_RIGHT_DOWN ) ;
    
    726
    +                    wxevent->SetEventType( clickCount > 1 ? wxEVT_RIGHT_DCLICK : wxEVT_RIGHT_DOWN ) ;
    
    724 727
                         break ;
    
    725 728
     
    
    726 729
                     case 2 :
    
    727
    -                    wxevent.SetEventType( clickCount > 1 ? wxEVT_MIDDLE_DCLICK : wxEVT_MIDDLE_DOWN ) ;
    
    730
    +                    wxevent->SetEventType( clickCount > 1 ? wxEVT_MIDDLE_DCLICK : wxEVT_MIDDLE_DOWN ) ;
    
    728 731
                         break ;
    
    729 732
     
    
    730 733
                     case 3 :
    
    731
    -                    wxevent.SetEventType( clickCount > 1 ? wxEVT_AUX1_DCLICK : wxEVT_AUX1_DOWN ) ;
    
    734
    +                    wxevent->SetEventType( clickCount > 1 ? wxEVT_AUX1_DCLICK : wxEVT_AUX1_DOWN ) ;
    
    732 735
                         break ;
    
    733 736
     
    
    734 737
                     case 4 :
    
    735
    -                    wxevent.SetEventType( clickCount > 1 ? wxEVT_AUX2_DCLICK : wxEVT_AUX2_DOWN ) ;
    
    738
    +                    wxevent->SetEventType( clickCount > 1 ? wxEVT_AUX2_DCLICK : wxEVT_AUX2_DOWN ) ;
    
    736 739
                         break ;
    
    737 740
     
    
    738 741
                     default:
    
    ... ... @@ -746,23 +749,23 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent )
    746 749
                 switch ( button )
    
    747 750
                 {
    
    748 751
                     case 0 :
    
    749
    -                    wxevent.SetEventType( wxEVT_LEFT_UP )  ;
    
    752
    +                    wxevent->SetEventType( wxEVT_LEFT_UP )  ;
    
    750 753
                         break ;
    
    751 754
     
    
    752 755
                     case 1 :
    
    753
    -                    wxevent.SetEventType( wxEVT_RIGHT_UP ) ;
    
    756
    +                    wxevent->SetEventType( wxEVT_RIGHT_UP ) ;
    
    754 757
                         break ;
    
    755 758
     
    
    756 759
                     case 2 :
    
    757
    -                    wxevent.SetEventType( wxEVT_MIDDLE_UP ) ;
    
    760
    +                    wxevent->SetEventType( wxEVT_MIDDLE_UP ) ;
    
    758 761
                         break ;
    
    759 762
     
    
    760 763
                     case 3 :
    
    761
    -                    wxevent.SetEventType( wxEVT_AUX1_UP ) ;
    
    764
    +                    wxevent->SetEventType( wxEVT_AUX1_UP ) ;
    
    762 765
                         break ;
    
    763 766
     
    
    764 767
                     case 4 :
    
    765
    -                    wxevent.SetEventType( wxEVT_AUX2_UP ) ;
    
    768
    +                    wxevent->SetEventType( wxEVT_AUX2_UP ) ;
    
    766 769
                         break ;
    
    767 770
     
    
    768 771
                     default:
    
    ... ... @@ -775,7 +778,7 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent )
    775 778
                 float deltaX = 0.0;
    
    776 779
                 float deltaY = 0.0;
    
    777 780
     
    
    778
    -            wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
    
    781
    +            wxevent->SetEventType( wxEVT_MOUSEWHEEL ) ;
    
    779 782
     
    
    780 783
                 if ( [nsEvent hasPreciseScrollingDeltas] )
    
    781 784
                 {
    
    ... ... @@ -788,25 +791,29 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent )
    788 791
                     deltaY = [nsEvent scrollingDeltaY] * 10;
    
    789 792
                 }
    
    790 793
                 
    
    791
    -            wxevent.m_wheelDelta = 10;
    
    792
    -            wxevent.m_wheelInverted = [nsEvent isDirectionInvertedFromDevice];
    
    793
    -            wxevent.m_linesPerAction = 1;
    
    794
    -            wxevent.m_columnsPerAction = 1;
    
    794
    +            wxevent->m_wheelDelta = 10;
    
    795
    +            wxevent->m_wheelInverted = [nsEvent isDirectionInvertedFromDevice];
    
    796
    +            wxevent->m_linesPerAction = 1;
    
    797
    +            wxevent->m_columnsPerAction = 1;
    
    795 798
     
    
    796 799
                 // Should we impose some minimum threshold here?
    
    797 800
                 if ( deltaY != 0 )
    
    798 801
                 {
    
    799
    -                wxevent.m_wheelRotation = (int)deltaY;
    
    802
    +                wxevent->m_wheelRotation = (int)deltaY;
    
    800 803
                 }
    
    801 804
     
    
    802 805
                 if ( deltaX != 0 )
    
    803 806
                 {
    
    804 807
                     // We can send one or two events depending on whether we have
    
    805 808
                     // delta in just one or both directions.
    
    806
    -                wxMouseEvent* wxeventPtr = &wxevent;
    
    809
    +                wxMouseEvent* wxeventPtr = wxevent;
    
    807 810
                     if ( deltaY != 0 )
    
    808 811
                     {
    
    809
    -                    wxevents.push_back(wxevent);
    
    812
    +                    wxevents.push_back(*wxevent);
    
    813
    +
    
    814
    +                    // The push above could have invalidated the pointer, so
    
    815
    +                    // reset it to still point to the first element.
    
    816
    +                    wxevent = &wxevents.front();
    
    810 817
                         wxeventPtr = &wxevents.back();
    
    811 818
                     }
    
    812 819
     
    
    ... ... @@ -821,33 +828,33 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent )
    821 828
             break ;
    
    822 829
     
    
    823 830
             case NSMouseEntered :
    
    824
    -            wxevent.SetEventType( wxEVT_ENTER_WINDOW ) ;
    
    831
    +            wxevent->SetEventType( wxEVT_ENTER_WINDOW ) ;
    
    825 832
                 break;
    
    826 833
             case NSMouseExited :
    
    827
    -            wxevent.SetEventType( wxEVT_LEAVE_WINDOW ) ;
    
    834
    +            wxevent->SetEventType( wxEVT_LEAVE_WINDOW ) ;
    
    828 835
                 break;
    
    829 836
             case NSLeftMouseDragged :
    
    830 837
             case NSRightMouseDragged :
    
    831 838
             case NSOtherMouseDragged :
    
    832 839
             case NSMouseMoved :
    
    833
    -            wxevent.SetEventType( wxEVT_MOTION ) ;
    
    840
    +            wxevent->SetEventType( wxEVT_MOTION ) ;
    
    834 841
                 break;
    
    835 842
             
    
    836 843
             case NSEventTypeMagnify:
    
    837
    -            wxevent.SetEventType( wxEVT_MAGNIFY );
    
    838
    -            wxevent.m_magnification = [nsEvent magnification];
    
    844
    +            wxevent->SetEventType( wxEVT_MAGNIFY );
    
    845
    +            wxevent->m_magnification = [nsEvent magnification];
    
    839 846
                 break;
    
    840 847
                 
    
    841 848
             default :
    
    842 849
                 break ;
    
    843 850
         }
    
    844 851
     
    
    845
    -    wxevent.m_clickCount = clickCount;
    
    852
    +    wxevent->m_clickCount = clickCount;
    
    846 853
         wxWindowMac* peer = GetWXPeer();
    
    847 854
         if ( peer )
    
    848 855
         {
    
    849
    -        wxevent.SetEventObject(peer);
    
    850
    -        wxevent.SetId(peer->GetId()) ;
    
    856
    +        wxevent->SetEventObject(peer);
    
    857
    +        wxevent->SetId(peer->GetId()) ;
    
    851 858
         }
    
    852 859
     
    
    853 860
         return wxevents;
    
    ... ... @@ -3249,6 +3256,21 @@ bool wxWidgetCocoaImpl::CanFocus() const
    3249 3256
     
    
    3250 3257
     @implementation wxNSClipView
    
    3251 3258
     
    
    3259
    ++ (void)initialize
    
    3260
    +{
    
    3261
    +    static BOOL initialized = NO;
    
    3262
    +    if (!initialized)
    
    3263
    +    {
    
    3264
    +        initialized = YES;
    
    3265
    +        wxOSXCocoaClassAddWXMethods( self, wxOSXSKIP_DRAW);
    
    3266
    +    }
    
    3267
    +}
    
    3268
    +
    
    3269
    +- (BOOL) needsPanelToBecomeKey
    
    3270
    +{
    
    3271
    +    return YES;
    
    3272
    +}
    
    3273
    +
    
    3252 3274
     #if wxOSX_USE_NATIVE_FLIPPED
    
    3253 3275
     - (BOOL)isFlipped
    
    3254 3276
     {
    
    ... ... @@ -4129,6 +4151,8 @@ void wxWidgetCocoaImpl::UseClippingView(bool clip)
    4129 4151
                 [(NSClipView*)m_osxClipView setDrawsBackground: NO];
    
    4130 4152
                 [m_osxView addSubview:m_osxClipView];
    
    4131 4153
     
    
    4154
    +            wxWidgetImpl::Associate( m_osxClipView, this ) ;
    
    4155
    +
    
    4132 4156
                 // TODO check for additional subwindows which might have to be moved to the clip view ?
    
    4133 4157
             }
    
    4134 4158
         }
    


View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help

Reply all
Reply to author
Forward
0 new messages