[Git][wxwidgets/wxwidgets][master] 5 commits: Add wxGraphicsMatrix::Translate(wxPoint2DDouble) overload

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
May 31, 2025, 12:59:37 PMMay 31
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 841cdd92
    by Martin Corino at 2025-05-31T16:30:07+02:00
    Add wxGraphicsMatrix::Translate(wxPoint2DDouble) overload
    
    Documentation for this function was added in d137d1e1e0 (Add
    wxGraphicsContext overloads taking wx{Rect,Point}2DDouble, 2025-05-23)
    but it didn't exist -- so add it too now.
    
    Also add documentation for the same overload in wxGraphicsContext, which
    was probably intended to be done in the commit above.
    
    See #25444.
    
    Closes #25473.
    
    Closes #25474.
    
    Co-authored-by: Vadim Zeitlin <va...@wxwidgets.org>
    
  • 3aaa1846
    by Vadim Zeitlin at 2025-05-31T16:38:35+02:00
    Document Windows import libraries to link with
    
    Give the full list of libraries that must be used when using static
    wxWidgets libraries.
    
    See #25471.
    
  • bbb115c0
    by ChipZhang at 2025-05-31T16:42:11+02:00
    Don't include Scintilla libs in wx-config output if wxSTC is off
    
    Don't include wxSTC dependencies in configure output when wxSTC itself
    is disabled as these libraries are not built at all in this case and
    trying to use them results in link errors.
    
    Closes #25475.
    
    Closes #25478.
    
  • daf2b709
    by ChipZhang at 2025-05-31T16:48:47+02:00
    Fix compilation of wxMSW when printing is disabled
    
    Add missing checks for wxUSE_PRINTING_ARCHITECTURE around
    printing-related code.
    
    Closes #25469.
    
    Closes #25480.
    
  • 7f0bc5c1
    by Popax21 at 2025-05-31T17:16:23+02:00
    Fix wxGLCanvasEGL scale under Wayland in high DPI
    
    Ensure that the buffer scale is always the same as the GTK scale factor:
    Previously, wxGLCanvasEGL only set the buffer scale of the wl_surface
    once during the creation of the canvas. However, the GTK widget scale
    factor may change at any time (for example when the window is moved
    across monitors), which results in the EGL window size becoming
    out-of-sync with the surface's buffer scale when the canvas is resized.
    
    Fix this issue by updating the wl_surface buffer size whenever the canvas
    widget is resized.
    
    Closes #23733.
    
    Closes #25465.
    

9 changed files:

