Repository: lutris/lutris

Issue:
AttributeError: type object 'TreeModelSort' has no attribute 'sort_new_with_model'
**Describe the bug**
Lutris is failing to launch with the below error. I am using Python 3.6. Lutris used to work, but it recently started failing. I'm using Gentoo. Maybe this is related to a GTK update. My gtk is version 3.24.13

````
019-12-28 15:25:13,574: Running Lutris 0.5.4
2019-12-28 15:25:13,574: Using X.Org
2019-12-28 15:25:13,574: Running Mesa driver 20.0.0 on Radeon RX Vega (VEGA10, DRM 3.35.0, 5.4.6-gentoo, LLVM 9.0.1) (0x687f)
2019-12-28 15:25:13,574: GPU: 1002:687F 1DA2:E37F using amdgpu drivers
2019-12-28 15:25:13,574: GPU: 1002:6779 174B:E164 using radeon drivers
2019-12-28 15:25:13,588: Vulkan is supported
2019-12-28 15:25:13,589: Updating DXVK versions
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/lutris/gui/application.py", line 173, in do_activate
    self.window = LutrisWindow(application=self)
  File "/usr/lib64/python3.6/site-packages/lutris/gui/lutriswindow.py", line 102, in __init__
    self.game_store = self.get_store()
  File "/usr/lib64/python3.6/site-packages/lutris/gui/lutriswindow.py", line 321, in get_store
    self.show_installed_first,
  File "/usr/lib64/python3.6/site-packages/lutris/gui/views/store.py", line 133, in __init__
    self.modelsort = Gtk.TreeModelSort.sort_new_with_model(self.modelfilter)
AttributeError: type object 'TreeModelSort' has no attribute 'sort_new_with_model'
2019-12-28 15:25:13,774: Updating D9VK versions
````



**Expected behavior**

I expect it to open

**Current behavior**

It doesn't open

**Steps to reproduce**

- 1) Open lutris
-
-

**Lutris debugging output**

The terminal output of `lutris -d`.

Same as above output

**System information**

https://paste.ubuntu.com/p/SzVBJr47sD/

**Screenshots**

Not relevant



Discussion:
You probably want to share information on pygobject and gobject introspection version as well.
pygobject : 3.32.1

gobject-introspection: 1.60.2
I'm able to reproduce this. This happens with x11-libs/gtk+-3.24.13, however after downgrading to 3.24.11 lutris works again.

```
$ emerge --info gtk+
x11-libs/gtk+-3.24.11::gentoo was built with the following:
USE="X cups introspection wayland xinerama (-aqua) -broadway -cloudprint -colord -examples -gtk-doc -test -vim-syntax" ABI_X86="32 (64) (-x32)"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fno-plt -fuse-linker-plugin -tector -pipe"

$ emerge --info lutris
games-util/lutris-0.5.4::gentoo was built with the following:
USE="-test" ABI_X86="(64)" PYTHON_TARGETS="python3_6 python3_7 -python3_5"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fno-plt -fuse-linker-plugin -fno-stack-protector -pipe"
```

I tried to downgrade below packages (on gentoo linux) respectively, but they didn't help lutris work.

* Both dev-libs/gobject-introspection 1.60.2 -> 1.58.3 and dev-libs/gobject-introspection-common 1.60.2 -> 1.58.3
* dev-python/pygobject 3.32.1 -> 3.28.3

I didn't try downgrading all of them at the same time.
I confirm after downgraded x11-libs/gtk+ . Lutris is working again. ( https://bugs.gentoo.org/704130) 

Resolving patch:
diff --git a/lutris/gui/views/store.py b/lutris/gui/views/store.py
--- a/lutris/gui/views/store.py
+++ b/lutris/gui/views/store.py
@@ -140,7 +140,7 @@ def __init__(
         self.prevent_sort_update = False  # prevent recursion with signals
         self.modelfilter = self.store.filter_new()
         self.modelfilter.set_visible_func(self.filter_view)
-        self.modelsort = Gtk.TreeModelSort.sort_new_with_model(self.modelfilter)
+        self.modelsort = Gtk.TreeModelSort.new_with_model(self.modelfilter)
         self.modelsort.connect("sort-column-changed", self.on_sort_column_changed)
         self.modelsort.set_sort_func(sort_col, sort_func, sort_col)
         self.sort_view(sort_key, sort_ascending)


Test patch: