%general-entities; ]> GTK->k4-version; GTK-4 Introduction to GTK 4 The GTK 4 package contains libraries used for creating graphical user interfaces for applications. &lfs122_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: >k4-md5sum; Download size: >k4-size; Estimated disk space required: >k4-buildsize; Estimated build time: >k4-time; GTK 4 Dependencies Required , , , , , , , , and Recommended (default for some gtk4 settings keys), , , (runtime, built with ), (needed for tests and for defaults), and , and Recommended (Required if building GNOME) &gobject-introspection; and , Optional (for some tests), , , , , (runtime, only used by gtk4-demo for syntax highlighting of demo source code), , , , cpdb, pydbus (for some tests), and sysprof Installation of GTK 4 Install GTK 4 by running the following commands: mkdir build && cd build && meson setup --prefix=/usr \ --buildtype=release \ -D broadway-backend=true \ -D introspection=enabled \ -D vulkan=enabled \ .. && ninja If you have installed and wish to build the API documentation for this package, issue: sed "s@'doc'@& / 'gtk->k4-version;'@" -i ../docs/reference/meson.build && meson configure -D documentation=true && ninja To run the tests, issue: LIBGL_ALWAYS_SOFTWARE=1 \ dbus-run-session meson test --setup x11 --no-suite needs-dmabuf If you are in a Wayland session, replace the two occurences of x11 with wayland. One test is known to fail if Cantrell fonts are not installed. About a dozen of tests are known to fail with minor (mostly invisible) differences between the render output and the shipped reference image. Issue grep 'not ok' meson-logs/testlog-x11.txt -B3 (use testlog-wayland.txt if testing in a Wayland session) to list them and the image files showing the render output, the reference output, and the differences. You may take a look at those images to ensure the differences are insignificant. Two headless tests are known to fail without the external dependency pydbus installed. Many tests will fail if ~/.config/gtk-4.0/settings.ini exists and the gtk-modules line is not commented out. Several other tests may fail for unknown reason. On systems with NVIDIA graphics cards, the tests may take significantly longer than the above test time. Now, as the root user: ninja install Command Explanations -D broadway-backend=true: This switch enables the HTML5 GDK backend. -D introspection=enabled: This switch enables using GObject Introspection to generate GIR bindings of this packages. These bindings are required by GNOME. : Use this switch if you have installed and wish to enable support for cloud providers in a file chooser window. : Use this switch if you have installed and wish to use search functionality when running a file chooser. : Use this switch if you have installed and wish to use colord with the CUPS printing backend. : Use this switch if you have installed and wish to generate the man pages. : Use this switch if you have sysprof installed and wish to enable tracing support for GTK4-based applications. : Use this switch instead of -D vulkan=enabled if you don't have or installed. It will disable the Vulkan backend that the upstream prefers to use on Wayland-based graphical environments. LIBGL_ALWAYS_SOFTWARE=1: Force the test suite to use the softpipe or llvmpipe driver from Mesa. The test suite is so sensitive that the minor differences caused by a different Mesa driver can trigger test failures. --no-suite dmabuf: Disable the tests requiring /dev/udmabuf. This file does not exist if the feature is not enabled in the kernel configuration, and even if it exists it cannot be accessed as unprivileged users. Configuring GTK 4 Config Files ~/.config/gtk-4.0/settings.ini and /usr/share/gtk-4.0/settings.ini ~/.config/gtk-4.0/settings.ini /usr/share/gtk-4.0/settings.ini Configuration Information GTK 4 themes change the way a GTK 4 application looks. An icon theme can be used to change the icons that appear on the application's toolbar. If you have installed a GTK 4 theme (e.g. the Adwaita theme built in GTK 4), an icon theme (such as ) and/or a font (), you can set your preferences in ~/.config/gtk-4.0/settings.ini, or the default system-wide configuration file (as the root user), in /usr/share/gtk-4.0/settings.ini. For the local user, an example is: mkdir -pv ~/.config/gtk-4.0 cat > ~/.config/gtk-4.0/settings.ini << "EOF" [Settings] gtk-theme-name = Adwaita gtk-icon-theme-name = oxygen gtk-font-name = DejaVu Sans 12 gtk-cursor-theme-size = 18 gtk-xft-antialias = 1 gtk-xft-hinting = 1 gtk-xft-hintstyle = hintslight gtk-xft-rgba = rgb gtk-cursor-theme-name = Adwaita EOF There are many settings keys, some with default values. You can find them at Settings: GTK 4 Reference Manual. Contents Installed Programs Installed Libraries Installed Directories gtk4-broadwayd, gtk4-builder-tool, gtk4-demo, gtk4-demo-application, gtk4-encode-symbolic-svg, gtk4-icon-browser, gtk4-launch, gtk4-node-editor, gtk4-print-editor, gtk4-query-settings, gtk4-update-icon-cache, and gtk4-widget-factory libgtk-4.so /usr/include/gtk-4.0, /usr/lib/gtk-4.0, and /usr/share/gtk-4.0 Short Descriptions gtk4-broadwayd provides support for displaying GTK 4 applications in a web browser using HTML5 and web sockets gtk4-broadwayd gtk4-builder-tool performs various operations on GtkBuilder .ui files gtk4-builder-tool gtk4-demo is a simple program that demonstrates some of the tasks that can be done with GTK 4 gtk4-demo gtk4-demo-application is a simple GTK 4 application which is useful for testing gtk4-demo-application gtk4-encode-symbolic-svg converts symbolic SVG icons into special PNG files. GTK 4 can load and recolor these PNGs, just like original SVGs, but loading them is much faster gtk4-encode-symbolic-svg gtk4-icon-browser is a utility to explore the icons in the current icon theme. It shows icons in various sizes, their symbolic variants when available, as well as a description of the icon and its context gtk4-icon-browser gtk4-launch launches an application using the given name. The name should match the application .desktop file name (as seen in /usr/share/applications), with or without the '.desktop' extension gtk4-launch gtk4-node-editor is a utility to show and edit render node files. Such render node files can be obtained e.g. from the GTK inspector gtk4-node-editor gtk4-print-editor is a simple program to demonstrate printing using GTK 4 applications gtk4-print-editor gtk4-query-settings provides a complete listing of all settings related to GTK 4 gtk4-query-settings gtk4-update-icon-cache is an icon theme caching utility that creates mmap()able cache files for icon themes gtk4-update-icon-cache gtk4-widget-factory is a program to view GTK 4 themes and widgets gtk4-widget-factory libgtk-4.so contains functions that provide an API to implement graphical user interfaces libgtk-4.so