And … Action!
Desktop Design with GTK4
The Clapper media player showcases new desktop design features in GTK4.
Free software desktops such as Gnome and KDE are built on top of toolkits that provide support for the graphic elements. Gnome is built on the GTK toolkit. GTK is an important component of many GUI-based Linux systems, and a new release of GTK eventually has implications for all Linux users working in Gnome and other GTK-based desktop systems.
GTK4 [1] was released at the end of 2020, and components that rely on GTK4 have quickly followed, starting with Gnome 40 in March 2021. Recent distributions such as Fedora 34 [2] and Arch Linux already include Gnome 40. Other distributions such as Ubuntu 21.04 [3] include the GTK4 libraries in their package sources but don't use the GTK4-based desktop yet.
In practice, however, GTK4's influence in these distributions is still not very noticeable. For example, the Gnome desktop's extensions app does not look noticeably different, even though it has now been ported to GTK4: It uses the usual widgets, such as buttons, search fields, and fold-out dialogs. If you look at the Widget Factory (see the "Widget Factory" box), a test program that organizes all common widgets in a window, you probably won't notice any outstanding innovations at first glance. However, if you take a look at the animated GTK cube video on the main Widget Factory page, you can see one of the biggest changes between GTK3 and GTK4. Mousing over the video reveals the typical pause and start playback media player buttons. This cube video demonstrates that you now can put graphics or other media elements in the background of almost all window elements [4].
Widget Factory
To import the Widget Factory under Ubuntu 21.04 or Debian Experimental, use the gtk-3-examples and gtk-4-examples packages, respectively. (For Arch Linux, you'll find the example widgets in the gtk3-demos and gtk4-demos packages).
Once you've installed the packages for your distribution, you can call the programs using the gtk3-widget-factory
and gtk4-widget-factory
commands.
As a means of exploring some of the new features in GTK4, this article examines the new Clapper [5] media player, a Gnome desktop tool built using the GTK4 toolkit.
Clapper
The Clapper media player was built using GTK4, so it shows how some of the new GTK4 features work in practice. At first glance, Clapper reminds you of Gnome Video Player, but you will notice that the classic window bar located at the top of the application window is missing (in fact, this hasn't existed in Gnome for some time). GTK4 has pushed the envelope a bit further: The video image covers almost the entire window area, with only the control bar at the bottom remaining permanently visible. The menus can be reached via partially transparent buttons at the top of the window (Figure 1). Clapper only shows the buttons when you mouse over the window.
Clapper has three modes: windowed, full-screen, and floating. The default, windowed mode shows the progress bar and window controls. In windowed mode, Clapper is visible on every virtual desktop on Gnome and will automatically slide from desktop to desktop, remaining in the foreground even when another application is active. In full-screen mode, you can select to hide the progress bar and playback controls. In floating mode (Figure 2), Clapper hides the controls and floats the window on top of other applications; the application window will automatically slide to the currently active desktop in this mode.
Due to its early stage of development, Clapper is not yet available in the package sources of the popular distributions. However, you can find a Flatpak on Clapper's GitHub page [5] that you can install across distributions. Alternatively, the developers provide packages and package sources for Debian, Fedora, and openSUSE [6]. You can also install the DEB package on Ubuntu 21.04 (Listing 1).
Listing 1
Installation on Ubuntu
sudo apt install curl echo 'deb http://download.opensuse.org/repositories/home:/Rafostar/Debian_Unstable/ /' | sudo tee /etc/apt/sources.list.d/home:Rafostar.list curl -fsSL https://download.opensuse.org/repositories/home:Rafostar/Debian_Unstable/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_Rafostar.gpg > /dev/null sudo apt update sudo apt install clapper
Eye Candy for Gnome
Other application developers are also increasingly adopting the possibilities offered by GTK4. For example, the radio receiver Shortwave [7] offers a program display area that adapts fluidly depending on the display width or desktop window size. All of this is proof of Gnome's continuous development towards optimizing itself and the various Gnome applications for use on smartphones or tablets.
Infos
- GTK4: https://blog.gtk.org/2020/12/16/gtk-4-0
- Fedora 34: https://getfedora.org/en/workstation/download/
- Ubuntu 21.04: https://releases.ubuntu.com/21.04/
- Media in GTK4: https://blog.gtk.org/2020/05/20/media-in-gtk-4
- Clapper: https://github.com/Rafostar/clapper
- Download Clapper: https://software.opensuse.org//download.html?project=home%3ARafostar&package=clapper
- Shortwave: https://gitlab.gnome.org/World/Shortwave
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.