We use the expressions:
CanvasToLayerY("layer-name",0,0) <-- Top of the screen
CanvasToLayerY("layer-name",WindowWidth,WindowHeight) <-- Bottom
CanvasToLayerX("layer-name",0,0) <-- Left
CanvasToLayerX("layer-name",WindowWidth,WindowHeight) <-- Right
This will reliably give you the edge coordinates of the screen in any "fullscreen mode." Just keep awareness of scaling of the layer involved. I typically use a 0,0 parallax layer such as "UI."
Then just do what LS says above to keep it on screen.