Changes:

  • configure
    ... ... @@ -40961,12 +40961,14 @@ $as_echo "$as_me: WARNING: GStreamer not available... disabling wxMediaCtrl" >&2
    40961 40961
     fi
    
    40962 40962
     
    
    40963 40963
     
    
    40964
    -for lib in scintilla lexilla; do
    
    40965
    -    WXCONFIG_STC_LIBS="$WXCONFIG_STC_LIBS -lwx${lib}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
    
    40966
    -done
    
    40964
    +if test "$wxUSE_STC" = "yes" ; then
    
    40965
    +    for lib in scintilla lexilla; do
    
    40966
    +        WXCONFIG_STC_LIBS="$WXCONFIG_STC_LIBS -lwx${lib}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
    
    40967
    +    done
    
    40967 40968
     
    
    40968
    -if test "$wxUSE_MSW" = 1 ; then
    
    40969
    -    EXTRALIBS_STC="-limm32"
    
    40969
    +    if test "$wxUSE_MSW" = 1 ; then
    
    40970
    +        EXTRALIBS_STC="-limm32"
    
    40971
    +    fi
    
    40970 40972
     fi
    
    40971 40973
     
    
    40972 40974
     
    

  • configure.ac
    ... ... @@ -7536,12 +7536,14 @@ dnl ---------------------------------------------------------------------------
    7536 7536
     dnl wxStyledTextCtrl
    
    7537 7537
     dnl ---------------------------------------------------------------------------
    
    7538 7538
     
    
    7539
    -for lib in scintilla lexilla; do
    
    7540
    -    WXCONFIG_STC_LIBS="$WXCONFIG_STC_LIBS -lwx${lib}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
    
    7541
    -done
    
    7539
    +if test "$wxUSE_STC" = "yes" ; then
    
    7540
    +    for lib in scintilla lexilla; do
    
    7541
    +        WXCONFIG_STC_LIBS="$WXCONFIG_STC_LIBS -lwx${lib}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
    
    7542
    +    done
    
    7542 7543
     
    
    7543
    -if test "$wxUSE_MSW" = 1 ; then
    
    7544
    -    EXTRALIBS_STC="-limm32"
    
    7544
    +    if test "$wxUSE_MSW" = 1 ; then
    
    7545
    +        EXTRALIBS_STC="-limm32"
    
    7546
    +    fi
    
    7545 7547
     fi
    
    7546 7548
     
    
    7547 7549
     dnl ---------------------------------------------------------------------------
    

  • docs/changes.txt
    ... ... @@ -393,6 +393,7 @@ wxGTK:
    393 393
     - Fix handling of binary secrets in wxSecretStore (Martin Corino, #24352).
    
    394 394
     - Fix handling total window size with GNOME with X11 (#25348).
    
    395 395
     - Fix missing enter/leave window events (#24339).
    
    396
    +- Fix wxGLCanvas scale when using EGL/Wayland in high DPI (Popax21, #23733).
    
    396 397
     - Fix using wrong colour in wxPrinterDC (#24729).
    
    397 398
     - Fix wxKeyEvent::GetKeyCode() in non-US layouts (Ivan Sorokin, #23379).
    
    398 399
     - Implement generation of wxDPIChangedEvent (#19290, #24040).
    

  • docs/msw/install.md
    ... ... @@ -497,7 +497,12 @@ MSVC, you also need to:
    497 497
       wxbase34ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib
    
    498 498
       wxexpatd.lib` for a debug build of an application using the core library of
    
    499 499
       wxWidgets 3.4 only (all wxWidgets applications use the base library).
    
    500
    -
    
    500
    +* When using static wxWidgets libraries, i.e. `WXUSINGDLL` is _not_ defined,
    
    501
    +  also add the list of Windows libraries to link with, which currently includes
    
    502
    +  the following libraries (some of which might be unnecessary depending on your
    
    503
    +  build configuration): `advapi32 comctl32 comdlg32 gdi32 gdiplus kernel32
    
    504
    +  msimg32 ole32 oleacc oleaut32 rpcrt4 shell32 shlwapi user32 uuid uxtheme
    
    505
    +  version wininet winmm winspool ws2_32`.
    
    501 506
     
    
    502 507
     For example, to compile your program with gcc using debug wxWidgets DLLs
    
    503 508
     you would need to use the following options for the compiler (and `windres`
    

  • include/wx/graphics.h
    ... ... @@ -238,6 +238,11 @@ public:
    238 238
         // add the translation to this matrix
    
    239 239
         virtual void Translate( wxDouble dx , wxDouble dy );
    
    240 240
     
    
    241
    +    void Translate(const wxPoint2DDouble& pt)
    
    242
    +    {
    
    243
    +        Translate(pt.m_x, pt.m_y);
    
    244
    +    }
    
    245
    +
    
    241 246
         // add the scale to this matrix
    
    242 247
         virtual void Scale( wxDouble xScale , wxDouble yScale );
    
    243 248
     
    

  • include/wx/unix/glegl.h
    ... ... @@ -148,6 +148,7 @@ private:
    148 148
         static EGLConfig ms_glEGLConfig;
    
    149 149
     
    
    150 150
         friend void wxEGLUpdatePosition(wxGLCanvasEGL* win);
    
    151
    +    friend void wxEGLSetScale(wxGLCanvasEGL* win, int scale);
    
    151 152
     };
    
    152 153
     
    
    153 154
     // ----------------------------------------------------------------------------
    

  • interface/wx/graphics.h
    ... ... @@ -753,6 +753,13 @@ public:
    753 753
         */
    
    754 754
         virtual void Translate(wxDouble dx, wxDouble dy) = 0;
    
    755 755
     
    
    756
    +    /**
    
    757
    +        @overload
    
    758
    +
    
    759
    +        @since 3.3.0
    
    760
    +    */
    
    761
    +    void Translate(const wxPoint2DDouble& pt);
    
    762
    +
    
    756 763
         /** @}
    
    757 764
         */
    
    758 765
     
    

  • src/msw/window.cpp
    ... ... @@ -125,10 +125,10 @@
    125 125
     // global variables
    
    126 126
     // ---------------------------------------------------------------------------
    
    127 127
     
    
    128
    -#ifndef __WXUNIVERSAL__
    
    128
    +#if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
    
    129 129
     // This variable is defined in src/msw/printdlg.cpp.
    
    130 130
     extern bool wxPrinterDialogShown;
    
    131
    -#endif // !__WXUNIVERSAL__
    
    131
    +#endif // wxUSE_PRINTING_ARCHITECTURE
    
    132 132
     
    
    133 133
     #if wxUSE_MENUS_NATIVE
    
    134 134
     extern wxMenu *wxCurrentPopupMenu;
    
    ... ... @@ -4405,14 +4405,14 @@ bool wxWindowMSW::HandleActivate(int state,
    4405 4405
             return false;
    
    4406 4406
         }
    
    4407 4407
     
    
    4408
    -#ifndef __WXUNIVERSAL__
    
    4408
    +#if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
    
    4409 4409
         if ( wxPrinterDialogShown )
    
    4410 4410
         {
    
    4411 4411
             // Finally, there is a weird case of WM_ACTIVATE synthesized by the
    
    4412 4412
             // native print dialog, see the code in src/msw/printdlg.cpp.
    
    4413 4413
             return false;
    
    4414 4414
         }
    
    4415
    -#endif // !__WXUNIVERSAL__
    
    4415
    +#endif // wxUSE_PRINTING_ARCHITECTURE
    
    4416 4416
     
    
    4417 4417
         wxActivateEvent event(wxEVT_ACTIVATE,
    
    4418 4418
                               (state == WA_ACTIVE) || (state == WA_CLICKACTIVE),
    

  • src/unix/glegl.cpp
    ... ... @@ -430,6 +430,12 @@ void wxEGLUpdatePosition(wxGLCanvasEGL* win)
    430 430
         wl_subsurface_set_position(win->m_wlSubsurface, x, y);
    
    431 431
     }
    
    432 432
     
    
    433
    +// Helper declared as friend in the header and so can access m_wlSurface.
    
    434
    +void wxEGLSetScale(wxGLCanvasEGL* win, int scale)
    
    435
    +{
    
    436
    +    wl_surface_set_buffer_scale(win->m_wlSurface, scale);
    
    437
    +}
    
    438
    +
    
    433 439
     extern "C"
    
    434 440
     {
    
    435 441
     
    
    ... ... @@ -490,6 +496,7 @@ static void gtk_glcanvas_size_callback(GtkWidget *widget,
    490 496
                              win->m_height * scale, 0, 0);
    
    491 497
     
    
    492 498
         wxEGLUpdatePosition(win);
    
    499
    +    wxEGLSetScale(win, scale);
    
    493 500
     }
    
    494 501
     
    
    495 502
     } // extern "C"
    

Reply all
Reply to author
Forward
0 new messages