Fix wxListHeaderWindow colors in dark mode The generic wxListHeaderWindow implementation lacked wxEVT_SYS_COLOUR_CHANGED handling, causing it to retain old colors when the system theme changed at runtime. This commit adds the missing handler to update colors. Additionally, the sort arrow previously used a hardcoded default shadow color (wxSYS_COLOUR_3DSHADOW), which is often invisible on dark backgrounds. It is now drawn using the window's current foreground color to ensure it matches the header text and remains visible.
Fix wxListMainWindow colors and highlight brushes in dark mode wxListMainWindow lacked wxEVT_SYS_COLOUR_CHANGED handling, causing background, text, and selection highlights to retain old colors after a system theme change. This commit adds the missing handler to update colors and brushes.
Fix opengl section indent in configure.ac
Enable building wxGTK without GLX
GLX support was always built with OpenGL since:
d9df7db130 ("Allow choosing between GLX and EGL during run-time", 2025-12-10)
Define wxHAS_GLX in configure
Only implement wxGLBackend::PreferGLX() with both EGL & GLX
Clarify wxGLBackend::Init()
Merge branch 'wxHAS_GLX' of github.com:cjmayo/wxWidgets Fix building wxGTK without GLX again, after the breakage caused by d9df7db130 (Allow choosing between GLX and EGL during run-time, 2025-12-10). See #26146. Closes #26145.
Fix crash on key press in wxDataViewCtrl in wxOSX Don't access out of bounds NSString characters when processing key events, as this results in an exception and crash under current macOS versions. Closes #26160. Closes #26161.
Merge branch 'fix-listctrl-dark-mode' of github.com:rjricken/wxWidgets Generic wxListCtrl: Fix colors when system theme changes. See #26141.
Fix recent regression in wxOSX wxFileDialog Don't throw away the panel instance which must be used by the dialog. This fixes the behaviour after the changes of 7c6300acfb (Refactor to reuse common code in wxOSX wxFileDialog, 2026-02-02). See #26151. Closes #26162.
| ... | ... | @@ -544,6 +544,10 @@ if(wxUSE_GUI) |
| 544 | 544 | list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES})
|
| 545 | 545 | endif()
|
| 546 | 546 | endif()
|
| 547 | + if(X11_FOUND AND OpenGL_GLX_FOUND)
|
|
| 548 | + # toolkit.cmake calls find_package(X11) if X11 support is needed
|
|
| 549 | + set(wxHAS_GLX 1)
|
|
| 550 | + endif()
|
|
| 547 | 551 | if(WXGTK3 AND APPLE AND (NOT wxHAVE_GDK_X11 OR NOT wxHAVE_GDK_WAYLAND))
|
| 548 | 552 | set(OPENGL_FOUND OFF)
|
| 549 | 553 | endif()
|
| ... | ... | @@ -1143,6 +1143,9 @@ |
| 1143 | 1143 | /* Define if you have EGL support */
|
| 1144 | 1144 | #cmakedefine wxHAS_EGL 1
|
| 1145 | 1145 | |
| 1146 | +/* Define if you have GLX support */
|
|
| 1147 | +#cmakedefine wxHAS_GLX 1
|
|
| 1148 | + |
|
| 1146 | 1149 | /* Define if you have inotify_xxx() functions. */
|
| 1147 | 1150 | #cmakedefine wxHAS_INOTIFY 1
|
| 1148 | 1151 |
| ... | ... | @@ -3476,34 +3476,35 @@ if test "$wxUSE_OPENGL" = "yes" -o "$wxUSE_OPENGL" = "auto"; then |
| 3476 | 3476 | fi
|
| 3477 | 3477 | fi
|
| 3478 | 3478 | |
| 3479 | - found_gl=1
|
|
| 3480 | - OPENGL_LIBS="-lGL"
|
|
| 3479 | + found_gl=1
|
|
| 3480 | + OPENGL_LIBS="-lGL"
|
|
| 3481 | + AC_DEFINE(wxHAS_GLX)
|
|
| 3481 | 3482 | |
| 3482 | - if test "$WXGTK3" = 1; then
|
|
| 3483 | - if test "$wxUSE_GLCANVAS_EGL" != "no"; then
|
|
| 3484 | - PKG_CHECK_MODULES(EGL, [egl >= 1.4],
|
|
| 3485 | - [
|
|
| 3486 | - OPENGL_LIBS="$OPENGL_LIBS $EGL_LIBS"
|
|
| 3487 | - AC_DEFINE(wxHAS_EGL)
|
|
| 3488 | - PKG_CHECK_MODULES(WAYLAND_EGL, [wayland-egl],
|
|
| 3489 | - [
|
|
| 3490 | - if test $wx_cv_gdk_wayland = "yes"; then
|
|
| 3491 | - OPENGL_LIBS="$OPENGL_LIBS $WAYLAND_EGL_LIBS"
|
|
| 3492 | - have_wayland=1
|
|
| 3493 | - fi
|
|
| 3494 | - ],
|
|
| 3495 | - [:]
|
|
| 3496 | - )
|
|
| 3497 | - ],
|
|
| 3498 | - [
|
|
| 3499 | - AC_MSG_NOTICE([EGL 1.4+ not available. Will use GLX.])
|
|
| 3500 | - ]
|
|
| 3501 | - )
|
|
| 3502 | - if test "$have_wayland" != 1; then
|
|
| 3503 | - AC_MSG_NOTICE([wxGLCanvas will not have Wayland support])
|
|
| 3504 | - fi
|
|
| 3483 | + if test "$WXGTK3" = 1; then
|
|
| 3484 | + if test "$wxUSE_GLCANVAS_EGL" != "no"; then
|
|
| 3485 | + PKG_CHECK_MODULES(EGL, [egl >= 1.4],
|
|
| 3486 | + [
|
|
| 3487 | + OPENGL_LIBS="$OPENGL_LIBS $EGL_LIBS"
|
|
| 3488 | + AC_DEFINE(wxHAS_EGL)
|
|
| 3489 | + PKG_CHECK_MODULES(WAYLAND_EGL, [wayland-egl],
|
|
| 3490 | + [
|
|
| 3491 | + if test $wx_cv_gdk_wayland = "yes"; then
|
|
| 3492 | + OPENGL_LIBS="$OPENGL_LIBS $WAYLAND_EGL_LIBS"
|
|
| 3493 | + have_wayland=1
|
|
| 3494 | + fi
|
|
| 3495 | + ],
|
|
| 3496 | + [:]
|
|
| 3497 | + )
|
|
| 3498 | + ],
|
|
| 3499 | + [
|
|
| 3500 | + AC_MSG_NOTICE([EGL 1.4+ not available. Will use GLX.])
|
|
| 3501 | + ]
|
|
| 3502 | + )
|
|
| 3503 | + if test "$have_wayland" != 1; then
|
|
| 3504 | + AC_MSG_NOTICE([wxGLCanvas will not have Wayland support])
|
|
| 3505 | 3505 | fi
|
| 3506 | 3506 | fi
|
| 3507 | + fi
|
|
| 3507 | 3508 | fi
|
| 3508 | 3509 | |
| 3509 | 3510 | if test "$found_gl" != 1; then
|
| ... | ... | @@ -356,6 +356,7 @@ public: |
| 356 | 356 | |
| 357 | 357 | void OnPaint( wxPaintEvent &event );
|
| 358 | 358 | void OnMouse( wxMouseEvent &event );
|
| 359 | + void OnSysColourChanged( wxSysColourChangedEvent &event );
|
|
| 359 | 360 | |
| 360 | 361 | // needs refresh
|
| 361 | 362 | bool m_dirty;
|
| ... | ... | @@ -617,6 +618,8 @@ public: |
| 617 | 618 | |
| 618 | 619 | void OnPaint( wxPaintEvent &event );
|
| 619 | 620 | |
| 621 | + void OnSysColourChanged( wxSysColourChangedEvent &event );
|
|
| 622 | + |
|
| 620 | 623 | void OnChildFocus(wxChildFocusEvent& event);
|
| 621 | 624 | |
| 622 | 625 | void DrawImage( int index, wxDC *dc, int x, int y );
|
| ... | ... | @@ -18,14 +18,6 @@ |
| 18 | 18 | #include "wx/palette.h"
|
| 19 | 19 | #include "wx/window.h"
|
| 20 | 20 | |
| 21 | -// Most ports have a single implementation of wxGLCanvas, but wxGTK has two:
|
|
| 22 | -// legacy GLX-based one (also used by wxX11) and EGL-based one which is used
|
|
| 23 | -// if support for EGL is available. wxHAS_EGL is defined by the build system
|
|
| 24 | -// but define wxHAS_GLX too for consistency, even if it's always available.
|
|
| 25 | -#if defined(__WXX11__) || defined(__WXGTK__)
|
|
| 26 | - #define wxHAS_GLX 1
|
|
| 27 | -#endif
|
|
| 28 | - |
|
| 29 | 21 | class WXDLLIMPEXP_FWD_GL wxGLCanvas;
|
| 30 | 22 | class WXDLLIMPEXP_FWD_GL wxGLContext;
|
| 31 | 23 |
| ... | ... | @@ -100,7 +100,7 @@ protected: |
| 100 | 100 | private:
|
| 101 | 101 | // Common part of all ctors.
|
| 102 | 102 | void Init();
|
| 103 | - void CommonShow();
|
|
| 103 | + WX_NSObject CommonShow();
|
|
| 104 | 104 | };
|
| 105 | 105 | |
| 106 | 106 | #endif // _WX_FILEDLG_H_ |
| ... | ... | @@ -71,10 +71,10 @@ protected: |
| 71 | 71 | class wxGLBackend
|
| 72 | 72 | {
|
| 73 | 73 | public:
|
| 74 | -#ifdef wxHAS_EGL
|
|
| 74 | +#if defined(wxHAS_EGL) && defined(wxHAS_GLX)
|
|
| 75 | 75 | // This can be called only before calling Get() for the first time.
|
| 76 | 76 | static void PreferGLX();
|
| 77 | -#endif // wxHAS_EGL
|
|
| 77 | +#endif // wxHAS_EGL && wxHAS_GLX
|
|
| 78 | 78 | |
| 79 | 79 | // Get the (sole) instance of this class.
|
| 80 | 80 | static wxGLBackend& Get()
|
| ... | ... | @@ -1141,6 +1141,9 @@ |
| 1141 | 1141 | /* Define if you have EGL support */
|
| 1142 | 1142 | #undef wxHAS_EGL
|
| 1143 | 1143 | |
| 1144 | +/* Define if you have GLX support */
|
|
| 1145 | +#undef wxHAS_GLX
|
|
| 1146 | + |
|
| 1144 | 1147 | /* Define if you have inotify_xxx() functions. */
|
| 1145 | 1148 | #undef wxHAS_INOTIFY
|
| 1146 | 1149 |
| ... | ... | @@ -905,6 +905,7 @@ void wxListLineData::ReverseHighlight( void ) |
| 905 | 905 | wxBEGIN_EVENT_TABLE(wxListHeaderWindow,wxWindow)
|
| 906 | 906 | EVT_PAINT (wxListHeaderWindow::OnPaint)
|
| 907 | 907 | EVT_MOUSE_EVENTS (wxListHeaderWindow::OnMouse)
|
| 908 | + EVT_SYS_COLOUR_CHANGED(wxListHeaderWindow::OnSysColourChanged)
|
|
| 908 | 909 | wxEND_EVENT_TABLE()
|
| 909 | 910 | |
| 910 | 911 | void wxListHeaderWindow::Init()
|
| ... | ... | @@ -1051,13 +1052,17 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) |
| 1051 | 1052 | if (i == 0)
|
| 1052 | 1053 | flags |= wxCONTROL_SPECIAL; // mark as first column
|
| 1053 | 1054 | |
| 1055 | + wxHeaderButtonParams headerBtnParams;
|
|
| 1056 | + headerBtnParams.m_arrowColour = GetForegroundColour();
|
|
| 1057 | + |
|
| 1054 | 1058 | wxRendererNative::Get().DrawHeaderButton
|
| 1055 | 1059 | (
|
| 1056 | 1060 | this,
|
| 1057 | 1061 | dc,
|
| 1058 | 1062 | wxRect(x, HEADER_OFFSET_Y, cw, ch),
|
| 1059 | 1063 | flags,
|
| 1060 | - sortArrow
|
|
| 1064 | + sortArrow,
|
|
| 1065 | + &headerBtnParams
|
|
| 1061 | 1066 | );
|
| 1062 | 1067 | |
| 1063 | 1068 | // see if we have enough space for the column label
|
| ... | ... | @@ -1306,6 +1311,16 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event ) |
| 1306 | 1311 | }
|
| 1307 | 1312 | }
|
| 1308 | 1313 | |
| 1314 | +void wxListHeaderWindow::OnSysColourChanged(wxSysColourChangedEvent &event)
|
|
| 1315 | +{
|
|
| 1316 | + SetOwnForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
|
| 1317 | + SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
|
|
| 1318 | + |
|
| 1319 | + Refresh();
|
|
| 1320 | + |
|
| 1321 | + event.Skip();
|
|
| 1322 | +}
|
|
| 1323 | + |
|
| 1309 | 1324 | bool wxListHeaderWindow::SendListEvent(wxEventType type, const wxPoint& pos)
|
| 1310 | 1325 | {
|
| 1311 | 1326 | wxWindow *parent = GetParent();
|
| ... | ... | @@ -1515,6 +1530,7 @@ wxBEGIN_EVENT_TABLE(wxListMainWindow, wxWindow) |
| 1515 | 1530 | EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus)
|
| 1516 | 1531 | EVT_SCROLLWIN (wxListMainWindow::OnScroll)
|
| 1517 | 1532 | EVT_CHILD_FOCUS (wxListMainWindow::OnChildFocus)
|
| 1533 | + EVT_SYS_COLOUR_CHANGED(wxListMainWindow::OnSysColourChanged)
|
|
| 1518 | 1534 | wxEND_EVENT_TABLE()
|
| 1519 | 1535 | |
| 1520 | 1536 | void wxListMainWindow::Init()
|
| ... | ... | @@ -2193,6 +2209,26 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) |
| 2193 | 2209 | #endif // !__WXMAC__
|
| 2194 | 2210 | }
|
| 2195 | 2211 | |
| 2212 | +void wxListMainWindow::OnSysColourChanged( wxSysColourChangedEvent &event )
|
|
| 2213 | +{
|
|
| 2214 | + SetOwnForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT));
|
|
| 2215 | + SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX));
|
|
| 2216 | + |
|
| 2217 | + if ( m_highlightBrush )
|
|
| 2218 | + {
|
|
| 2219 | + m_highlightBrush->SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
|
|
| 2220 | + }
|
|
| 2221 | + |
|
| 2222 | + if ( m_highlightUnfocusedBrush )
|
|
| 2223 | + {
|
|
| 2224 | + m_highlightUnfocusedBrush->SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
|
|
| 2225 | + }
|
|
| 2226 | + |
|
| 2227 | + Refresh();
|
|
| 2228 | + |
|
| 2229 | + event.Skip();
|
|
| 2230 | +}
|
|
| 2231 | + |
|
| 2196 | 2232 | void wxListMainWindow::HighlightAll( bool on )
|
| 2197 | 2233 | {
|
| 2198 | 2234 | if ( IsSingleSel() )
|
| ... | ... | @@ -38,6 +38,7 @@ static gboolean draw(GtkWidget* widget, cairo_t* cr, wxGLCanvas* win) |
| 38 | 38 | }
|
| 39 | 39 | #endif // __WXGTK3__
|
| 40 | 40 | |
| 41 | +#ifdef wxHAS_GLX
|
|
| 41 | 42 | //-----------------------------------------------------------------------------
|
| 42 | 43 | // emission hook for "parent-set"
|
| 43 | 44 | //-----------------------------------------------------------------------------
|
| ... | ... | @@ -69,6 +70,7 @@ parent_set_hook(GSignalInvocationHint*, guint, const GValue* param_values, void* |
| 69 | 70 | return true;
|
| 70 | 71 | }
|
| 71 | 72 | }
|
| 73 | +#endif // wxHAS_GLX
|
|
| 72 | 74 | |
| 73 | 75 | //---------------------------------------------------------------------------
|
| 74 | 76 | // wxGlCanvas
|
| ... | ... | @@ -178,6 +180,7 @@ bool wxGLCanvas::Create(wxWindow *parent, |
| 178 | 180 | if ( !InitVisual(dispAttrs) )
|
| 179 | 181 | return false;
|
| 180 | 182 | |
| 183 | +#ifdef wxHAS_GLX
|
|
| 181 | 184 | // watch for the "parent-set" signal on m_wxwindow so we can set colormap
|
| 182 | 185 | // before m_wxwindow is realized (which will occur before
|
| 183 | 186 | // wxWindow::Create() returns if parent is already visible)
|
| ... | ... | @@ -186,6 +189,7 @@ bool wxGLCanvas::Create(wxWindow *parent, |
| 186 | 189 | unsigned sig_id = g_signal_lookup("parent-set", GTK_TYPE_WIDGET);
|
| 187 | 190 | g_signal_add_emission_hook(sig_id, 0, parent_set_hook, this, nullptr);
|
| 188 | 191 | }
|
| 192 | +#endif // wxHAS_GLX
|
|
| 189 | 193 | |
| 190 | 194 | wxWindow::Create( parent, id, pos, size, style, name );
|
| 191 | 195 | #ifdef __WXGTK3__
|
| ... | ... | @@ -2033,8 +2033,8 @@ wxCocoaDataViewControl::~wxCocoaDataViewControl() |
| 2033 | 2033 | |
| 2034 | 2034 | void wxCocoaDataViewControl::keyEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
|
| 2035 | 2035 | {
|
| 2036 | - if( [event type] == NSKeyDown && [[event charactersIgnoringModifiers]
|
|
| 2037 | - characterAtIndex: 0] == NSCarriageReturnCharacter )
|
|
| 2036 | + NSString* c = [event type] == NSKeyDown ? [event charactersIgnoringModifiers] : nil;
|
|
| 2037 | + if( c != nil && [c length] >= 1 && [c characterAtIndex: 0] == NSCarriageReturnCharacter )
|
|
| 2038 | 2038 | {
|
| 2039 | 2039 | wxDataViewCtrl* const dvc = GetDataViewCtrl();
|
| 2040 | 2040 | const wxDataViewItem item = wxDataViewItem( [[m_OutlineView itemAtRow:[m_OutlineView selectedRow]] pointer]);
|
| ... | ... | @@ -256,30 +256,26 @@ void wxFileDialog::ShowWindowModal() |
| 256 | 256 | |
| 257 | 257 | wxCHECK_RET(parentWindow, "Window modal display requires parent.");
|
| 258 | 258 | |
| 259 | - CommonShow();
|
|
| 259 | + NSSavePanel* panel = (NSSavePanel*) CommonShow();
|
|
| 260 | 260 | |
| 261 | 261 | if ( HasFlag(wxFD_SAVE) )
|
| 262 | 262 | {
|
| 263 | - NSSavePanel* sPanel = [NSSavePanel savePanel];
|
|
| 264 | - |
|
| 265 | 263 | NSWindow* nativeParent = parentWindow->GetWXWindow();
|
| 266 | 264 | |
| 267 | - [sPanel beginSheetModalForWindow:nativeParent completionHandler:
|
|
| 265 | + [panel beginSheetModalForWindow:nativeParent completionHandler:
|
|
| 268 | 266 | ^(NSModalResponse returnCode)
|
| 269 | 267 | {
|
| 270 | - this->ModalFinishedCallback(sPanel, returnCode);
|
|
| 268 | + this->ModalFinishedCallback(panel, returnCode);
|
|
| 271 | 269 | }];
|
| 272 | 270 | }
|
| 273 | 271 | else
|
| 274 | 272 | {
|
| 275 | - NSOpenPanel* oPanel = [NSOpenPanel openPanel];
|
|
| 276 | - |
|
| 277 | 273 | NSWindow* nativeParent = parentWindow->GetWXWindow();
|
| 278 | 274 | |
| 279 | - [oPanel beginSheetModalForWindow:nativeParent completionHandler:
|
|
| 275 | + [panel beginSheetModalForWindow:nativeParent completionHandler:
|
|
| 280 | 276 | ^(NSModalResponse returnCode)
|
| 281 | 277 | {
|
| 282 | - this->ModalFinishedCallback(oPanel, returnCode);
|
|
| 278 | + this->ModalFinishedCallback(panel, returnCode);
|
|
| 283 | 279 | }];
|
| 284 | 280 | }
|
| 285 | 281 | |
| ... | ... | @@ -462,7 +458,7 @@ int wxFileDialog::GetMatchingFilterExtension(const wxString& filename) |
| 462 | 458 | return index;
|
| 463 | 459 | }
|
| 464 | 460 | |
| 465 | -void wxFileDialog::CommonShow()
|
|
| 461 | +WX_NSObject wxFileDialog::CommonShow()
|
|
| 466 | 462 | {
|
| 467 | 463 | wxCFStringRef cf( m_message );
|
| 468 | 464 | wxCFStringRef dir( m_dir );
|
| ... | ... | @@ -552,6 +548,8 @@ void wxFileDialog::CommonShow() |
| 552 | 548 | |
| 553 | 549 | if ( !m_fileName.IsEmpty() )
|
| 554 | 550 | [sPanel setNameFieldStringValue: file.AsNSString()];
|
| 551 | + |
|
| 552 | + return sPanel;
|
|
| 555 | 553 | }
|
| 556 | 554 | else
|
| 557 | 555 | {
|
| ... | ... | @@ -591,6 +589,8 @@ void wxFileDialog::CommonShow() |
| 591 | 589 | if ( !m_dir.IsEmpty() )
|
| 592 | 590 | [oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString()
|
| 593 | 591 | isDirectory:YES]];
|
| 592 | + |
|
| 593 | + return oPanel;
|
|
| 594 | 594 | }
|
| 595 | 595 | }
|
| 596 | 596 | |
| ... | ... | @@ -604,25 +604,22 @@ int wxFileDialog::ShowModal() |
| 604 | 604 | |
| 605 | 605 | int returnCode = -1;
|
| 606 | 606 | |
| 607 | - CommonShow();
|
|
| 607 | + // NSOpenPanel is a subclass of NSSavePanel so this is safe
|
|
| 608 | + NSSavePanel* panel = (NSSavePanel*) CommonShow();
|
|
| 608 | 609 | |
| 609 | 610 | OSXBeginModalDialog();
|
| 610 | 611 | |
| 611 | 612 | if ( HasFlag(wxFD_SAVE) )
|
| 612 | 613 | {
|
| 613 | - NSSavePanel* sPanel = [NSSavePanel savePanel];
|
|
| 614 | - |
|
| 615 | - returnCode = [sPanel runModal];
|
|
| 614 | + returnCode = [panel runModal];
|
|
| 616 | 615 | |
| 617 | - ModalFinishedCallback(sPanel, returnCode);
|
|
| 616 | + ModalFinishedCallback(panel, returnCode);
|
|
| 618 | 617 | }
|
| 619 | 618 | else
|
| 620 | 619 | {
|
| 621 | - NSOpenPanel* oPanel = [NSOpenPanel openPanel];
|
|
| 622 | - |
|
| 623 | - returnCode = [oPanel runModal];
|
|
| 620 | + returnCode = [panel runModal];
|
|
| 624 | 621 | |
| 625 | - ModalFinishedCallback(oPanel, returnCode);
|
|
| 622 | + ModalFinishedCallback(panel, returnCode);
|
|
| 626 | 623 | }
|
| 627 | 624 | |
| 628 | 625 | OSXEndModalDialog();
|
| ... | ... | @@ -23,7 +23,9 @@ |
| 23 | 23 | #include "wx/glcanvas.h"
|
| 24 | 24 | |
| 25 | 25 | #include "wx/unix/private/glcanvas.h"
|
| 26 | +#ifdef wxHAS_GLX
|
|
| 26 | 27 | #include "wx/unix/private/glx11.h"
|
| 28 | +#endif // wxHAS_GLX
|
|
| 27 | 29 | #ifdef wxHAS_EGL
|
| 28 | 30 | #include "wx/unix/private/glegl.h"
|
| 29 | 31 | |
| ... | ... | @@ -198,7 +200,7 @@ wxIMPLEMENT_CLASS(wxGLContext, wxObject); |
| 198 | 200 | |
| 199 | 201 | wxGLBackend* wxGLBackend::ms_instance = nullptr;
|
| 200 | 202 | |
| 201 | -#ifdef wxHAS_EGL
|
|
| 203 | +#if defined(wxHAS_EGL) && defined(wxHAS_GLX)
|
|
| 202 | 204 | |
| 203 | 205 | static bool wxGLBackendPreferGLX = false;
|
| 204 | 206 | |
| ... | ... | @@ -210,7 +212,7 @@ void wxGLBackend::PreferGLX() |
| 210 | 212 | |
| 211 | 213 | wxGLBackendPreferGLX = true;
|
| 212 | 214 | }
|
| 213 | -#endif // wxHAS_EGL
|
|
| 215 | +#endif // wxHAS_EGL && wxHAS_GLX
|
|
| 214 | 216 | |
| 215 | 217 | /* static */
|
| 216 | 218 | wxGLBackend* wxGLBackend::Init()
|
| ... | ... | @@ -229,11 +231,18 @@ wxGLBackend* wxGLBackend::Init() |
| 229 | 231 | return &wxGLBackendEGL::Get();
|
| 230 | 232 | #endif // GTK 3 with Wayland
|
| 231 | 233 | |
| 234 | +#ifdef wxHAS_GLX
|
|
| 232 | 235 | if ( !(wxGLBackendPreferGLX || wxSystemOptions::IsFalse("opengl.egl")) )
|
| 233 | 236 | return &wxGLBackendEGL::Get();
|
| 237 | +#else
|
|
| 238 | + return &wxGLBackendEGL::Get();
|
|
| 239 | +#endif // wxHAS_GLX
|
|
| 240 | + |
|
| 234 | 241 | #endif // wxHAS_EGL
|
| 235 | 242 | |
| 243 | +#ifdef wxHAS_GLX
|
|
| 236 | 244 | return &wxGLBackendX11::Get();
|
| 245 | +#endif // wxHAS_GLX
|
|
| 237 | 246 | }
|
| 238 | 247 | |
| 239 | 248 | wxGLContext::wxGLContext(wxGLCanvas *win,
|
| ... | ... | @@ -296,9 +305,9 @@ void wxGLCanvasUnix::CallOnRealized() |
| 296 | 305 | /* static */
|
| 297 | 306 | void wxGLCanvasUnix::PreferGLX()
|
| 298 | 307 | {
|
| 299 | -#ifdef wxHAS_EGL
|
|
| 308 | +#if defined(wxHAS_EGL) && defined(wxHAS_GLX)
|
|
| 300 | 309 | wxGLBackend::PreferGLX();
|
| 301 | -#endif // wxHAS_EGL
|
|
| 310 | +#endif // wxHAS_EGL && wxHAS_GLX
|
|
| 302 | 311 | }
|
| 303 | 312 | |
| 304 | 313 | /* static */
|
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | // for compilers that support precompilation, includes "wx.h".
|
| 19 | 19 | #include "wx/wxprec.h"
|
| 20 | 20 | |
| 21 | -#if wxUSE_GLCANVAS
|
|
| 21 | +#if wxUSE_GLCANVAS && defined(wxHAS_GLX)
|
|
| 22 | 22 | |
| 23 | 23 | #ifndef WX_PRECOMP
|
| 24 | 24 | #include "wx/log.h"
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help