Fix wxRendererXP::DrawItemText() selected text color in dark mode Use appropriate theme in dark mode to get the correct result from GetColour(LVP_LISTITEM, TMT_TEXTCOLOR, LISS_SELECTED). Closes #26399.
Fix creating wxGLCanvas when using EGL 1.4 with X11 The changes of 602b80d (Support EGL 1.4 instead of previously required 1.5, 2025-11-23) were wrong for X11 because eglCreateWindowSurface(), used as the fallback when newer EGL functions are not available, requires passing it the actual X11 Window (i.e. an XID) rather than a pointer to it. Fix this by passing both the XID and a pointer to it to this function and calling the different functions with the appropriate parameter. Note that we still need to pass wl_egl_window pointer to this function when using Wayland and we need to pass a pointer to XID when using newer EGL functions. Closes #26410.
| ... | ... | @@ -106,9 +106,26 @@ private: |
| 106 | 106 | // fall back on eglCreateWindowSurface() otherwise.
|
| 107 | 107 | //
|
| 108 | 108 | // This function uses m_display and m_config which must be initialized
|
| 109 | - // before using it and should be passed either m_xwindow or m_wlEGLWindow
|
|
| 110 | - // depending on whether we are using X11 or Wayland.
|
|
| 111 | - EGLSurface CallCreatePlatformWindowSurface(void *window) const;
|
|
| 109 | + // before using it.
|
|
| 110 | + //
|
|
| 111 | + // Window parameter is passed twice because some of the functions above
|
|
| 112 | + // take it by value while others take it by pointer and this depends on
|
|
| 113 | + // whether we use X11 or Wayland. Use wrappers below taking correct window
|
|
| 114 | + // type instead of calling this function directly.
|
|
| 115 | + EGLSurface
|
|
| 116 | + DoCallCreatePlatformWindowSurface(wxUIntPtr windowID, void* windowPtr) const;
|
|
| 117 | + |
|
| 118 | + // This one is for X11.
|
|
| 119 | + EGLSurface CallCreatePlatformWindowSurface(wxUIntPtr xwindow) const
|
|
| 120 | + {
|
|
| 121 | + return DoCallCreatePlatformWindowSurface(xwindow, &xwindow);
|
|
| 122 | + }
|
|
| 123 | + |
|
| 124 | + // And this one is for Wayland.
|
|
| 125 | + EGLSurface CallCreatePlatformWindowSurface(struct wl_egl_window* window) const
|
|
| 126 | + {
|
|
| 127 | + return DoCallCreatePlatformWindowSurface(wxPtrToUInt(window), window);
|
|
| 128 | + }
|
|
| 112 | 129 | |
| 113 | 130 | |
| 114 | 131 | EGLConfig m_config = nullptr;
|
| ... | ... | @@ -956,7 +956,7 @@ void wxRendererXP::DrawItemText(wxWindow* win, |
| 956 | 956 | int flags,
|
| 957 | 957 | wxEllipsizeMode ellipsizeMode)
|
| 958 | 958 | {
|
| 959 | - wxUxThemeHandle hTheme(win, L"EXPLORER::LISTVIEW;LISTVIEW");
|
|
| 959 | + wxUxThemeHandle hTheme(win, L"EXPLORER::LISTVIEW;LISTVIEW", L"DarkMode::LISTVIEW");
|
|
| 960 | 960 | |
| 961 | 961 | const int itemState = GetListItemState(flags);
|
| 962 | 962 |
| ... | ... | @@ -551,7 +551,9 @@ static void gtk_glcanvas_scale_factor_notify(GtkWidget* widget, |
| 551 | 551 | } // extern "C"
|
| 552 | 552 | #endif // GDK_WINDOWING_WAYLAND
|
| 553 | 553 | |
| 554 | -EGLSurface wxGLCanvasEGL::CallCreatePlatformWindowSurface(void *window) const
|
|
| 554 | +EGLSurface
|
|
| 555 | +wxGLCanvasEGL::DoCallCreatePlatformWindowSurface(wxUIntPtr windowID,
|
|
| 556 | + void* windowPtr) const
|
|
| 555 | 557 | {
|
| 556 | 558 | // Type of eglCreatePlatformWindowSurface[EXT]().
|
| 557 | 559 | typedef EGLSurface (*CreatePlatformWindowSurface)(EGLDisplay display,
|
| ... | ... | @@ -577,7 +579,7 @@ EGLSurface wxGLCanvasEGL::CallCreatePlatformWindowSurface(void *window) const |
| 577 | 579 | if ( s_eglCreatePlatformWindowSurface )
|
| 578 | 580 | {
|
| 579 | 581 | return s_eglCreatePlatformWindowSurface(m_display, m_config,
|
| 580 | - window,
|
|
| 582 | + windowPtr,
|
|
| 581 | 583 | nullptr);
|
| 582 | 584 | }
|
| 583 | 585 | }
|
| ... | ... | @@ -601,14 +603,12 @@ EGLSurface wxGLCanvasEGL::CallCreatePlatformWindowSurface(void *window) const |
| 601 | 603 | if ( s_eglCreatePlatformWindowSurfaceEXT )
|
| 602 | 604 | {
|
| 603 | 605 | return s_eglCreatePlatformWindowSurfaceEXT(m_display, m_config,
|
| 604 | - window,
|
|
| 606 | + windowPtr,
|
|
| 605 | 607 | nullptr);
|
| 606 | 608 | }
|
| 607 | 609 | else
|
| 608 | 610 | {
|
| 609 | - return eglCreateWindowSurface(m_display, m_config,
|
|
| 610 | - reinterpret_cast<EGLNativeWindowType>(window),
|
|
| 611 | - nullptr);
|
|
| 611 | + return eglCreateWindowSurface(m_display, m_config, windowID, nullptr);
|
|
| 612 | 612 | }
|
| 613 | 613 | }
|
| 614 | 614 | |
| ... | ... | @@ -632,7 +632,7 @@ void wxGLCanvasEGL::OnRealized() |
| 632 | 632 | }
|
| 633 | 633 | |
| 634 | 634 | m_xwindow = GDK_WINDOW_XID(window);
|
| 635 | - m_surface = CallCreatePlatformWindowSurface(&m_xwindow);
|
|
| 635 | + m_surface = CallCreatePlatformWindowSurface(m_xwindow);
|
|
| 636 | 636 | }
|
| 637 | 637 | #endif
|
| 638 | 638 | #ifdef GDK_WINDOWING_WAYLAND
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help