Fix mousewheel function

Bug #1386740 reported by GunChleoc
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Notabilis

Bug Description

After the port to SDL2, Panel::do_mousewheel only works for focused elements. We need to fix this, so elements can be scrolled when the mouse hovers over them.

Tags: regression ui

Related branches

tags: added: sdl ui
Revision history for this message
SirVer (sirver) wrote :

could you provide an example that works right now in trunk, but does not work with SDL2?

Changed in widelands:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → build19-rc1
tags: added: regression
Revision history for this message
GunChleoc (gunchleoc) wrote :

Single Player-> New Map. Choose a map that has a long description, so the description's MultilineTextarea will have a scrollbar. Hover the mouse over it and try to scroll.

Revision history for this message
kaputtnik (franku) wrote :

While playing open "Warehelp" "Messages" and "Building statistic". All should have a scrollbar. Play around this windows (activate one after another and use the mousewheel). Sometimes the Window which has the focus before scrolls, not the current activated window. Sometimes the actvated Window do not scroll anymore, even if all other windows are closed. This happens with two windows too.

Scrolling for the new "Build help" window do not work at all.

I have build 7278.

tags: added: mouse
Revision history for this message
kaputtnik (franku) wrote :

May the SDL_GetMouseFocus do the trick: http://wiki.libsdl.org/SDL_GetMouseFocus

Revision history for this message
Notabilis (notabilis27) wrote :

I linked a branch that tries to fix the mouse wheel. It always scrolls the list/text/... under the cursor, independent of the window which has the keyboard focus or which window is in the foreground.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I can't test right now, but the code looks promising. Could you please make a merge request?

Revision history for this message
Notabilis (notabilis27) wrote :

No problem, is done.

Revision history for this message
kaputtnik (franku) wrote :

This is really great !!!

I have tested a bit and found only one little thing: During gameplay i opened the messages menu and another menu. Placing the second menu above the messages menu so that it covers some area of the messages list. Scrolling then with mouse wheel the messages are scrolled.

But in general all is working and this is a great progress. Please make a merge request :-)

Revision history for this message
Notabilis (notabilis27) wrote :

Thanks for testing, should be fixed now. The mouse wheel will now only affect the topmost window at the current mouse position. I also found another bug with modal dialogs (e.g. in the campaign) which is fixed, too.

kaputtnik (franku)
Changed in widelands:
assignee: nobody → Notabilis (notabilis27)
kaputtnik (franku)
Changed in widelands:
status: Confirmed → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Brilliant, thanks for the fix!

GunChleoc (gunchleoc)
tags: removed: mouse sdl
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.