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

widget.ScrollContainer scroll speed is slow #775

Closed
mondy opened this issue Mar 27, 2020 · 41 comments
Closed

widget.ScrollContainer scroll speed is slow #775

mondy opened this issue Mar 27, 2020 · 41 comments
Labels
OS:Linux Tickets affecting only Linux question A question has been asked

Comments

@mondy
Copy link

mondy commented Mar 27, 2020

I used widget.ScrollContainer.
But scroll speed is slow.
Is there an option to increase the amount of movement on the screen for a single mouse wheel movement.
For example, if you specify 2 as an option, I want the movement on the screen to double.

@andydotxyz
Copy link
Member

Can you please provide more information about your operating system, version etc etc. Mouse events like scroll are different for each OS so there isn't much to comment on without those details. The regular bug template asks for these details for a reason :)

@andydotxyz andydotxyz added the question A question has been asked label Mar 27, 2020
@mondy
Copy link
Author

mondy commented Mar 27, 2020

Thank you for the reply.

My environment is as follows.

  • OS: Ubuntu 18.04
  • go version 1.14
  • fyne.io version v1.2.3

@stuartmscott
Copy link
Member

Hey @mondy, can you also provide some information about your ScrollContainer and the content it is scrolling?

Is your issue that ScrollContainer takes too long to update/render after a scroll event, or that you need to scroll many times to get the ScrollContainer to move the amount you want?

@mondy
Copy link
Author

mondy commented Mar 28, 2020

Hey @mondy, can you also provide some information about your ScrollContainer and the content it is scrolling?

Simplified code:

labels := []fyne.CanvasObject{
	widget.NewLabel("aaa"), // Will use icon and label
	widget.NewLabel("bbb"),
	widget.NewLabel("ccc"),
	...
}
layout := layout.NewFixedGridLayout(fyne.NewSize(300, 300))
container := fyne.NewContainerWithLayout(layout, labels...)
scrollContainer := widget.NewScrollContainer(container)

or that you need to scroll many times to get the ScrollContainer to move the amount you want?

That's right.
I need to scroll many times to get the ScrollContainer to move the amount.

@andydotxyz
Copy link
Member

Can you confirm how far, for your computer, it scrolls for each mouse scroll - and how far you expect it to scroll?
Also have you applied any scroll configuration to your desktop or is it as-installed?

@mondy
Copy link
Author

mondy commented Mar 30, 2020

Can you confirm how far, for your computer, it scrolls for each mouse scroll - and how far you expect it to scroll?

It was 12px for fyne and 98px for gtk.
The result of the minimum movement of my mouse wheel.
Gtk was confirmed using the gotk3 golang module.

Also have you applied any scroll configuration to your desktop or is it as-installed?

I think we not have scroll configuration.

@andydotxyz
Copy link
Member

I think we not have scroll configuration.

Sorry, I was meaning have you configured Ubuntu/Gnome? When I compare them on my (Arch linux) system they seem to scroll at the same increment.

@mondy
Copy link
Author

mondy commented Apr 4, 2020

Yes, my desktop environment is GNOME. It as-installed.

@mondy
Copy link
Author

mondy commented May 9, 2020

What is the status of this issue?
Need any additional information?

@andydotxyz
Copy link
Member

I'm not sure what to do. I loaded an Ubuntu instance to test this and other bugs and it worked as expected for me on my mousewheel and touch pad.
Is there anything special about your mouse? Does it have a "resolution" setting on it (i have seen this before).

I have been thinking about it but can't quite think why 98px scroll for a single wheel movement is a sensible default - that's going to be about 6 lines of text isn't it?

@mondy
Copy link
Author

mondy commented Jun 2, 2020

I tried to solve this problem by extending the ScrollContainer widget.
However, the display of the extended widget is strange.
It looks like the expanded widget is placed in the frontmost layer.
Is there a problem with the way the widget is extended?

Try the following code.

package main

import (
	"fyne.io/fyne"
	"fyne.io/fyne/app"
	"fyne.io/fyne/layout"
	"fyne.io/fyne/theme"
	"fyne.io/fyne/widget"
)

// ScrollContainer ScrollContainer
type ScrollContainer struct {
	widget.ScrollContainer
	Rate float64
}

