PCMan / gtk3-nocsd

A hack to disable gtk+ 3 client side decoration
GNU Lesser General Public License v2.1
320 stars 41 forks source link

Not working for gtk-4 applications #71

Open cquike opened 2 years ago

cquike commented 2 years ago

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.

Luticus commented 1 year ago

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

ferroson commented 1 year ago

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.

onurmercury commented 8 months ago

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

image

cquike commented 8 months ago

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!

sulincix commented 7 months ago

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...

cquike commented 7 months ago

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!

trip54654 commented 4 hours ago

Reading about this issue, it looks like GNOME is being uncooperative as always, and their anti-social developers are blocking any solutions to this for no reason. The proper solution might be forking GTK and patching the component, which causes this (Gtk.HeaderBar), to properly integrate with server side decorations. But that's very intrusive. Does anyone know if this could be achieved with a GTK plugin messing with the GTK object meta system to replace or override the component in a more lightweight way?