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
-
Linux Kernel Reducing Long-Term Support
LTS support for the Linux kernel is about to undergo some serious changes that will have a considerable impact on the future.
-
Fedora 39 Beta is Now Available for Testing
For fans and users of Fedora Linux, the first beta of release 39 is now available, which is a minor upgrade but does include GNOME 45.
-
Fedora Linux 40 to Drop X11 for KDE Plasma
When Fedora 40 arrives in 2024, there will be a few big changes coming, especially for the KDE Plasma option.
-
Real-Time Ubuntu Available in AWS Marketplace
Anyone looking for a Linux distribution for real-time processing could do a whole lot worse than Real-Time Ubuntu.
-
KSMBD Finally Reaches a Stable State
For those who've been looking forward to the first release of KSMBD, after two years it's no longer considered experimental.
-
Nitrux 3.0.0 Has Been Released
The latest version of Nitrux brings plenty of innovation and fresh apps to the table.
-
Linux From Scratch 12.0 Now Available
If you're looking to roll your own Linux distribution, the latest version of Linux From Scratch is now available with plenty of updates.
-
Linux Kernel 6.5 Has Been Released
The newest Linux kernel, version 6.5, now includes initial support for two very exciting features.
-
UbuntuDDE 23.04 Now Available
A new version of the UbuntuDDE remix has finally arrived with all the updates from the Deepin desktop and everything that comes with the Ubuntu 23.04 base.
-
Star Labs Reveals a New Surface-Like Linux Tablet
If you've ever wanted a tablet that rivals the MS Surface, you're in luck as Star Labs has created such a device.