From 0f0f91a159a35820fcd7fa1520866ecf4794d4ff Mon Sep 17 00:00:00 2001 From: totaam Date: Wed, 25 Oct 2023 22:19:33 +0700 Subject: [PATCH] #2467 let draw_fbo specify the return value so it can stop processing of the event, or let it continue --- xpra/client/gl/gtk3/client_window.py | 10 +++++----- xpra/client/gl/gtk3/drawing_area.py | 3 ++- xpra/client/gtk3/window_base.py | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/xpra/client/gl/gtk3/client_window.py b/xpra/client/gl/gtk3/client_window.py index 27eea3d895..602dec3dc8 100644 --- a/xpra/client/gl/gtk3/client_window.py +++ b/xpra/client/gl/gtk3/client_window.py @@ -130,11 +130,11 @@ def new_backing(self, bw:int, bh:int) -> None: self.apply_geometry_hints(self.geometry_hints) def draw_widget(self, widget, context) -> bool: - log("draw_widget(%s, %s)", widget, context) - if not self.get_mapped(): - return False + mapped = self.get_mapped() backing = self._backing + log(f"draw_widget({widget}, {context}) {mapped=}, {backing=}", ) + if not mapped: + return False if not backing: return False - backing.draw_fbo(context) - return True + return backing.draw_fbo(context) diff --git a/xpra/client/gl/gtk3/drawing_area.py b/xpra/client/gl/gtk3/drawing_area.py index a1f72a90e4..8526c4b0fd 100644 --- a/xpra/client/gl/gtk3/drawing_area.py +++ b/xpra/client/gl/gtk3/drawing_area.py @@ -104,8 +104,9 @@ def close_gl_config(self) -> None: self.context = None c.destroy() - def draw_fbo(self, _context) -> None: + def draw_fbo(self, _context) -> bool: w, h = self.size with self.gl_context() as ctx: self.gl_init(ctx) self.present_fbo(ctx, 0, 0, w, h) + return True diff --git a/xpra/client/gtk3/window_base.py b/xpra/client/gtk3/window_base.py index 52a470e6d7..b4d0491526 100644 --- a/xpra/client/gtk3/window_base.py +++ b/xpra/client/gtk3/window_base.py @@ -354,7 +354,7 @@ def configure_event(_w, event): widget.connect("scroll-event", scroll) widget.connect("draw", self.draw_widget) - def draw_widget(self, widget, context) -> None: + def draw_widget(self, widget, context) -> bool: raise NotImplementedError() def get_drawing_area_geometry(self):