// NewScrollContainer NewScrollContainer
func NewScrollContainer(content fyne.CanvasObject) *ScrollContainer {
	scroll := &ScrollContainer{
		ScrollContainer: widget.ScrollContainer{
			Content:   content,
			Direction: widget.ScrollBoth,
		},
		Rate: 1,
	}
	scroll.ExtendBaseWidget(scroll)

	return scroll
}

// Scrolled Scrolled
func (scroll *ScrollContainer) Scrolled(event *fyne.ScrollEvent) {
	event.DeltaX = int(float64(event.DeltaX) * scroll.Rate)
	event.DeltaY = int(float64(event.DeltaY) * scroll.Rate)
	scroll.ScrollContainer.Scrolled(event)
}

func main() {
	application := app.New()
	window := application.NewWindow("")

	gridLayout := layout.NewFixedGridLayout(fyne.NewSize(100, 100))

	icons := make([]fyne.CanvasObject, 500)
	for i := range icons {
		icons[i] = widget.NewIcon(theme.FyneLogo())
	}

	scroll := NewScrollContainer(fyne.NewContainerWithLayout(gridLayout, icons...))
	scroll.Rate = 3

	top := widget.NewEntry()
	bottom := widget.NewEntry()

	layout := layout.NewBorderLayout(top, bottom, nil, nil)

	window.SetContent(fyne.NewContainerWithLayout(layout, top, bottom, scroll))

	window.ShowAndRun()
}

Environment is as follows.

  • go version go1.14.2 linux/amd64
  • fyne.io/fyne v1.2.4
  • Ubuntu 18.04

@andydotxyz
Copy link
Member

Unfortunately the scrollcontainer widget Currently does not extend well - the drivers perform clipping only on widget.ScrollContainer - we were looking to fix this but other priorities got in the way for 1.3.

I would love to fix this problem within the toolkit, any answers to my previous questions would be helpful. Having read more about GTK scroll it seems they may be accelerating based on screen density as well - perhaps you could confirm what output device (resolution and physical size) you are using?

@mondy
Copy link
Author

mondy commented Jun 2, 2020

I use two monitors side by side.
The screen resolution is 1920x1080 in both cases.
The physical size is about 23 inches for both of them. Do you need the exact size?

@andydotxyz
Copy link
Member

Approximate is fine, thanks. A few other questions that might help:

If you unplug and plug back in your mouse, does the speed of either GTK or Fyne change?

Can you use xinput list to find the ID of the device you are using as a mouse and then send the output for the command xinput list-props <id>?

@mondy
Copy link
Author

mondy commented Jun 2, 2020

I tried it with two mice.

If you unplug and plug back in your mouse, does the speed of either GTK or Fyne change?

Plugging and unplugging both mice did not change them.

Can you use xinput list to find the ID of the device you are using as a mouse and then send the output for the command xinput list-props ?

The output of the command is as follows.

Device 'Logitech M570':
	Device Enabled (147):	1
	Coordinate Transformation Matrix (149):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Natural Scrolling Enabled (285):	0
	libinput Natural Scrolling Enabled Default (286):	0
	libinput Scroll Methods Available (287):	0, 0, 1
	libinput Scroll Method Enabled (288):	0, 0, 0
	libinput Scroll Method Enabled Default (289):	0, 0, 0
	libinput Button Scrolling Button (290):	2
	libinput Button Scrolling Button Default (291):	2
	libinput Middle Emulation Enabled (292):	0
	libinput Middle Emulation Enabled Default (293):	0
	libinput Rotation Angle (294):	0.000000
	libinput Rotation Angle Default (295):	0.000000
	libinput Accel Speed (296):	1.000000
	libinput Accel Speed Default (297):	0.000000
	libinput Accel Profiles Available (298):	1, 1
	libinput Accel Profile Enabled (299):	1, 0
	libinput Accel Profile Enabled Default (300):	1, 0
	libinput Left Handed Enabled (301):	0
	libinput Left Handed Enabled Default (302):	0
	libinput Send Events Modes Available (270):	1, 0
	libinput Send Events Mode Enabled (271):	0, 0
	libinput Send Events Mode Enabled Default (272):	0, 0
	Device Node (273):	"/dev/input/event4"
	Device Product ID (274):	1133, 4136
	libinput Drag Lock Buttons (303):	<no items>
	libinput Horizontal Scroll Enabled (304):	1
