Skip to content

Commit

Permalink
#2467 let draw_fbo specify the return value
Browse files Browse the repository at this point in the history
so it can stop processing of the event, or let it continue
  • Loading branch information
totaam committed Oct 25, 2023
1 parent f46ce27 commit 0f0f91a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions xpra/client/gl/gtk3/client_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 2 additions & 1 deletion xpra/client/gl/gtk3/drawing_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion xpra/client/gtk3/window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0f0f91a

Please sign in to comment.