@khurshid-alam
First off please pardon my ignorance as I definitely am a noob when it comes to gtk code.
The code appears to be quite confusing vs the commenting.
/* Hiding GtkHeaderBar when custom title wasn’t set (only for GtkDialog windows) */
Clearly the programmer’s intent is to hide the headerbar if custom_title == NULL but
the code appears to be intended to hide the titlebar. It also appears that they intended
to do this for !GtkDialog instead of for GtkDialog.
This does not make any sense. We should not be getting into the code if we are a GtkDialog.
The only thing that makes sense is if we are not a GtkDialog or it has been renamed or
redefined or something in GTK4 causing us to hide the headerbar wrongly.
Can you clarify this part ? if (custom == NULL && !strcmp(window_type, “GtkDialog”))
-> If custom title is set it will hide the titlebar if isn’t a gtk dialog…So what was the issue here ? OR do you want someting like
if (in_desktop ("Unity") && !strcmp(window_type, “GtkDialog”))
?
Yes. The code simply states that if “custom == NULL and it’s not a GtkDialog hide the titlebar” but
thats not what’s actually happening. For some reason it is hiding the whole headerbar not the
titlebar. Not only that but it’s doing it for Gtkdialog(or were are not using GtkDialog).
Yaroslav’s comment clearly states that his intent is to hide the headerbar not titlebar.
But this code does hide the headerbar for GtkDialog in all cases where custom_title=NULL.
If I comment out this section of code our headerbar is displayed in properly in GtkDialog’s.
Quite confusing…
In short the code make no sense for the outcome we are getting unless we are
no longer are a GtkDialog(.e.g. something else or renaming or what).
It appears from the github page that Yaroslov was trying to fix an issue where
they were displaying a headerbar with only an Icon in it(issue #8). Unfortunately
the fix caused a problem with inappropriately hiding the headerbar(issue #14)
which has been addressed by his latest commit which is where we are at code
wise now.
rijenkii in response to issue #8 mentioned https://github.com/Xfce-Classic/libxfce4ui-nocsd
which addresses CSD issues (does no-csd for Xfce since 4.16):
From the README.md file from the github page:
libxfce4ui-nocsd
This is a fork of libxfce4ui with the explicit goal of removing Client-Side Decorations (CSD).
Currently, functions introduced in somewhere between libxfce4ui 4.15 and 4.16 enable CSD by default for all applications that use the XfceTitledDialog class. This is a rather invasive UI change and, for some, is entirely unwanted. Since, upstream has indicated that they have no intention to allow users to turn CSD off, this fork exists to allow users to disable CSD in any applications that use libxfce4ui.
We implement all CSD-specific functionality as ABI-compatible shims that simply forward to the relevant GtkDialog methods. This allows upstream applications built against upstream libxfce4ui to function with no modifications.
IMPORTANT: libxfce4ui-nocsd will only remove CSDs for applications that use the XfceTitledDialog class. To remove CSDs from any applications that use GTK3 Dialogs, you need to set the DialogsUseHeader
option to false
:
$ xfconf-query -c xsettings -p /Gtk/DialogsUseHeader -s false
This can also be done via the GUI under Settings Editor > xsettings > Gtk
.
So it appears that they have found away to correct the CSD problem with
their own flavor of no-csd that may also work for us on GTK3/4. I will have
to look at/experiment with it to see if it might be a better option for us
than our own branch of gtk3-nocsd. Of course this is future work as
right now we just need to provide no-csd support for GTK4 by Thursday.
Anyway the plot thickens and we just need to figure out how we want to deal
with the issue. Unfortunately until we can understand exactly whats happening
in the code we really can’t address why the code is doing what it’s doing.
For now we can:
1- Remove the offending code or comment it out.
2- put a not Unity check in and bypass the code.
3- Anything you can think of that I haven’t.
So we need to triage this now and investigate other options later.
Luckily we know Yaroslav’s intent by the comment line. Unfortunately
what the code is doing makes no sense at first glance to get the
intended outcome.
I have a deb already made and tested in which the offending code is
commented out and I found documentatation on how to sign the
deb but wasn’t sure if I needed to do it or not.
Sorry for the book but in short the changes are working as intended
but the code makes no sense at all to get the intended outcome.
Hope this makes some sense.
Let me know how you want to proceed