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
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
News
-
KDE Plasma 6 Looks to Bring Basic HDR Support
The KWin piece of KDE Plasma now has HDR support and color management geared for the 6.0 release.
-
Bodhi Linux 7.0 Beta Ready for Testing
The latest iteration of the Bohdi Linux distribution is now available for those who want to experience what's in store and for testing purposes.
-
Changes Coming to Ubuntu PPA Usage
The way you manage Personal Package Archives will be changing with the release of Ubuntu 23.10.
-
AlmaLinux 9.2 Now Available for Download
AlmaLinux has been released and provides a free alternative to upstream Red Hat Enterprise Linux.
-
An Immutable Version of Fedora Is Under Consideration
For anyone who's a fan of using immutable versions of Linux, the Fedora team is currently considering adding a new spin called Fedora Onyx.
-
New Release of Br OS Includes ChatGPT Integration
Br OS 23.04 is now available and is geared specifically toward web content creation.
-
Command-Line Only Peropesis 2.1 Available Now
The latest iteration of Peropesis has been released with plenty of updates and introduces new software development tools.
-
TUXEDO Computers Announces InfinityBook Pro 14
With the new generation of their popular InfinityBook Pro 14, TUXEDO upgrades its ultra-mobile, powerful business laptop with some impressive specs.
-
Linux Kernel 6.3 Release Includes Interesting Features
Although it's not a Long Term Release candidate, Linux 6.3 includes features that will benefit end users.
-
Arch-Based blendOS Features Cool Trick
If you're looking for a Linux distribution that blends Linux, Android, and web apps together, blendOS might be what you're looking for.