[Commits] [wesnoth/wesnoth] 667064: Experimental MP lobby: scroll to selected game les...

GitHub noreply at github.com
Sat Oct 1 09:04:45 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 667064a8af6d6d65d7af981edc2a7fbe4cc8ba16
      https://github.com/wesnoth/wesnoth/commit/667064a8af6d6d65d7af981edc2a7fbe4cc8ba16
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-10-01 (Sat, 01 Oct 2016)

  Changed paths:
    M src/gui/widgets/generator.hpp
    M src/gui/widgets/listbox.cpp

  Log Message:
  -----------
  Experimental MP lobby: scroll to selected game less often

The lobby calls tlistbox::set_row_shown() every single time there is *any*
change in the gamelist. Most of the time, the visibility of rows hasn't
even changed.

Tlistbox::set_row_shown() calls content_resize_request() to determine if
twindow::invalidate_layout() needs to be called. Content_resize_request()
unconditionally calls show_content_rect() that checks if the selected item
is visible and scrolls to it if it isn't.

With this commit, set_row_shown() returns early if visibility of rows
hasn't changed. This reduces the frequency of scrolling.

This commit isn't a complete fix, since the selected game will still come
into view when, for example, a new game is created. However, at least this
improves the situation.





More information about the Commits mailing list