Search code examples
gtkgnome

What is GSK for, and why are people so amazed by it?


Is GSK a backend change that won't be noticeable (like Wayland for most GTK devs) or will this legitimately change the way we ALL look at and write widgets?

Another question relating to this quote:

Any application which makes use of GTK's graphical control elements (widgets), as opposed to those applications getting a GTK window and then drawing themselves on it, > benefit from GSK.

What does that change for me as an application developer on the GNOME platform?


Solution

  • GTK+ developer, here, and mostly involved in GSK itself.

    GSK is the new rendering API for GTK+ widgets; it uses Cairo and OpenGL, OpenGL ES, or Vulkan, in order to render the widget current state using modern features, like hardware accelerated rendering on the GPU. GSK is part of the GTK+ 4.0 major API bump, which is parallel installable with GTK+ 3.x.

    From an application developer perspective, nothing else is required outside of the general porting effort to use the new GTK+ 4.0 API and drop the API deprecated in GTK+ 3.

    For application and library developers that write their own widgets, the switch to GSK will require changes in how the widget is rendered; the API hasn't stabilised, yet — I'm writing this during the GTK+ 3.9x development cycle — but there are already various convenience API that should make it easy to render CSS states, as well as texture data and Cairo surfaces.