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

v2.4.0-rc2 Frequent clicking on table may cause the program to not respond #4210

Closed
2 tasks done
qiwentaidi opened this issue Sep 1, 2023 · 8 comments
Closed
2 tasks done
Labels
unverified A bug that has been reported but not verified

Comments

@qiwentaidi
Copy link

qiwentaidi commented Sep 1, 2023

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Frequent clicking on table may cause the program to not respond

How to reproduce

run and frequent clicks table widget

Screenshots

image

Example code

package main

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

var (
	ScanResult = [][]string{{"1", "2", "3"}, {"1", "2", "3"}, {"1", "2", "3"}}
)

func main() {
	a := app.New()
	w := a.NewWindow("Table Test")
	t := widget.NewTableWithHeaders(func() (int, int) {
		return 3, 3
	}, func() fyne.CanvasObject {
		return widget.NewLabel("")
	}, func(id widget.TableCellID, o fyne.CanvasObject) {
		if lb, ok := o.(*widget.Label); ok {
			lb.SetText(ScanResult[id.Row][id.Col])
		}
	})
	//t.ShowHeaderRow = true
	w.SetContent(t)
	w.Resize(fyne.NewSize(300, 300))
	w.ShowAndRun()
}

Fyne version

v2.4.0-rc2

Go compiler version

go1.20.1 windows/amd64

Operating system and version

win11

Additional Information

v2.4.0-rc2 widget.table Updated a lot of content,This bug has not occurred before version v2.3.5

@qiwentaidi qiwentaidi added the unverified A bug that has been reported but not verified label Sep 1, 2023
@lostdusty
Copy link
Contributor

Could reproduze the bug!

cmd_v8d4JCoODa.mp4

(i maximized the application to show its frozen)

@jstraarup
Copy link

For me this happens immediately when clicking the row number or column header a single time, but it has not happened when only clicking any of the cells.
On my PC the table is extremely slow to select the cell, and will not select another cell if clicking within ~500 ms after last click (it was also slow before v2.4.0, but it is much slower now) - maybe this is why I do not see exactly the same behavior.

Fyne version: v2.4.0
OS: Gentoo Linux, Wayland, Sway WM

@qiwentaidi
Copy link
Author

For me this happens immediately when clicking the row number or column header a single time, but it has not happened when only clicking any of the cells. On my PC the table is extremely slow to select the cell, and will not select another cell if clicking within ~500 ms after last click (it was also slow before v2.4.0, but it is much slower now) - maybe this is why I do not see exactly the same behavior.

Fyne version: v2.4.0 OS: Gentoo Linux, Wayland, Sway WM

I have also tested on Debian systems, and also has this issue

@hsdfdc
Copy link

hsdfdc commented Sep 2, 2023

the issue also happened when click the table head in fyne_demo

@alexballas
Copy link
Contributor

alexballas commented Sep 19, 2023

It seems that the hang issue when clicking the headers comes down to this method:

func (r *tableCellsRenderer) moveMarker(marker fyne.CanvasObject, row, col int, offX, offY float32, minCol, minRow int, widths, heights map[int]float32) {

It does not handle the cases where either row or col have the value noCellMatch. As a result, the for loop inside this method, run "forever"
Unfortunately I don't know what would the best way to handle this be. @andydotxyz any thoughts?
Btw this happens inside the Tapped method, so the headers are tappable.

Aside the headers hang issue, I could not replicate the issue raised here, in Ubuntu 18.04. Clicking inside the cell, indeed feels slow, but nothing hangs.

@andydotxyz
Copy link
Member

The headers issue is fixed on develop. Could anyone who was able to replicate this before please test that branch now? I suspect the issue is resolved.

@qiwentaidi
Copy link
Author

qiwentaidi commented Sep 21, 2023

The headers issue is fixed on develop. Could anyone who was able to replicate this before please test that branch now? I suspect the issue is resolved.

Yes, I just tested it and it has already fixed it

@andydotxyz
Copy link
Member

Thanks so much, great to hear!

@andydotxyz andydotxyz added this to the D fixes (v2.4.x) milestone Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

6 participants