Makie.jl icon indicating copy to clipboard operation
Makie.jl copied to clipboard

GLMakie screens resize after being updated?

Open asinghvi17 opened this issue 3 years ago • 4 comments
trafficstars

Consider the following MWE:

using Makie, GLMakie
using Makie.GeometryBasics

begin
       # this must be larger than the maximal size of a GLMakie window in at least one dimension
       fig = Figure(resolution = (2500, 2500)) 
       screen = display(fig)
       @show GeometryBasics.widths(screen)
       fig.scene.backgroundcolor[] = Makie.to_color(:black)
       @show GeometryBasics.widths(screen)
end

This returns:

GeometryBasics.widths(screen) = (2500, 2500)
GeometryBasics.widths(screen) = (2500, 1942)

showing that the screen renders fine, but then resizes itself when some aspect of the screen is updated. This is a regression from previous behaviour since GLMakie was able to successfully render scenes whose resolution was larger than the display size.

This feature is really useful if one is rendering a scene which needs to be analysed as an image, for example simulating the diffraction pattern of a laser shining through a chamber containing some simulated organism.

asinghvi17 avatar Jun 16 '22 14:06 asinghvi17

Are you sure that this is a regression? I remember that this issue popped up ages ago, and it's pretty much not fixable since it's the window manager who resizes the window... Maybe we can render these still by hiding the window, that'd be worth a try...

SimonDanisch avatar Jun 17 '22 09:06 SimonDanisch

Yeah, the odd thing is that this was working fine for the 3000x3000 px volume plots I was rendering in #2061, which was then dumping the rendered image into a PNG to debug. I could see that the Makie window was larger than the screen then.

Is there a good way to hide the window programmatically? I can try that out and report back.

asinghvi17 avatar Jun 17 '22 11:06 asinghvi17

You should be able to do screen = display(Screen(visible = false), fig).

Is this before or after #1771? Maybe there were some unintentional changes there

ffreyer avatar Jun 17 '22 14:06 ffreyer

Specifically new behaviour after #1771. I will try that out though, thanks!

asinghvi17 avatar Jun 18 '22 03:06 asinghvi17