windowPreview: Subclass a C actor

Move the get_preferred_width/height() and allocate() vfunc
implementations of WindowPreview to C, subclassing the C GObject from
JS.

This gets us another significant performance gain, allocating a
workspace with 20 windows now only takes 1.2 ms.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1743>
This commit is contained in:
Jonas Dreßler
2021-02-25 16:04:30 +01:00
committed by Marge Bot
parent 650e0960a2
commit afb56df55c
4 changed files with 221 additions and 55 deletions

View File

@ -0,0 +1,14 @@
#ifndef __SHELL_WINDOW_PREVIEW_H__
#define __SHELL_WINDOW_PREVIEW_H__
#include <st/st.h>
G_BEGIN_DECLS
#define SHELL_TYPE_WINDOW_PREVIEW (shell_window_preview_get_type ())
G_DECLARE_FINAL_TYPE (ShellWindowPreview, shell_window_preview,
SHELL, WINDOW_PREVIEW, StWidget)
G_END_DECLS
#endif /* __SHELL_WINDOW_PREVIEW_H__ */