wxQt RTL fixes (PR #25822)

31 views
Skip to first unread message

AliKet

unread,
Sep 21, 2025, 6:02:57 PM (4 days ago) Sep 21
to wx-...@googlegroups.com, Subscribed

Some screenshots of the result of this PR:

Widgets demo:
widgets_rtl.png (view on web)

Grid demo:
griddemo_rtl.png (view on web)

AUI demo:
auidemo_rtl.png (view on web)


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/25822

Commit Summary

  • 9c868a8 wxQt: Fix window positioning in RTL layout.
  • f47a042 wxQt: Fix wxWindow::Refresh() not working correctly in RTL layout.
  • 9a0faac wxQt: Fix window scrolling in RTL layout
  • cbe1bd0 wxQt: Fix ClientToScreen() and ScreenToClient() to work correctly in RTL layout.
  • 1ce42a7 wxQt: Fix popup menu position in RTL layout
  • 6919cd1 wxQt: Override wxDC::{Get,Set}LayoutDirection()
  • 955bb3a wxQt: Apply custom mirroring to wxDC in RTL layout.
  • 8f64804 wxQt: Fix wxDC::GetSize() for wxMemoryDC
  • 37b20aa wxQt: Fix wxAuiManager::CalculateHintRect() in RTL layout
  • e1a527f wxQt: Fix drawing wxGrid lines in RTL layout
  • 40e7903 wxQt: Fix drawing wxTreeCtrl icons in RTL layout
  • 59c1788 wxQt: Fix wxOverlay in RTL layout
  • a7713e7 wxQt: Fix some native control rendering in RTL layout
  • 16083e7 Fix clippingbox's OneDevRegionRTL test case

File Changes

(12 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25822@github.com>

RobertRoeb

unread,
Sep 22, 2025, 2:26:23 PM (3 days ago) Sep 22
to wx-...@googlegroups.com, Subscribed
RobertRoeb left a comment (wxWidgets/wxWidgets#25822)

Amazing!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25822/c3320685579@github.com>

AliKet

unread,
Sep 22, 2025, 2:31:30 PM (3 days ago) Sep 22
to wx-...@googlegroups.com, Push

@AliKet pushed 10 commits.

  • 137006d wxQt: Override wxDC::{Get,Set}LayoutDirection()
  • 9413bde wxQt: Override wxDC::GetLayoutDirection() in wxMemoryDC
  • 5b0c369 wxQt: Apply custom mirroring to wxDC in RTL layout.
  • 6888227 wxQt: Fix wxDC::GetSize() for wxMemoryDC
  • cb65081 wxQt: Fix wxAuiManager::CalculateHintRect() in RTL layout
  • 6f0062b wxQt: Fix drawing wxGrid lines in RTL layout
  • 6686207 wxQt: Fix drawing wxTreeCtrl icons in RTL layout
  • a30936a wxQt: Fix wxOverlay in RTL layout
  • 4b5f389 wxQt: Fix some native control rendering in RTL layout
  • fd7c422 Fix clippingbox's OneDevRegionRTL test case


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25822/before/16083e72ec043cebcda54931e84de6429c216fa7/after/fd7c422260ccb56362ebbcb20544a1a3005f4e39@github.com>

VZ

unread,
Sep 22, 2025, 6:09:04 PM (3 days ago) Sep 22
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

Thanks, this looks good and could be merged AFAICS, I'm not sure why is this in the "draft" state yet?

Also, unfortunately I have no idea why did SliderTestCase start consistently failing with Qt 6.8 just recently, but this is unrelated to this change.


In include/wx/qt/dc.h:

> @@ -117,6 +122,14 @@ class WXDLLIMPEXP_CORE wxQtDCImpl : public wxDCImpl
 
     virtual void* GetHandle() const override { return (void*) m_qtPainter; }
 
+    // LRT/RTL related functions

Typo:

⬇️ Suggested change
-    // LRT/RTL related functions
+    // LTR/RTL related functions

In src/aui/framemanager.cpp:

> @@ -3478,11 +3478,13 @@ wxRect wxAuiManager::CalculateHintRect(wxWindow* pane_window,
 
     m_frame->ClientToScreen(&rect.x, &rect.y);
 
+#ifndef __WXQT__

I was always suspicious of this piece of code, if it's not needed for wxQt, it seems to confirm that it shouldn't be necessary for the other ports as well... Do you have any idea what could be wrong in/with them to require it?


In src/qt/dc.cpp:

> @@ -462,10 +496,10 @@ void wxQtDCImpl::Clear()
     int width, height;
     DoGetSize(&width, &height);
 
-    m_qtPainter->eraseRect( DeviceToLogicalX(0),
-                            DeviceToLogicalY(0),
-                            DeviceToLogicalXRel(width),
-                            DeviceToLogicalYRel(height) );
+    const wxPoint pos = DeviceToLogical(0, 0);

Just to confirm: this doesn't really change anything, does it? I.e. DeviceToLogicalX() etc work too?


In src/qt/overlay.cpp:

> +    // For correct result in RTL layout, the drawing is done in a non-mirrored
+    // DC and the mirroring is done in paintEvent() above.

Sorry, I feel dumb, but I don't really understand why do we need to do this. I.e. what is wrong with using RTL layout for the DC itself instead of mirroring it later?


In src/qt/window.cpp:

> +    default:
+        wxFALLTHROUGH;
+

I'd remove this to get a warning in the (unlikely) event of more elements being added to this enum.


In tests/graphics/clippingbox.cpp:

> @@ -1033,9 +1033,9 @@ static void OneDevRegionRTL(wxDC& dc, const wxBitmap& bmp, bool useTransformMatr
         return;
     }
 
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMSW__)

Could we perhaps add a check for __WXMSW__ below instead of disabling this test entirely for it?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25822/review/3255309593@github.com>

AliKet

unread,
Sep 24, 2025, 7:42:19 PM (11 hours ago) Sep 24
to wx-...@googlegroups.com, Push

@AliKet pushed 19 commits.

  • 95d3fb9 wxQt: Fix window positioning in RTL layout.
  • ce427d5 wxQt: Fix wxWindow::Refresh() not working correctly in RTL layout.
  • 6f5cbdd wxQt: Fix window scrolling in RTL layout
  • 9365edb wxQt: Fix ClientToScreen() and ScreenToClient() to work correctly in RTL layout.
  • ba72753 wxQt: Fix popup menu position in RTL layout
  • fee7fd7 wxQt: Override wxDC::{Get,Set}LayoutDirection()
  • 4b86491 wxQt: Override wxDC::SetLayoutDirection() in wxMemoryDC
  • 883f95b wxQt: Apply custom mirroring to wxDC in RTL layout.
  • 69243bd wxQt: Simplify wxDC::DoDraw{Rotated}Text() implementations
  • 57a9461 wxQt: Fix drawing multiline text with wxDC::DrawText()
  • d838e46 wxQt: Fix drawing (rotated) text in RTL layout
  • 6d730db wxQt: Fix drawing (rotated) text with GC in RTL layout
  • 8f835d4 wxQt: Fix wxDC::GetSize() for wxMemoryDC
  • 44f178f wxQt: Fix wxAuiManager::CalculateHintRect() in RTL layout
  • c23bca6 wxQt: Fix drawing wxGrid lines in RTL layout
  • 594c884 wxQt: Fix drawing wxTreeCtrl icons in RTL layout
  • e1ecd45 wxQt: Fix wxOverlay in RTL layout
  • 3f82398 wxQt: Fix some native control rendering in RTL layout
  • 0174e8c Fix clippingbox's OneDevRegionRTL test case


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25822/before/fd7c422260ccb56362ebbcb20544a1a3005f4e39/after/0174e8c5a144dd8b153efce3133090e9fbb98c04@github.com>

AliKet

unread,
6:09 AM (4 minutes ago) 6:09 AM
to wx-...@googlegroups.com, Push

@AliKet pushed 12 commits.

  • 269829e wxQt: Apply custom mirroring to wxDC in RTL layout.
  • e09ea4f wxQt: Simplify wxDC::DoDraw{Rotated}Text() implementations
  • 39238fc wxQt: Fix drawing multiline text with wxDC::DrawText()
  • e6675e6 wxQt: Fix drawing (rotated) text in RTL layout
  • da92795 wxQt: Fix drawing (rotated) text with GC in RTL layout
  • 7b98f2c wxQt: Fix wxDC::GetSize() for wxMemoryDC
  • 08b2160 wxQt: Fix wxAuiManager::CalculateHintRect() in RTL layout
  • ee9aea5 wxQt: Fix drawing wxGrid lines in RTL layout
  • 0ed0bcb wxQt: Fix drawing wxTreeCtrl icons in RTL layout
  • 3e34e2f wxQt: Fix wxOverlay in RTL layout
  • adfe916 wxQt: Fix some native control rendering in RTL layout
  • 14dd4a0 Fix clippingbox's OneDevRegionRTL test case


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25822/before/0174e8c5a144dd8b153efce3133090e9fbb98c04/after/14dd4a03d7a3ba8ea8f6d5f2b4da404efafa5839@github.com>

Reply all
Reply to author
Forward
0 new messages