Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working for gtk-4 applications #71

Open
cquike opened this issue Apr 30, 2022 · 7 comments
Open

Not working for gtk-4 applications #71

cquike opened this issue Apr 30, 2022 · 7 comments

Comments

@cquike
Copy link

cquike commented Apr 30, 2022

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
Copy link

Luticus commented Mar 15, 2023

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
Copy link

ferroson commented Jun 28, 2023

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
Copy link

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
Copy link
Author

cquike commented Nov 9, 2023

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
Copy link

sulincix commented Dec 20, 2023

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
Copy link
Author

cquike commented Dec 20, 2023

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants