diff --git a/docs/backends.rst b/docs/backends.rst index b01222d..2fb28b0 100644 --- a/docs/backends.rst +++ b/docs/backends.rst @@ -192,14 +192,14 @@ But the other way around, running a Qt canvas in e.g. the trio loop, works fine: There are known issue with Qt widgets that render directly to screen (i.e. widgets that obtain ``widget.winId()``), -related to how they interact with other widgets and in docks. -If you encounter such issues, consider using the bitmap present-method. That way, the rendering happens -off-screen, and is than provided to Qt as an image. This is a safer approach, albeit lowers the performance (FPS) -somewhat when the render area is large. +related to how they interact with other widgets and in docks. Therefore, the Qt backend defaults to the 'bitmap' present method. +If high FPS is a big deal, you can easily set the present method to 'screen'. If you do this, be aware of possible problems, +especially in some Linux environment and when the widget is in a QDockWidget. .. code-block:: py - widget = QRenderWidget(present_method="bitmap") + widget = QRenderWidget(present_method="bitmap") # safe (default) + widget = QRenderWidget(present_method="screen") # probably higher fps, but can cause problems Support for wx diff --git a/rendercanvas/qt.py b/rendercanvas/qt.py index 17a5804..0222e79 100644 --- a/rendercanvas/qt.py +++ b/rendercanvas/qt.py @@ -14,7 +14,6 @@ from .base import WrapperRenderCanvas, BaseCanvasGroup, BaseRenderCanvas, BaseLoop from ._coreutils import ( logger, - SYSTEM_IS_WAYLAND, get_alt_x11_display, get_alt_wayland_display, select_qt_lib, @@ -372,12 +371,13 @@ def _rc_gui_poll(self): def _rc_get_present_info(self, present_methods): # Select the method the_method = present_methods[0] - if SYSTEM_IS_WAYLAND and "bitmap" in present_methods: - # Trying to render to screen on Wayland segfaults. This might be because - # the "display" is not the real display id. We can tell Qt to use - # XWayland, so we can use the X11 path. This worked at some point, - # but later this resulted in a Rust panic. So, until this is sorted - # out, we fall back to rendering via an image. + if "bitmap" in present_methods: + # There are various known problems with rendering to screen on Qt. + # Some relate to getting a wgpu surface, and Qt not able to provide a display-id on Linux. + # Some relate to Qt simply not liking it when an application bypasses Qt's compositing. + # For an overview see: https://github.com/pygfx/wgpu-py/issues/688 + # To avoid problems, and be consistent, Qt defaults to 'bitmap' present. + # In cases where the extra performance of 'screen' present mode matters, ppl can easily override it. the_method = "bitmap" # Apply diff --git a/rendercanvas/wx.py b/rendercanvas/wx.py index dc3da45..0608419 100644 --- a/rendercanvas/wx.py +++ b/rendercanvas/wx.py @@ -14,7 +14,6 @@ from ._coreutils import ( logger, - SYSTEM_IS_WAYLAND, get_alt_x11_display, get_alt_wayland_display, ) @@ -287,8 +286,9 @@ def _rc_gui_poll(self): def _rc_get_present_info(self, present_methods): # Select method the_method = present_methods[0] - if SYSTEM_IS_WAYLAND and "bitmap" in present_methods: - the_method = "bitmap" # also see qt.py + if "bitmap" in present_methods: + # Default to 'bitmap', also see note in qt.py + the_method = "bitmap" # Apply if the_method == "screen":