Skip to content

Commit

Permalink
Fix serach box disappear when set background image
Browse files Browse the repository at this point in the history
We didn't re-paint RootTerminalBox.search_revealer, thus search box
will not show when set background image.

Fix this by re-paint search_revealer.
  • Loading branch information
mlouielu authored and gsemet committed Sep 22, 2021
1 parent 2cfc9b3 commit 986ace8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions guake/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,20 @@ def draw(self, widget, cr):
# Re-paint child draw into child context (which using child_surface as target)
widget.propagate_draw(child, child_cr)

# Step 3.1 Re-paint search revealer
child_sr_surface = None
if getattr(widget, "search_revealer", None):
child_sr = widget.search_revealer
child_sr_surface = cr.get_target().create_similar(
cairo.CONTENT_COLOR_ALPHA,
child_sr.get_allocated_width(),
child_sr.get_allocated_height(),
)
child_sr_cr = cairo.Context(child_surface)

# Re-paint child draw into child context (which using child_surface as target)
widget.propagate_draw(child_sr, child_sr_cr)

# Step 4. Paint child surface into our context (RootTerminalBox)
#
# Before this step, we have two important context/surface
Expand All @@ -464,4 +478,11 @@ def draw(self, widget, cr):
cr.set_source_surface(child_surface, 0, 0)
cr.set_operator(cairo.OPERATOR_OVER)
cr.paint()

# Paint search revealer
if child_sr_surface:
cr.set_source_surface(child_sr_surface, 0, 0)
cr.set_operator(cairo.OPERATOR_OVER)
cr.paint()

cr.restore()

0 comments on commit 986ace8

Please sign in to comment.