Device 'Logitech G502 HERO Gaming Mouse':
	Device Enabled (147):	1
	Coordinate Transformation Matrix (149):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Natural Scrolling Enabled (285):	0
	libinput Natural Scrolling Enabled Default (286):	0
	libinput Scroll Methods Available (287):	0, 0, 1
	libinput Scroll Method Enabled (288):	0, 0, 0
	libinput Scroll Method Enabled Default (289):	0, 0, 0
	libinput Button Scrolling Button (290):	2
	libinput Button Scrolling Button Default (291):	2
	libinput Middle Emulation Enabled (292):	0
	libinput Middle Emulation Enabled Default (293):	0
	libinput Accel Speed (296):	1.000000
	libinput Accel Speed Default (297):	0.000000
	libinput Accel Profiles Available (298):	1, 1
	libinput Accel Profile Enabled (299):	1, 0
	libinput Accel Profile Enabled Default (300):	1, 0
	libinput Left Handed Enabled (301):	0
	libinput Left Handed Enabled Default (302):	0
	libinput Send Events Modes Available (270):	1, 0
	libinput Send Events Mode Enabled (271):	0, 0
	libinput Send Events Mode Enabled Default (272):	0, 0
	Device Node (273):	"/dev/input/event5"
	Device Product ID (274):	1133, 49291
	libinput Drag Lock Buttons (303):	<no items>
	libinput Horizontal Scroll Enabled (304):	1

@andydotxyz
Copy link
Member

Thanks. I notice that both of your mice have acceleration turned up to the maximum, I wonder if this makes a difference

       libinput Accel Speed (296):     1.000000

Is that something that you enabled? And/or what happens if you turn it off (set to 0).

@mondy
Copy link
Author

mondy commented Jun 2, 2020

No, I don't remember setting it up.
I set Accel Speed to 0, but nothing has changed.

@andydotxyz
Copy link
Member

You might need to log out of Gnome and back in again, I don't know how this works myself.
I know it's a big ask but do you have another desktop environment on the same computer that you could log into? I wonder if perhaps Gnome is doing some magic that we can't pin down.

@mondy
Copy link
Author

mondy commented Jun 2, 2020

You might need to log out of Gnome and back in again, I don't know how this works myself.

I can't persist the settings, so I can't try for them after you log out. Sorry.

I know it's a big ask but do you have another desktop environment on the same computer that you could log into? I wonder if perhaps Gnome is doing some magic that we can't pin down.

I don't want to put a new desktop environment on my current Ubuntu. But I can try a desktop environment using VirtualBox, I'd like to choose between Ubuntu flavors, which one is better, Kubuntu (KDE), Xubuntu (Xfce), Lubuntu (LXDE), and more...

@andydotxyz
Copy link
Member

If you are creating a new test environment (thanks) then try to use one as close as possible to your current system as ideally we need to replicate the issue then compare other desktop environments alongside.

@v9n
Copy link

v9n commented Jul 24, 2020

Just to add a data point. I had it fast on desktop but slow on mobile(ios iphone 11)

https://github.com/yeo/bima/blob/master/render/code.go#L189-L224

@andydotxyz
Copy link
Member

@v9n thanks. Are you referring to how many rows move for an down-scroll action, or are you referring to a latency in the view updating when you scroll? What you describe seems more like #1163 which was included in v1.3.2. Let me know if that is what you were describing, and what Fyne version you are using?

@andydotxyz andydotxyz added the OS:Linux Tickets affecting only Linux label Feb 24, 2021
@mythril
Copy link

mythril commented Mar 3, 2021

I noticed a similar problem on my machine in my own widget.Table usage and in the fyne_demo app on the collections demos.

On both host and guest OSes, a single click of my scroll wheel travels about 9px, while other applications scroll about 81px per click.

Host OS:

