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
Black flicker when launching application on external display on Thinkpad T430 #1103
Comments
Thanks for the report. It does look like it could be triggered by the window manager. Would it be possible to add some debug into internal/driver/glfw/window.go to see what the values are in the |
Attached log was captured from The only thing I see in Here are the breakpoints:
Edit: forgot to add: it looks like the problem might be later on. Let me know if there are other breakpoints it would be helpful to check and I can certainly do so. |
Unfortunately I can't see the width/height variables in that output. Can you instead print the two values that are passed into the |
It doesn't look like |
I do hit those breakpoints if I resize the window though, see attached log. Interesting note: CWM seems to think the window's minimum size is 0x0, even though it's clearly taking up more space... maybe Fyne isn't telling Xorg it's window size in a sufficiently convincing fashion? |
Can you please try something for me? If you replace line 494 (approx) in internal/driver/glfw/window.go with: if width == 0 || height == 0 || runtime.GOOS != "darwin" { (i.e. add the runtime check) does it go away? |
This is darwin specific and some linux systems were triggering it by mistake. May fix fyne-io#1103
This is the exact change that I applied: diff --git a/internal/driver/glfw/window.go b/internal/driver/glfw/window.go
index 5ef29458..887a0773 100644
--- a/internal/driver/glfw/window.go
+++ b/internal/driver/glfw/window.go
@@ -487,7 +487,8 @@ func (w *window) resized(_ *glfw.Window, width, height int) {
}
func (w *window) frameSized(viewport *glfw.Window, width, height int) {
- if width == 0 || height == 0 {
+ // if width == 0 || height == 0 {
+ if width == 0 || height == 0 || runtime.GOOS != "darwin" {
return
} It did not work; if I set a break-point there in Delve, that function is never called unless I manually resize the window, but the blacking out / flickering happens even if I don't interact with the window whatsoever. |
OK, thanks. Can you also test the more complete #1138 change please? It contains more things that help with bad resize requests on Linux. |
This did not seem to have any effect. |
:( Can you please add some debug to see what the canvas scale is each time the painter runs? |
diff --git a/internal/painter/gl/painter.go b/internal/painter/gl/painter.go
index 81b785c0..fb5c827f 100644
--- a/internal/painter/gl/painter.go
+++ b/internal/painter/gl/painter.go
@@ -9,6 +9,8 @@ import (
"fyne.io/fyne"
"fyne.io/fyne/internal/driver"
"fyne.io/fyne/internal/painter"
+
+ "github.com/y0ssar1an/q"
)
// Painter defines the functionality of our OpenGL based renderer
@@ -64,6 +66,9 @@ func (p *glPainter) StopClipping() {
}
func (p *glPainter) Paint(obj fyne.CanvasObject, pos fyne.Position, frame fyne.Size) {
+ q.Q(obj)
+ q.Q(pos)
+ q.Q(frame)
if obj.Visible() {
p.drawObject(obj, pos, frame)
} With me resizing the window manually: And with me just letting it sit and not touching it: |
Indeed, seems the object tree is fine. |
diff --git a/internal/driver/glfw/canvas.go b/internal/driver/glfw/canvas.go
index f5048bb8..b38a2f01 100644
--- a/internal/driver/glfw/canvas.go
+++ b/internal/driver/glfw/canvas.go
@@ -14,6 +14,7 @@ import (
"fyne.io/fyne/internal/painter/gl"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
+ "github.com/y0ssar1an/q"
)
// Declare conformity with Canvas interface
@@ -389,6 +390,8 @@ func updateLayout(objToLayout fyne.CanvasObject) {
}
func (c *glCanvas) paint(size fyne.Size) {
+ q.Q(c)
+ q.Q(size)
if c.Content() == nil {
return
}
diff --git a/internal/painter/gl/painter.go b/internal/painter/gl/painter.go
index 81b785c0..fb5c827f 100644
--- a/internal/painter/gl/painter.go
+++ b/internal/painter/gl/painter.go
@@ -9,6 +9,8 @@ import (
"fyne.io/fyne"
"fyne.io/fyne/internal/driver"
"fyne.io/fyne/internal/painter"
+
+ "github.com/y0ssar1an/q"
)
// Painter defines the functionality of our OpenGL based renderer
@@ -64,6 +66,9 @@ func (p *glPainter) StopClipping() {
}
func (p *glPainter) Paint(obj fyne.CanvasObject, pos fyne.Position, frame fyne.Size) {
+ q.Q(obj)
+ q.Q(pos)
+ q.Q(frame)
if obj.Visible() {
p.drawObject(obj, pos, frame)
}
Interestingly, it seems I cannot reproduce this issue anymore... let me try again with the latest HEAD... |
I grabbed a fresh copy by deleting my local copy and getting a new one with |
Interesting. Let's wait until all the flicker fixes are in and test again, if it's still good we can close this :) |
Sadly, it seems my initial optimism was unfounded. On the other hand, I guess this suggests that there is a regression, since this doesn't reproduce on the main branch? Tested this on develop against fce4b1f. diff --git a/internal/driver/glfw/canvas.go b/internal/driver/glfw/canvas.go
index f5048bb8..24c39c50 100644
--- a/internal/driver/glfw/canvas.go
+++ b/internal/driver/glfw/canvas.go
@@ -14,6 +14,8 @@ import (
"fyne.io/fyne/internal/painter/gl"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
+
+ "github.com/y0ssar1an/q"
)
// Declare conformity with Canvas interface
@@ -389,6 +391,9 @@ func updateLayout(objToLayout fyne.CanvasObject) {
}
func (c *glCanvas) paint(size fyne.Size) {
+ q.Q("internal/driver/glfw/canvas.go:paint()")
+ q.Q(c)
+ q.Q(size)
if c.Content() == nil {
return
}
diff --git a/internal/painter/gl/painter.go b/internal/painter/gl/painter.go
index 7cb065e4..a26b12a1 100644
--- a/internal/painter/gl/painter.go
+++ b/internal/painter/gl/painter.go
@@ -9,6 +9,8 @@ import (
"fyne.io/fyne"
"fyne.io/fyne/internal/driver"
"fyne.io/fyne/internal/painter"
+
+ "github.com/y0ssar1an/q"
)
// Painter defines the functionality of our OpenGL based renderer
@@ -64,6 +66,11 @@ func (p *glPainter) StopClipping() {
}
func (p *glPainter) Paint(obj fyne.CanvasObject, pos fyne.Position, frame fyne.Size) {
+ q.Q("internal/painter/gl/painter.go:Paint()")
+ q.Q(p)
+ q.Q(obj)
+ q.Q(pos)
+ q.Q(frame)
if obj.Visible() {
p.drawObject(obj, pos, frame)
} |
Can you please test |
Tested against fix/1114 and still seeing the same behavior. This was generated with the same logging statements as before: |
This is making no sense - all the size and scale values appear correct. The rendering is happening to the right size so why is it not appearing? In the video above it looks like the content disappears when you move the mouse - is that the case? |
It seems completely un-correlated with mouse activity. If I don't touch the mouse at all, I see the same behavior, and it seems to stay black indefinitely until I resize or move the window (just noticed that moving the window works as well as resizing). The timing seems pretty consistent, roughly one second after the window is opened. |
Interestingly, occluding the window with another window without interacting directly with it will also make the black-out go away. My intuition tells me that it's un-blacking-out to Xorgs event that indicates a region of the window has become visible, since it doesn't go away until a portion of the window goes from occluded to not-occluded. |
The un-occluding I can understand as that does trigger a redraw. I am going to try and set up the same environment and step through as my logic isn't strong enough. |
To be clear: mouse move does not affect anything unless it’s to resize or move the window. Just mousing over or hovering does nothing. If you want to replicate my exact environment, I have provisioning scripts here. My CWM fork is here. You should be able to run |
I cannot replicate this with vanilla CWM - can you? |
After working with @andydotxyz and others in #fyne-contributors, these are our findings:
For the record, here is some further information on the affected system: Output of Output of
Output of
Output of Output of |
As discussed taking blocker off this issue as we cant replicate on any other computer currently. |
Confirming that this still occurs in the v1.3.1 release where 7f83254 is included. Tested by doing |
Edit: This issue previously referenced CWM, it seems that the window manager is unrelated. See this comment for an update.
Describe the bug:
When any Fyne application is first launched on Ubuntu 20.04, it renders for an instant, then turns black. Resizing the window makes it resume working in perpetuity.
To Reproduce:
Run any Fyne program.
Screenshots:
Example code:
I used the example here in the video,
Device (please complete the following information):
I seem to have
fyne@1.2.5
installed inpkg/mod/fyne.io
.The WM used is a custom fork of CWM. It does have partial EWMH support, but it is possible there is some event that is being ignored/not created/etc. that might be confusing Fyne somehow. I only see this behavior with Fyne, no other toolkits/programs. Further supporting this theory, I cannot reproduce this issue under a stock Ubuntu 20.04 installation in VirtualBox. This could also be related to compositing (or lack thereof).
The text was updated successfully, but these errors were encountered: