gtk3-nocsd icon indicating copy to clipboard operation
gtk3-nocsd copied to clipboard

Not working for gtk-4 applications

Open cquike opened this issue 2 years ago • 6 comments

Hi, I am using Debian bookworm and it seems that gtk3-nocsd, which I have been using for years, works for some applications but not for others. I then realized that the ones where it doesn't are those ones which depend on gtk-4. I guess that as the name of the project implies it will work only for gtk-3, but I wonder if there is an option to disable CSD also for gtk-4.

cquike avatar Apr 30 '22 05:04 cquike

This still seems to be happening, I am testing with Dino in Debian Bookworm which now uses gtk 4 and it looks like this:

image

Luticus avatar Mar 15 '23 18:03 Luticus

This still seems to be happening, I am testing with Dino in Debian Bookworm which now uses gtk 4 and it looks like this:

Not surprised. GTK-3 theming broke after the emergence of GTK-4 and one had to use adw-gtk3 to fix compatibility. So, if you want to stick with no-CSD, the code has to be based on the standard GTK-4 theming (or maybe libadwaita?). As the app name suggests, gtk3-nocsd manipulates GTK-3, not GTK-4.

ferroson avatar Jun 28 '23 06:06 ferroson

NoCSD for GTK4 apps are also possible with this simple patch. Although hiding window controls in the apps require more work than that.

image

onurmercury avatar Nov 09 '23 17:11 onurmercury

Thank you. It would be great to have a solution that does not require recompilation, but thank you anyway! BTW, could gtk3-nocsd redefine gtk_window_enable_csd() and preload it? I guess this is what it is already doing for GTK3 applications, right? Just wondering... Thank you!

cquike avatar Nov 09 '23 21:11 cquike

Hello. I wrote a nocsd solution based on libX11. If you are a Wayland user, you need to set the environmental variable 'GDK_BACKEND=x11'. It will force you to use XWayland instead of native wayland.

https://gitlab.com/sulincix/xnocsd

Note: Only works with X11 backend. does not work on python applications (because of pygobject stuff)

Note: This is experimental. may break your system.

Edit: if set LD_PRELOAD globally python applications works...

sulincix avatar Dec 20 '23 07:12 sulincix

It works great under XFCE! It also works for gnome-music which is a python application. And all that in a few dozens lines of code. Awesome!

cquike avatar Dec 20 '23 07:12 cquike