$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
$ uname -a
Linux ######### 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ go version
go version go1.13.8 linux/amd64
Device 'ELECOM ELECOM TrackBall Mouse':
	Device Enabled (171):	1
	Coordinate Transformation Matrix (173):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Natural Scrolling Enabled (305):	0
	libinput Natural Scrolling Enabled Default (306):	0
	libinput Scroll Methods Available (307):	0, 0, 1
	libinput Scroll Method Enabled (308):	0, 0, 0
	libinput Scroll Method Enabled Default (309):	0, 0, 0
	libinput Button Scrolling Button (310):	2
	libinput Button Scrolling Button Default (311):	2
	libinput Middle Emulation Enabled (312):	1
	libinput Middle Emulation Enabled Default (313):	0
	libinput Rotation Angle (314):	0.000000
	libinput Rotation Angle Default (315):	0.000000
	libinput Accel Speed (316):	0.000000
	libinput Accel Speed Default (317):	0.000000
	libinput Accel Profiles Available (318):	1, 1
	libinput Accel Profile Enabled (319):	1, 0
	libinput Accel Profile Enabled Default (320):	1, 0
	libinput Left Handed Enabled (321):	0
	libinput Left Handed Enabled Default (322):	0
	libinput Send Events Modes Available (290):	1, 0
	libinput Send Events Mode Enabled (291):	0, 0
	libinput Send Events Mode Enabled Default (292):	0, 0
	Device Node (293):	"/dev/input/event8"
	Device Product ID (294):	1390, 251
	libinput Drag Lock Buttons (323):	<no items>
	libinput Horizontal Scroll Enabled (324):	1
Device 'SynPS/2 Synaptics TouchPad':
	Device Enabled (171):	1
	Coordinate Transformation Matrix (173):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Tapping Enabled (325):	1
	libinput Tapping Enabled Default (326):	0
	libinput Tapping Drag Enabled (327):	1
	libinput Tapping Drag Enabled Default (328):	1
	libinput Tapping Drag Lock Enabled (329):	0
	libinput Tapping Drag Lock Enabled Default (330):	0
	libinput Tapping Button Mapping Enabled (331):	1, 0
	libinput Tapping Button Mapping Default (332):	1, 0
	libinput Natural Scrolling Enabled (305):	0
	libinput Natural Scrolling Enabled Default (306):	0
	libinput Disable While Typing Enabled (333):	1
	libinput Disable While Typing Enabled Default (334):	1
	libinput Scroll Methods Available (307):	1, 1, 0
	libinput Scroll Method Enabled (308):	1, 0, 0
	libinput Scroll Method Enabled Default (309):	1, 0, 0
	libinput Click Methods Available (335):	1, 1
	libinput Click Method Enabled (336):	1, 0
	libinput Click Method Enabled Default (337):	1, 0
	libinput Middle Emulation Enabled (312):	0
	libinput Middle Emulation Enabled Default (313):	0
	libinput Accel Speed (316):	0.000000
	libinput Accel Speed Default (317):	0.000000
	libinput Left Handed Enabled (321):	0
	libinput Left Handed Enabled Default (322):	0
	libinput Send Events Modes Available (290):	1, 1
	libinput Send Events Mode Enabled (291):	0, 0
	libinput Send Events Mode Enabled Default (292):	0, 0
	Device Node (293):	"/dev/input/event6"
	Device Product ID (294):	2, 7
	libinput Drag Lock Buttons (323):	<no items>
	libinput Horizontal Scroll Enabled (324):	0

Guest OS:

Edition	Windows 10 Enterprise Evaluation
Version	20H2
Installed on	‎1/‎18/‎2021
OS build	19042.804
Experience	Windows Feature Experience Pack 120.2212.551.0
$ go version
go version go1.13 windows/amd64

@andydotxyz
Copy link
Member

You mention guest and host OS @mrthrill, but not what technology is connecting them.
I would imagine that if this is visible in both then it relates to how we interpret the hardware events rather than an OS specific issue.

@mythril
Copy link

mythril commented Mar 4, 2021

VirtualBox is the connective tissue @andydotxyz

@andydotxyz
Copy link
Member

OK thanks. I guess I need to try and build out an Ubuntu host to replicate, as my Linux/BSD boxes don't seem to have this

@notAxion
Copy link

notAxion commented Jul 28, 2021

same issue ,
with this env

OS : Windows 10
Build : 19043.1110
Go version : 1.16  windows/amd64
fyne version : v2.0.3

Mouse :

Name : Logitech M170

@zivoy
Copy link
Contributor

zivoy commented Aug 29, 2021

OS Name:                   Microsoft Windows 10 Home
OS Version:                10.0.19043 N/A Build 19043

go version go1.16.7 windows/amd64
fyne version v2.0.4

using a mouse scroll wheel 

