Testing Unity session on Ubuntu 21.10

@khurshid-alam
@rs2009

Ok i give up… I have spent all day researching how to commit the update but I am stuck
on “PROJECT-NAME”.

I already have a launchpad account and user and have generated a ssh key pair and set
it up in my user data. I have setup bzr whoami with my user info and done the
bzr launchpad-login with my lp-userid.

When I try to create the local branch of the project using “bzr branch lp:gtk3-nocsd”
it can’t find the project. Do I need to prefix the package name with Ubuntu or
something?.

Anyway I just need to know what I need to pass “lp” for the PROJECT-NAME.

Any help would be appreciated as I am stuck until I can open the new branch and get
the code down so I can build the debs again and then commit, push and then propose.

As usual any help would be appreciated,

Brett “WolfMan” Bogert

Yes…some of them were moved to gsettings-desktop-schemas…(and unity-settings-daemon using it’s own settings scheama which xsettings plugin is using…but it I think some of them needs to use gsettings-desktop-schema atleast gtk related…I will take a look next cycle)…some of them using ubuntu-desktop-schemas…you can open pull in github repo of tweak-tool.

gtk3-nocsd is imported from debian and source is in github so bzr branch won’t work. For now we can supply new new nocsd in the maintainers ppa. I will create a recipe later. Meanwhile you can read of recipes here. I will give short overview later.

@khurshid-alam

Ok I will start studying up on recipes and do a git pull on tweak tool and
start looking at that as well.

I have a tested binary deb that is ready to go when we are ready or if
someone wants to test it in dropbox and can provide a link if needed.

@khurshid-alam

I think I found the problem with unity-tweak-tool. First off the git-hub version is 3
versions behind what is in the launchpad(0ubuntu4 vs 0ubuntu7). Anyway the
problem was supposed to be fixed by Sebastien Bacher via patch where he changed
the code to take into account the new schema key(see following patch) but did not
change the actual schema we were trying to pull in(which has been deprecated).

So I just need to make a 1 line change in gsettings.py to change to the correct schema
(desktop.interface):

