Skip to content

Commit

Permalink
Make sure the background bubble stays visible on Sailfish OS
Browse files Browse the repository at this point in the history
The background bubble for the long-click menu is drawn by a Canvas
element. Sailfish OS destroys the context for Canvas elements when
application is minimized, so we need to make sure the Canvas is
re-rendered once a context becomes available.
  • Loading branch information
M4rtinK committed Jun 16, 2015
1 parent 2008297 commit a0b999d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/gui_modules/gui_qt5/qml/modrana_components/Bubble.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ Canvas {

onRadiusChanged:requestPaint()

// Sailfish OS destroys the Canvas rendering context
// when the application is minimised, so wee need
// to re-render the canvas once the context is again
// available
onContextChanged: {
if (canvas.context) {
canvas.requestPaint()
} else {
return
}
}

onPaint: {
var ctx = getContext("2d")
ctx.save()
Expand Down

0 comments on commit a0b999d

Please sign in to comment.