May I suggest adding dynamic scrolling? So it can scrolls more when you scroll faster, while still letting you have precision while scrolling slowly.
But a scroll step multiplier will also work

@andydotxyz
Copy link
Member

Can you perhaps compare to another windows app please @zivoy?
Is your monitor a HiDPI display?

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Aug 31, 2021
a simple approach to try and adjust for expectatios for faster-than-hardware scrolling.
Fixes fyne-io#775
@andydotxyz
Copy link
Member

If you are able please test #2420 as it may provide the sort of adjustment you're looking for

@zivoy
Copy link
Contributor

zivoy commented Sep 1, 2021

@andydotxyz my display is 1080p

Also, here are some gifs of scrolling in different apps. I first went one "click" of the mouse at a time, then scrolled quickly

GoLand

goland scrolling

Discord

discord scrolling

Fyne file browser

fyne scrolling

Fyne vscroll container

fyne scrolling

In the cases of both the fyne file browser and the scroll container, the scrolling steps are very small when I spin the wheel just one position, and it takes way too many spins to get to the bottom of the page.
compared to the other apps that move way more, 3 lines per position in GoLand, and about a message and a half in Discord. The text editing field here on GitHub in firefox goes 5 lines for 1 position.

with #2420 there is an improvement. The scrolling now feels smoother and less jumpy. but the steps are still small, and it still takes many scrolls to get to the bottom of the page. whereas in the other apps I just have to scroll a bit quicker and it reaches the bottom faster.

Fyne vscroll container (with #2420)

fynescrolling
not sure how well this is coming across in the gif

@andydotxyz
Copy link
Member

In the cases of both the fyne file browser and the scroll container, the scrolling steps are very small when I spin the wheel just one position, and it takes way too many spins to get to the bottom of the page.

What sort of mouse are you using? When I scroll mine by the smallest amount it moves by 1px in all apps (macOS and Windows). This "precision scroll" is what we want to support, whilst allowing faster scroll when needed.

@zivoy
Copy link
Contributor

zivoy commented Sep 1, 2021

My mouse is a t7 thunderbird.
I understand the need for precision scrolling. It's just I find that I need an excessive amount of scrolling to get to the bottom of a very short page with the current settings

@williambrode
Copy link

I read through this issue but I'm still not sure how to speed up scrolling globally for my app. Is there any solution? Scrolling a table still goes very slowly.

@andydotxyz
Copy link
Member

You might need more info @williambrode are you on latest Fyne, what sort of mouse speeds are not matching your OS etc.
Does it relate to the "smallest step" which was improved in this ticket or something else?

@williambrode
Copy link

williambrode commented Jun 22, 2022

Windows 10, Just upgraded to latest Fyne and still an issue. I don't get what was improved in this ticket but the original request was a way to specify a scroll modifier (like 2 for 2x the speed). Things like chrome, slack, notepad++ seem to move 4 text lines or so per mouse scroll pip. My table in Fyne moves about 1/2 text line per pip, about 8x slower.

@williambrode
Copy link

Ah, I just noticed it happens (very slow scroll) on the left bar on the fyne demo too. In case that helps with tracking it down.

@Czyhandsome
Copy link

I have the same issue with windows 10, fyne version v2.2.2
seems that #2420 didn't solve all the problem that scroll speed is still much lower than other apps (chrome, notepad, pdf, ...)

@andydotxyz
Copy link
Member

Can you tell us anything about your hardware and graphics card @Czyhandsome ? My guess is we have some issue that is taxing a particular graphics configuration...

@Czyhandsome
Copy link

Can you tell us anything about your hardware and graphics card @Czyhandsome ? My guess is we have some issue that is taxing a particular graphics configuration...

Would you please tell me how to collect the hardware and graphics card info that you need?
My graphics card: Intel(R) UHD Graphics 620
Hardware: Lenovo thinkpad T490

@andydotxyz
Copy link
Member

Sorry for the delay I am not hugely familiar with all the ways that windows drivers work - but I think somewhere in the hardware manager there is an about panel for the graphics card / driver - version numbers etc especially if it mentions OpenGL.

However also please update your Fyne version to latest, and then open a new issue instead of continuing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS:Linux Tickets affecting only Linux question A question has been asked
Projects
None yet
Development

No branches or pull requests

9 participants