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

CSD minimize, maximize, close buttons exists despite unset GTK_CSD #82

Closed
Flashwalker opened this issue Oct 27, 2022 · 25 comments
Closed
Labels
support Troubleshooting and advice

Comments

@Flashwalker
Copy link

Flashwalker commented Oct 27, 2022

Bug Description

CSD minimize, maximize, close buttons exists despite GTK_CSD=0

UPD: despit unset GTK_CSD

Apps affected: eog, geary

Expected Behaviour

No CSD minimize, maximize, close buttons

Screenshots

image

Environment

  • OS: Pop_Os! 22.04
  • Desktop Environment: xfce
  • gtk3-classic Version: 3.24.33-2classic22.04
@Flashwalker Flashwalker added help wanted patch bug A specific patch is causing this problem labels Oct 27, 2022
@lah7
Copy link
Owner

lah7 commented Oct 27, 2022

That's expected. From the README:

You can enable CSDs by setting GTK_CSD=0 environment variable (or GTK_CSD=1 to force CSDs on each GTK3 window).

Despite the contrary, it's the presence of the GTK_CSD environment variable is what enables them. Setting it to 1 apparently forces them on every window.

You'll want to remove that variable like so:

unset GTK_CSD

That said, disabling CSD might be buggy with newer GNOME apps (#32). Personally, I downgraded/pinned them to their older version. Your mileage may vary. Consider alternate apps, like Eye of MATE instead of Eye of GNOME.

@lah7 lah7 added support Troubleshooting and advice and removed patch bug A specific patch is causing this problem help wanted labels Oct 27, 2022
@Flashwalker
Copy link
Author

Noup, unsetting doesn't helps.
And i found that almost all gnome apps affected: baobab, gnome-system-monitor, gnome-disks, gnome-calendar, gnome-calculator, gnome-logs, nautilus, org.gnome.Weather, celluloid

@mid-kid
Copy link

mid-kid commented Oct 28, 2022

in .config/gtk-3.0/settings.ini:

gtk-decoration-layout = menu:

@Flashwalker
Copy link
Author

gtk-decoration-layout = menu:

Noup, doesn't helps

@mid-kid
Copy link

mid-kid commented Nov 19, 2022

works for me ¯\_(ツ)_/¯

@Flashwalker
Copy link
Author

Recently GNOME gayvelopers changed theming. Ruining as always

@leuchtrakete666
Copy link

leuchtrakete666 commented Nov 21, 2022

works for me also. its important to set the file to ro. otherwise its overwritten on new login.

@Flashwalker
Copy link
Author

well, i still have gtk-decoration-layout=menu: line in file and it doesn't helps

@leuchtrakete666
Copy link

remove the :

@Flashwalker
Copy link
Author

remove the :

just tested, no luck

@mid-kid
Copy link

mid-kid commented Nov 23, 2022

I just switched to wayland, and I'm seeing exactly what you're saying. Maybe it's because of that?

@Flashwalker
Copy link
Author

I just switched to wayland, and I'm seeing exactly what you're saying. Maybe it's because of that?

don't know, i'm on X

@exuvo
Copy link

exuvo commented Feb 20, 2023

Flashwalker if you are starting your programs from a graphical menu make sure you unset GTK_CSD somewhere early like .xinitrc or /etc/X11/xinit/xinitrc.d so it applies globally. Wayland should have somewhere similar for you mid-kid.
In a terminal unset GTK_CSD followed by starting a gtk3 program in the same terminal session should work.

@Flashwalker
Copy link
Author

@exuvo

In a terminal unset GTK_CSD followed by starting a gtk3 program in the same terminal session should work.

Noup, i tried it.

unset GTK_CSD && gnome-calendar

CSD buttons still exists

@Flashwalker Flashwalker changed the title CSD minimize, maximize, close buttons exists despite GTK_CSD=0 CSD minimize, maximize, close buttons exists despite unset GTK_CSD Feb 21, 2023
@dreirund
Copy link

For me it works that my window manager (xfwm4) does decorate the window, but for this I had to unset GTK_CSD.

@dreirund
Copy link

Noup, i tried it.

unset GTK_CSD && gnome-calendar

I think gnome now is at GTK4 (but I don't know how fast your distribution has catched up; I with Artix Linux have it catched up); can you check the dependencies to verify that this is really a GTK3 app and not a GTK4 app?

gtk3-classic of course does not work with GTK4.

@Flashwalker
Copy link
Author

Flashwalker commented Aug 2, 2023

@dreirund
it is GTK3
GTK_DEBUG=interactive gnome-calendar
2023-08-02_23-57-10

@lah7 lah7 added packaging | Ubuntu Related to the Ubuntu package and removed packaging | Ubuntu Related to the Ubuntu package labels Aug 2, 2023
@lah7
Copy link
Owner

lah7 commented Aug 2, 2023

I just checked my Ubuntu VM and installed gtk3-classic via PPA. I'm not sure of the problem. By default, with an up-to-date Ubuntu MATE 22.04, under Xorg, gnome-calendar looks like this:

GTK_CSD_unset

Yuck, double controls (#32), but at least the window border is working. Equivalent to unset GTK_CSD.

Then with CSDs enabled via export GTK_CSD=0, that works as expected:

GTK_CSD_0

I clarified the README as the way it was originally documented was starting to confuse me.

Please could you confirm the installed package versions and session type?

dpkg -l | grep '~classic' | awk '{print $2,$3}'
env | grep SESSION_TYPE

@Flashwalker
Copy link
Author

@lah7

$ dpkg -l | grep '~classic' | awk '{print $2,$3}'
gir1.2-gtk-3.0:amd64 3.24.33-2~classic~22.04
gtk-update-icon-cache 3.24.33-2~classic~22.04
libgail-3-0:amd64 3.24.33-2~classic~22.04
libgtk-3-0:amd64 3.24.33-2~classic~22.04
libgtk-3-bin 3.24.33-2~classic~22.04
libgtk-3-common 3.24.33-2~classic~22.04
libgtk-3-dev:amd64 3.24.33-2~classic~22.04

$ env | grep SESSION_TYPE
XDG_SESSION_TYPE=x11

@lah7
Copy link
Owner

lah7 commented Aug 3, 2023

I wonder if there is a "local" copy of GTK 3 installed that's overriding the system package. Check with this command:

ldd /usr/bin/gnome-calendar | grep gtk-3

The output should be something like:

libgtk-3.so.0 => /lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f5c52310000)

If the path starts with /usr/local (or something else), then that version of GTK 3 will need removing. This could happen if GTK was once compiled and installed with a command like make install.

@dreirund
Copy link

dreirund commented Aug 3, 2023

it is GTK3

I checked my Arch Linux dependencies, and it depends on gtk3 packages as well as on gtk4 packages. GTK4 example:

gnome-calendarevolution-data-server geoclue geocode-glib-2 gsettings-desktop-schemas libadwaita libedataserverui4 libgweather-4 libsoup3
libadwaitagtk4 libgtk-4.so=1-64

And ldd /usr/bin/gnome-calendar | grep gtk gives gtk4 as well (and no gtk3):

	libgtk-4.so.1 => /usr/lib/libgtk-4.so.1 (0x00007f6138600000)
	libwebkitgtk-6.0.so.4 => /usr/lib/libwebkitgtk-6.0.so.4 (0x00007f6133800000)
	libjavascriptcoregtk-6.0.so.1 => /usr/lib/libjavascriptcoregtk-6.0.so.1 (0x00007f6130e00000)

So it seems gtk4 in my case.

@lah7
Copy link
Owner

lah7 commented Aug 3, 2023

Ubuntu 22.04 ships with gnome-calendar 41.2, which is built with GTK+3. If I'm understanding this issue correctly, @Flashwalker expects to see the window border, but is seeing the CSD header instead. Almost like it's not using the patched GTK+3 library.

Arch Linux's gnome-calendar (currently 44.1) is built on GTK+4, so CSD headers is expected there.

@Flashwalker
Copy link
Author

Flashwalker commented Aug 4, 2023

... If I'm understanding this issue correctly, @Flashwalker expects to see the window border, but is seeing the CSD header instead...

Actually i have the window border with unset GTK_CSD, but also have the CSD
2023-08-04_23-29-01

@lah7
Copy link
Owner

lah7 commented Aug 4, 2023

Unfortunately, this is expected behaviour. See #32.

To summarize, there is a library (libhandy) that apps might use, and that library renders window controls into the app. GTK+3 alone can't patch this out.

Workarounds could be to:

  • Downgrade/pin an older app version.
  • Set GTK_CSD=0 for this app, so it displays as the developer intended.
  • Accept defeat and find alternates
    • Especially GNOME apps, it makes sense for their apps to follow their design guidelines for use on their desktop.

@lah7 lah7 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2023
@Flashwalker
Copy link
Author

Oh, damn gnome vendorlock 😩

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

No branches or pull requests

6 participants