You are not logged in.

#1 2025-08-02 07:30:06

morsmortium
Member
Registered: 2025-08-02
Posts: 11
Website

GTK4-NoCSD

For GTK3 this was available for a long time, the AUR package was taken down at times, so I decided to package it myself so it stays up.
However, in about a week I developed a similar library for GTK4 and libadwaita.
I have packaged it for the AUR as well. Feel free to try it.
https://codeberg.org/MorsMortium/GTK4-NoCSD
https://aur.archlinux.org/packages/gtk4-nocsd-git

Offline

#2 2025-08-02 11:08:17

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,487

Re: GTK4-NoCSD

All standard functions in a PKGBUILD are guaranteed to start in $srcdir .

./Build.sh

This requires users to look at that script to determine if they trust the package .

Also the makedepends you list are for wayland , will the X11 support be included if wayland is detected ?

# If session is X11 or the wayland-scanner commands failed, build for X11 only

Archlinux packages are meant to function systemwide and could be build in a non-gui environment making the session used irrelevant .

Looks to me like you need to make a choice :
A. have one library that supports both X and wayland
B. have a lib for X and another for wayland

Approach B works best with 2 separate packages and will eliminate or reduce the need for checks.
It seems likely that Build.sh will no longer be needed then.

Welcome to archlinux forums.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2025-08-02 11:54:10

morsmortium
Member
Registered: 2025-08-02
Posts: 11
Website

Re: GTK4-NoCSD

The Build.sh script has the same validity of make, cmake and .pro files. In fact it could have been made into a make file, those are scripts as well. So unless you mean to say that make, cmake and .pro files should not be used with pkgbuilds, which are even used in official packages, I am not sure what to say.

Yes, X11 support is always included. In fact the program does not #include or link against X libraries, but as GTK4 depends on these, they are provided. This is the reason they are not listed, GTK4 has everything needed for X.

Sadly, with the way GTK4 is developed, it is not possible to have any kind of wayland support, without building in a wayland session. The needed public API for this was removed, so the build process (contained in Build.sh) guesses the private location of the needed data, the removed API provided. For this, the session is needed. https://gitlab.gnome.org/GNOME/gtk/-/co … 991a59e98d
This is also the reason the Build.sh script will always be needed as well. It not just finds out the session, it finds out the location of this data for the wayland support.

However, a change that I planned I just added, which means that on no session and when this private data is not found, the X11 only version will be built.
And, if the library is built with only X11 support and an application using wayland is preloaded with it, the library will just not do anything. (this was the same previously)

Offline

#4 2025-08-02 12:19:23

morsmortium
Member
Registered: 2025-08-02
Posts: 11
Website

Re: GTK4-NoCSD

After some thinking, what could be done is picking up weston as a build dependency for wayland, running it headless, and making the program that finds out this data structures location use that. Then, it wouldn't be necessary to build it in any session.

Offline

#5 2025-08-02 13:18:41

morsmortium
Member
Registered: 2025-08-02
Posts: 11
Website

Re: GTK4-NoCSD

This is now done, tested with logging out, logging into tty and building with no session running (sddm ran with xorg). It can build the full version with both wayland and X11 support without any desktop session.

Offline

#6 2025-08-04 19:11:52

jeff story
Member
Registered: 2009-05-31
Posts: 238
Website

Re: GTK4-NoCSD

.

Last edited by jeff story (2025-08-04 19:17:13)


Check out my website for info on the Arch Linux Installer

Offline

#7 2025-08-04 19:16:17

NuSkool
Member
Registered: 2015-03-23
Posts: 286

Re: GTK4-NoCSD

I'm doing a build of the AUR package using my own AUR helper script, which builds in an nspawn container, and it stalls:

==> Starting pkgver()...
==> Updated version: gtk4-nocsd-git r12.9f6efad-1
==> Starting build()...
/usr/sbin/weston
Date: 2025-08-04 PDT
[11:45:20.991] weston 14.0.2
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 14.0.2
[11:45:20.991] Command line: weston --socket=GTK4-NoCSD -B headless
[11:45:20.991] OS: Linux, 6.15.9-arch1-1, #1 SMP PREEMPT_DYNAMIC Sat, 02 Aug 2025 01:20:06 +0000, x86_64
[11:45:20.991] Flight recorder: enabled
[11:45:20.991] fatal: environment variable XDG_RUNTIME_DIR is not set.
Refer to your distribution on how to get it, or
http://www.freedesktop.org/wiki/Specifications/basedir-spec
on how to implement it.
Trying known offsets.
Known offset could not be matched, bruteforcing it.

Next I tried building in a clean chroot using 'makechrootpkg -c -r "${CHROOT}" ' and it stalls in same place...

Have you been test building this in a clean chroot and could this be my problem?

Should the script exit upon the:

fatal: environment variable XDG_RUNTIME_DIR is not set.

Edit:

As a followup, it does build in a regular user session, so seems the 'nspawn container' and 'clean chroot' builds are an issue.

Last edited by NuSkool (2025-08-04 19:44:48)


Scripts I Use                                                 :  https://github.com/Cody-Learner
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo    : Intel(R) N95
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics

Offline

#8 2025-08-04 20:40:27

morsmortium
Member
Registered: 2025-08-02
Posts: 11
Website

Re: GTK4-NoCSD

Thank you. I have replicated the issue, fixed it and tested that it builds there too.

Only thing to add that it isn't stalling, when it says it is bruteforcing the offset.
That very well might be part of the build process, if the offset is not known.
I know that it is different in GTK 4.19, which is in  Gnome-Unstable currently.
I could only add the offset of 4.18.6 as that is what I have, and it might be different between micro versions (4.18.5 vs 4.18.6) as this is private data and there is no ABI compatibility guarantee for that.
In regular build it cycles through memory until it finds the correct place and when it does, it prints it and asks the builder to make an issue in my repository with the offset to be added to the known offsets, which are tried first.
This bruteforcing can take minutes, it found the 4.18.6 offset in 2 and a half minutes.

However, all the bruteforcing attempts failed with weston not running so in this case it really didn't do anything of use.

Offline

#9 2025-08-04 21:42:23

NuSkool
Member
Registered: 2015-03-23
Posts: 286

Re: GTK4-NoCSD

Thanks, the fix allows me to use my AUR helper now.
Build output: http://0x0.st/8hZI.txt

Thank you for providing your work as an AUR package as well.

As an Xfce4 user and former 'nocsd for GTK3', looking forward to trying this out.

$ p -Q gtk4-nocsd-git
gtk4-nocsd-git r12.9f6efad-1

$ p -Q --color=never | grep ^gtk[0-9]
gtk2 2.24.33-5
gtk3 1:3.24.49-2
gtk4 1:4.18.6-1

Last edited by NuSkool (2025-08-04 21:56:06)


Scripts I Use                                                 :  https://github.com/Cody-Learner
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo    : Intel(R) N95
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics

Offline

Board footer

Powered by FluxBB