Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Windows 10) Fullscreen changes my display resolution when showing a dialog. #1832

Closed
hugorosario opened this issue Jan 19, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@hugorosario
Copy link

hugorosario commented Jan 19, 2021

Describe the bug:

On windows 10, setting the app to fullscreen and then showing a dialog with a button click, will change my display resolution to whatever is defined in the window size.
Resolution will only be restored after killing the app or switching to another app.

To Reproduce:

Steps to reproduce the behaviour:

Set the window to fullscreen.
Create and show a dialog inside a button click function.

Example code:

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("FullScreen Test")
	myWindow.Resize(fyne.NewSize(800, 600))
	myWindow.SetFullScreen(true)
	myWindow.SetContent(container.NewCenter(
		widget.NewButton("Show Dialog", func() {
			dialog.NewInformation("Fyne Information", "This is a fyne message dialog you got here.", myWindow).Show()
		})))
	myWindow.ShowAndRun()
}

Device (please complete the following information):

  • OS: Windows 10
  • Version: 20H2 build 19042.746
  • Go version: 1.15.6
  • Fyne version: 1.4.3
@hugorosario hugorosario added the bug Something isn't working label Jan 19, 2021
@andydotxyz andydotxyz added OS:Windows Tickets affecting only Microsoft Windows OS:Linux Tickets affecting only Linux and removed OS:Linux Tickets affecting only Linux OS:Windows Tickets affecting only Microsoft Windows labels Jan 19, 2021
@andydotxyz
Copy link
Member

Turns out this is not platform specific.
The code above replicates it despite the fyne_demo doing the same thing and not showing this issue.

@hugorosario
Copy link
Author

hugorosario commented Jan 19, 2021

I tested this with the fyne_demo in fullscreen mode and also have this issue and not only with dialogs, I just need to change to another section of the demo to replicate this.

@andydotxyz
Copy link
Member

I think I have found a patch. It's not going to make v2.0.0, but if you could test this locally we could get it in 2.0.1 and possibly back-port to 1.4.x.
winfull.diff.txt

@andydotxyz
Copy link
Member

(FYI this seems to only happen when the dialog is larger than the window content, so it may go away if your application has more content)

@hugorosario
Copy link
Author

I think I have found a patch. It's not going to make v2.0.0, but if you could test this locally we could get it in 2.0.1 and possibly back-port to 1.4.x.
winfull.diff.txt

Applied that patch to my package sources and it worked great.
Backporting this into the 1.4.x branch would be great.

Thank you.

@stanislav-janu
Copy link

I have same problem on MacOS and Raspbian... If I click button, then screen resolution has been changed.

fyne 2.0.0

code:

package main

import (
	"fmt"
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
)

func main() {
	app := app.New()
	window := app.NewWindow("Inventura alkoholu")
	window.Resize(fyne.Size{Width: 800, Height: 480})
	window.SetFullScreen(true)

	var i = 0
	label := widget.NewLabel("Test")
	button := widget.NewButton("Test", func() {
		i++
		label.SetText(fmt.Sprintf("kliknuto %dx", i))
	})

	splitView := container.NewVSplit(label, button)
	window.SetContent(splitView)

	window.ShowAndRun()
}

@gmaisto
Copy link

gmaisto commented Jul 20, 2021

Same here with fyne 2.0.3 on Windows 10. Dialogs from a fullscreen window change the screen resolution.

@andydotxyz
Copy link
Member

Wow, this slipped through the cracks somehow. The fix will be in v2.0.4 and v2.1.0

@andydotxyz
Copy link
Member

Available for testing on develop and release/v2.0.x branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants