diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 7c6e72f19..683bb9d29 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -2363,7 +2363,14 @@ Supported callbacks and fields are: where the above painting functions work correctly. If omitted, the screen is cleared; otherwise it should do that itself. - In order to make a see-through dialog, call ``self._native.parent:render()``. + In order to make a dialog where portions of the parent viewscreen are still + visible in the background, call ``screen:renderParent()``. + + If artifacts are left on the parent even after this function is called, such + as when the window is dragged or is resized, any code can set + ``gui.Screen.request_full_screen_refresh`` to ``true``. Then when + ``screen.renderParent()`` is next called, it will do a full flush of the + graphics and clear the screen of artifacts. * ``function screen:onIdle()`` diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 1eaa9861a..ba15e32aa 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -597,6 +597,7 @@ end Screen = defclass(Screen, View) Screen.text_input_mode = false +Screen.request_full_screen_refresh = false function Screen:postinit() self:onResize(dscreen.getWindowSize()) @@ -622,7 +623,10 @@ function Screen:renderParent() else dscreen.clear() end - df.global.gps.force_full_display_count = 1 + if Screen.request_full_screen_refresh then + df.global.gps.force_full_display_count = 1 + Screen.request_full_screen_refresh = false + end end function Screen:sendInputToParent(...) diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index 55d8facf9..18d61c6b3 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -487,6 +487,10 @@ Window.ATTRS { draggable = true, } +function Window:postUpdateLayout() + gui.Screen.request_full_screen_refresh = true +end + ------------------- -- ResizingPanel -- -------------------