unity-tweak-tool (0.0.7±0ubuntu7) impish; urgency=medium

  • debian/patches/new-fonts-schemas.patch:
    • update to the new gsettings fonts schemas, fix the impish crash
      (lp: #1936747)

– Sebastien Bacher seb128@ubuntu.com Wed, 29 Sep 2021 15:03:23 +0200

actual patch:

Index: unity-tweak-tool-0.0.7+/UnityTweakTool/section/appearance.py

— unity-tweak-tool-0.0.7+.orig/UnityTweakTool/section/appearance.py
+++ unity-tweak-tool-0.0.7+/UnityTweakTool/section/appearance.py
@@ -90,9 +90,9 @@ font_window_title= FontButton({
cbox_antialiasing=ComboBox({
‘id’ : ‘cbox_antialiasing’,
‘builder’ : Appearance.builder,

  • ‘schema’ : ‘org.gnome.settings-daemon.plugins.xsettings’,
  • ‘schema’ : ‘org.gnome.desktop.interface’,
    ‘path’ : None,
  • ‘key’ : ‘antialiasing’,
  • ‘key’ : ‘font-antialiasing’,
    ‘type’ : ‘string’,
    ‘map’ : {‘none’:0,‘grayscale’:1,‘rgba’:2}
    })
    @@ -100,9 +100,9 @@ cbox_antialiasing=ComboBox({
    cbox_hinting=ComboBox({
    ‘id’ : ‘cbox_hinting’,
    ‘builder’ : Appearance.builder,
  • ‘schema’ : ‘org.gnome.settings-daemon.plugins.xsettings’,
  • ‘schema’ : ‘org.gnome.desktop.interface’,
    ‘path’ : None,
  • ‘key’ : ‘hinting’,
  • ‘key’ : ‘font-hinting’,
    ‘type’ : ‘string’,
    ‘map’ : {‘none’:0,‘slight’:1,‘medium’:2,‘full’:3}
    })

So Sebastian changed the schema key names correctly from “antialiasing” to “font-antialiasing”
and “hinting” to “font-hinting” but he did not change the code to point the correct schema in
“UnityTweakTool/section/spaghetti/gsettings.py”

so all I should have to do is change the schema to the correct one in gsettings.py and
it should fix the issue we are seeing.

unity-tweak-tool-0.0.7+/UnityTweakTool/section/spaghetti/gsettings.py

old:

antialiasing = gnome(‘settings-daemon.plugins.xsettings’)

new:

antialiasing = gnome(‘desktop.interface’)

So I am going to go ahead and make the change build a new deb and test it. Do I need a
a bug report to submit against? I will also have to learn how to generate a patch since
this is just a one line change to the code(so I assume we will want to do a patch instead
of a full update).

Thanks,
Brett “WolfMan” Bogert

Sure a bug report with debdiff would be ok. You can submit a debdiff on thr same bug.

Edit: But I think remaing changes in the proposed now. So it will be fixed.

Oh well unity-tweak-tool update in proposed (from apt get updates) does not install.

Problem is the post-install process is failing due to a unexpected EOL in the gsettings.py
file. Either there is a problem with the new version of the patch or something in the
patching code is going haywire(maybe patch vs quilt or something).

Anyway I have found an issue that I missed with the new nocsd code. Evidently we are
removing things(CSD’s) what we shouldn’t.

Correct screenshot:
Screenshot from 2021-10-08 08-09-15

Incorrect screenshot(e.g. with new nocsd);
Screenshot from 2021-10-08 08-18-08

So we have some more work to do before the new nocsd code is ready for prime time.

I am looking at the new .c code now but probably don’t have enough knowledge about the
code itself to do much good but we will see(maybe I’ll have a moment of inspiration and
figure it out).

I am getting the following error when trying to install unity-tweak-tool:

Selecting previously unselected package unity-tweak-tool.
(Reading database … 209562 files and directories currently installed.)
Preparing to unpack …/unity-tweak-tool_0.0.7±0ubuntu8_all.deb …
Unpacking unity-tweak-tool (0.0.7±0ubuntu8) …
Setting up unity-tweak-tool (0.0.7±0ubuntu8) …
/usr/lib/python3/dist-packages/UnityTweakTool/init.py:136: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
assert id is not -1
File “/usr/lib/python3/dist-packages/UnityTweakTool/section/spaghetti/gsettings.py”, line 109
antialiasing = gnome('desktop.interface’)
^
SyntaxError: EOL while scanning string literal

/usr/lib/python3/dist-packages/UnityTweakTool/section/spaghetti/theme.py:155: SyntaxWarning: “is” with a literal. Did you mean “==”?
self.ui[‘check_cursor_size’].set_active(True if gsettings.interface.get_int(‘cursor-size’) is 48 else False)
dpkg: error processing package unity-tweak-tool (–configure):
installed unity-tweak-tool package post-installation script subprocess returned error exit status 1
Processing triggers for bamfdaemon (0.5.5+21.10.20210710-0ubuntu1) …
Rebuilding /usr/share/applications/bamf-2.index…
Processing triggers for desktop-file-utils (0.26-1ubuntu1) …
Processing triggers for hicolor-icon-theme (0.17-2) …
Processing triggers for gnome-menus (3.36.0-1ubuntu1) …
Processing triggers for libglib2.0-0:amd64 (2.68.4-1build1) …
Processing triggers for man-db (2.9.4-2) …
Processing triggers for mailcap (3.69ubuntu1) …
Errors were encountered while processing:
unity-tweak-tool
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up unity-tweak-tool (0.0.7±0ubuntu8) …
/usr/lib/python3/dist-packages/UnityTweakTool/init.py:136: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
assert id is not -1
File “/usr/lib/python3/dist-packages/UnityTweakTool/section/spaghetti/gsettings.py”, line 109
antialiasing = gnome('desktop.interface’)
^
SyntaxError: EOL while scanning string literal

/usr/lib/python3/dist-packages/UnityTweakTool/section/spaghetti/theme.py:155: SyntaxWarning: “is” with a literal. Did you mean “==”?
self.ui[‘check_cursor_size’].set_active(True if gsettings.interface.get_int(‘cursor-size’) is 48 else False)
dpkg: error processing package unity-tweak-tool (–configure):
installed unity-tweak-tool package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
unity-tweak-tool

I bug reported it about 4hrs ago. The bug number is #1946477:

Might be a problem with Sebastian’s patch as the the actual code in gsettings.py
has the closing parenthesis showing pink in gedit instead of white for some
reason.

Thanks,
Brett “Wolfman” Bogert

@khurshid-alam

So I finally got a change to do a in-depth study of the changes in the
new code and found that the code is working as intended.

The problem stems from the following code:

/* Hiding GtkHeaderBar when custom title wasn’t set (only for GtkDialog windows) /
const GtkWidget
custom = gtk_header_bar_get_custom_title(GTK_HEADER_BAR (titlebar));
const gchar* window_type = G_OBJECT_TYPE_NAME(window);
if (custom == NULL && !strcmp(window_type, “GtkDialog”)) {
gtk_widget_hide(GTK_WIDGET (titlebar));
}

For Unity the custom entity(e.g. custom title) will allways be “NULL” so it will always
hide the headerbar for the dialog.

So I commented the code out and it works fine.

I am wondering if there is a method I can call to determine which desktop we are
running and use to bypass this code if the desktop is unity-desktop? If so I can add
the code and test it.

If we are going to be in our own branch(not submitted to upstream) we can probably
get by with just commenting the code out for now.

I am also trying to figure out how I get the build to sign the deb but not having much
success.

Let me know what you want to do as far as the check for desktop(if possible) and any
help with signing the deb would be appreciated.

Thanks

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”)) ?

You can simple use check like in_desktop ("Unity")

static gboolean
in_desktop (const gchar *name)
{
	const gchar *desktop_name_list;
	gchar **names;
	gboolean in_list = FALSE;
	gint i;

	desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
	if (!desktop_name_list)
		return FALSE;

	names = g_strsplit (desktop_name_list, ":", -1);
	for (i = 0; names[i] && !in_list; i++)
		if (g_strcmp0 (names[i], name) == 0) {
			in_list = TRUE;
			break;
		}
	g_strfreev (names);

	return in_list;
}

@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

Perhaps you can show screenshots how the dialog are appearing. Also you can remove the not equal sign if (custom == NULL && strcmp(window_type, “GtkDialog”)) and check if it works for gtk-3.

@khurshid-alam

Screenshots are back up the thread on Oct 8th.

Changing !strcmp to strcmp seems to fix it. Makes sense since he was only trying to
effect GtkDialog’s. Don’t know how “!” got in there but it’s in the original code so
have to assume he just got his logic wrong for some reason.

I kept looking at the code and it clearly could not be working as intended
so removing the “!” was going to be my next step as it was the only thing
that didn’t make sense.

Got to get back to trusting my instincts!

I assume that it would be a good idea to inform Yaroslav of this so he can correct it in
his version(I wonder if it’s even being used or if they used the new libxfce4ui-nocsd
lib instead).

Are we going to commit this or wait till things calm down after release? I am going
to put the deb into my build and can make it available via dropbox for anyone that
wants or needs it if we want to hold off until after release.

I also noticed that my unity-tweak-tool bug was screened(#1946477) so we should
hopefully get a working version of that soon also.

Anyway thanks again

1 Like

@khurshid-alam
@rs2009
@Michael

Well we got the updated version of Unity Tweak and it installs but is still not working.

I opened bug report #1946794 to track the issue which is a GLib-GIO-ERROR because
there are still references to “antialiasing” in theme.py(should be font-aliasing and
font-hinting per new schema).

Just wanted to let every one know

Any news on the double title bar and tweak tool situation ? Really hope that unity lasts beyond 22.04.

1 Like

@khurshid-alam @bbogert24

It should be possible to just replace all occurrences (there are 3 of them) of if gsettings.antialiasing.get_string('antialiasing') with if gsettings.antialiasing.get_string('font-antialiasing') and if gsettings.antialiasing.get_string('hinting') with if gsettings.antialiasing.get_string('font-hinting') in /usr/lib/python3/dist-packages/UnityTweakTool/section/spaghetti/theme.py (in the Unity-Tweak-Tool folder in the package)

@khurshid-alam @rs2009

Sorry I’m taking so long but my computer started acting up with black screen
of death and spurious reboots and it took me quite a while get it back up.

rs2009 is correct there are 3 more antialiasing and 4 hinting changes need to
be done and then tested. Unfortunately my lack of familiarity with the dev
process is slowing me down. Since the deb has been patched I assume that
the last 7 changes need to be patched also so I need to become familiar with
the patching process. I pulled documentation for this but did not get a chance
to get into in before my machine died.

I assume that I need to use either patch or quilt and feed it a diff file and then
use either dpkg-buildpackage or debuild to build the deb. Once this is done I
will need to test the changed code to make sure it works as intended.

Once this is done I can send a deb-diff to Sebastian who will sponsor my update.

I also have to figure out how to make a recipe so that we can submit the nocsd
changes back to github. The nocsd changes seem to be working fine and are
ready for submission once this is done.

I will try to get unity-tweak done next week and hopefully once I get a few updates
submitted things will become clearer and easier for me.

Sorry for the delay

1 Like

@khurshid-alam @rs2009

I have finally gotten a deb for the unity-tweak-tool fixes made and tested.

I have been following the Ubuntu Packaging Guide from the repository but
ran into issues with quilt not working properly and just had to skip that step
and go on to run debuild and pbuilder-dist. So we are currently sans patch
header but tested.

I have attached the debdiff to lp: #1946794 for Sebastien to look at and
any ideas on how to get a header into the patch would be appreciated.

quilt seems to be adding my new header to the wrong file
new-fonts-schemas.patch instead of my new file named
more-new-fonts-schemas.patch even though my file is the
last in the list in the series file. So either quilt is broken or
there are critical steps missing in the Ubuntu Packaging
Documentation(maybe have to do something to refresh
quilts view of things before running the quilt header
command?).

The quilt output also does not look anything like the
other patch headers I am seeing with the other
patches so I assume there is another tool or method
for adding the patch header.

Any help would be appreciated.

Why not just add some headers manually. Probably these are sufficient:

Description:
Author:
Bug-Ubuntu:

Can’t recall that I ever used quilt header. But that’s me… :slight_smile:

I’ll be happy to sponsor it if you add something appropriate.

@bbogert24: Never mind. I did that when sponsoring.