fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.99k stars 1.39k forks source link

Ability to turn off re-scaling when a window moves between monitors #5164

Open dweymouth opened 1 month ago

dweymouth commented 1 month ago

Checklist

Is your feature request related to a problem?

See the details here - https://github.com/dweymouth/supersonic/issues/489 some users of Fyne apps find the auto-scaling when windows move between monitors jarring and would like to be able to disable it.

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

An API or environment variable setting for disabling re-scaling of windows when moved between monitors. They should keep the same pixel size.

andydotxyz commented 3 weeks ago

They should keep the same pixel size.

To be progressed further this needs to be nailed down. What is the right pixel size - the one on the origin monitor, the one on the primary monitor or a simple 1:1 hard coded size?

dweymouth commented 3 weeks ago

Maybe @ccoenen (reported the issue in Supersonic) would like to weigh in?

ccoenen commented 3 weeks ago

I realize this is probably a preference thing, but personally I'm very used to windows changing their visible sizes across very different monitors (while at the same time keeping their physical-pixel size the same). I've been running two monitors since CRTs were standard. Personally, I would run this at "same pixel dimensions" even if the monitors were quite far apart in pixel-per-inch.

I'm not arguing that this must be the default or anything. But in the ticket I also mention that setting FYNE_SCALE=1.0 ENV-var doesn't change this behaviour for me.

In my current setup, both monitors have the same 1.0 scale factor set in GNOME. One is a 34" monitor with 3440x1440 pixels, one is a 14" monitor with 1920x1080 pixels. Yes they have different pixels per inch. No I do not mind. When I move the window across the dividing line, this is how that looks in a screen recording:

It looks pretty similar to what Windows does when two monitors are set up with different scale-settings.

andydotxyz commented 5 days ago

while at the same time keeping their physical-pixel size the same

I am not certain we are talking about the same thing - the "pixel size" is in the hardware, we cannot keep it consistent across displays - we adapt to try and "fake" a consistency.

Can I check with this illustration to check we are talking same thing. A screen that is 1080p and a 4k, where both are the same size (27"). When you drag a window from one screen to the other should they:

1) be the same physical size 2) be 1/4 the area when dragged from 1080p to 4k?

I wonder if the window size and content scaling are being considered separately. Just ensuring we are consistent with terminology so we don't try to figure out a change on the wrong aspect.

ccoenen commented 4 days ago

I'm talking about the number of rendered pixels. I'm aware that these pixels will physically have different dimensions and that the window will therefore appear visually at different sizes.

Effectively: I want a 500x500 pixel thing to be 500x500 pixels, which would visually appear slightly larger on my slightly lower PPI screen and slightly smaller on my slightly higher PPI screen. It is fine that this is visually slightly different. I know that pretty much any window I drag across these two monitors will visually appear differently.

I don't want my 500x500 pixel window to be displayed at some odd number of pixels on one of them. I MOST OF ALL don't want it to make jumps in size the instant I drag it over the dividing line.

In short: For me, it should be 2.

Yes, I'm aware you probably put a lot of work in the automatic resizing. I just would prefer not to use it. I don't want you to throw it away or change anything dramatically, I just want to opt out.

andydotxyz commented 2 days ago

Thanks for the clarity - I know we are on the same page now. It's not something we can support in the general sense as most OS just don't work that way, but I suspect we can squeeze a Linux/Unix specific user override to turn off the scaling.

ccoenen commented 1 day ago

I am not sure we are on the same page, because what I'm asking is the default behaviour for literally every other software that I use? I have never encountered another program that does these kinds of jumps on any of my setups?

The most closely resembling thing would be windows with different scale factors on different monitors - there it performs a somewhat similar jump in size. But I'm not on windows AND my monitors are set to the same scale factor.

andydotxyz commented 3 hours ago

But I'm not on windows AND my monitors are set to the same scale factor.

OK, so the "scale factor" is not a standard linux feature - but it is available to query as a standard on macOS and Windows, this is the main difference. Fyne scaling is aiming to keep your apps consistent - like other operating systems do. This is not standard for linux apps as there is not a standard.

Depending on your desktop there will be different defaults - and apps from a different system will not necessarily respect the same defaults. Can you be more specific with details of what desktop system you are using, how you have set up these scaling factors, and which apps you are referring to which behave as expected?