Skip to content

Conversation

@cwendling
Copy link
Member

@cwendling cwendling commented Jan 7, 2025

Fixes #301.


Disclaimer: I didn't test this, I don't actually use flatpacks or such. However, given a check was clearly the wrong way around, and I imported another fix from Metacity, it might just work.

If this doesn't do it, possibly importing Metacity commits dade470e13292c58822b0c180019caf0ea3862f3 c6584a38a234726c1128d044fd7cc5a0f8379c69 c5136ec907fab167ffddfe4d10c3902c6c5d8852 8430e8436cb6bac732c00de5b5a3c3d73be62871 a7d6f11b3e712751b010a8f7622b148c93765f70 7c1cc3ca1d8131499b9cf2ef50b295602ffd6112 3e6358113acf61e0c68419bec6cc68a29603a2ec might help (it's mostly refactoring in the end tho, so I'm hopeful the simpler patch here would work).

CC @lukefromdc @lambdanil @tidux @rusty-snake @caiodev (and everybody else from #301), please test if you can :)

X's Success return value is 0, not a boolean, so the check was
effectively inverted.
@caiodev
Copy link

caiodev commented Jan 7, 2025

Hello @cwendling, how are you doing? Do you know where I could find build instructions for it? I've never done it. Tks 👍

@rusty-snake
Copy link

I didn't test this, I don't actually use flatpacks or such.

Try if you can reproduce with unshare --map-current-user --pid --fork PROGRAM

@cwendling
Copy link
Member Author

Try if you can reproduce with unshare --map-current-user --pid --fork PROGRAM

OK thanks, using this it fixes the issue: without these patches it shows "as superuser", with it it shows like a normal window. So that's a first win :)

Hello @cwendling, how are you doing? Do you know where I could find build instructions for it? I've never done it. Tks 👍

It depends a bit on your distribution and how comfortable your are building things, but on Debian-based distros, you can do something like:

~$ sudo apt-get build-dep marco
~$ git clone https://github.com/cwendling/marco.git
~$ cd marco
~/marco$ git switch client-pid
~/marco$ ./autogen.sh && ./configure && make -j4 && sudo make install

This will install the patched marco in /usr/local. Then, try /usr/local/bin/marco --replace and you should run the patched version (normally simply marco --replace should do, but better safe than sorry).

To uninstall the local build, run sudo make uninstall.

It's pretty standard, so you can also find additional info a bit everywhere :)

@caiodev
Copy link

caiodev commented Jan 7, 2025

@cwendling Nice. Will try it 👍

@raveit65
Copy link
Member

raveit65 commented Jan 7, 2025

Run as superuser is gone in titlebar with signal messenger from flathub.
Hopefully you do not run again in this bug caused by first attempted to fix this issue.
See #746 and reverted commit d3add65

@cwendling
Copy link
Member Author

@raveit65 I guess the issue you mentioned under X2Go was due to the lack of verification both that XRES was available, and that the XRES call was successful or not. Unfortunately although the XRES test implemented in #747 was good, the added check for the whether the XRES call was successful was done the wrong way around.

Either way, this shouldn't bring back the X2Go issue as both checks are kept, only the latter is fixed so things actually work when XRES is present.

And thanks for testing :)

@lukefromdc
Copy link
Member

lukefromdc commented Jan 8, 2025 via email

Copy link
Member

@lukefromdc lukefromdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I could not test with flatpak (not installed here), I didn't get any issues with the build, nor a problem with not showing caja under sudo as "ROOT" or applying that to caja running as a normal user

@cwendling
Copy link
Member Author

@caiodev have you had a chance to test this yet?

@lukefromdc
Copy link
Member

Is this ready to go or are we still waiting on another review?

@cwendling
Copy link
Member Author

I think this can get in, although I would have liked people that cared most in the original issue to test… but well.
Anyway, at least 3 of us tested this successfully; and I believe it has little risk of introducing additional issues (basically it fixes a check that was the wrong way around).

@caiodev
Copy link

caiodev commented Jan 28, 2025

So sorry for my delay, guys.

I tried to build it using @cwendling instructions but that's the output I got:

/usr/bin/mate-autogen /usr/bin/yelp-build checking for autoreconf >= 2.53... testing autoreconf... found 2.71 configure.ac:44: warning: The macro AC_HEADER_STDC' is obsolete.
configure.ac:44: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:44: the top level
checking for pkg-config >= 0.14.0...
testing pkg-config... found 1.8.1
checking for mate-common >= 1.1.0...
testing mate-doc-common... found 1.26.0
Checking for required M4 macros...
Checking for forbidden M4 macros...
Warning: I am going to run configure' with no arguments. If you wish to pass any to it, please specify them on the ./autogen.sh' command line.

Processing ./configure.ac
configure.ac:44: warning: The macro AC_HEADER_STDC' is obsolete. configure.ac:44: You should run autoupdate. ./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from... configure.ac:44: the top level Running mate-doc-common... Running autoreconf... autoreconf: export WARNINGS=no-portability autoreconf: Entering directory '.' autoreconf: running: autopoint --force Can't exec "autopoint": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 293. autoreconf: error: autopoint failed with exit status: 2

Before this attempt, I had to install mate-common and yelp-tools from official servers (Should they be from another source?) too but I couldn't build it to a working point

Do I have to give those files execution permission? Btw, I went to clone your branch @cwendling but couldn't find one branch named client-pid so I cloned this repo and there it was. Would you guys have any idea what could be wrong on my end?

Also, this command (sudo apt-get build-dep marco) gave me this output:

Reading package lists... Done
E: You must put some 'deb-src' URIs in your sources.list

Much appreciated 👍

@caiodev
Copy link

caiodev commented Jan 28, 2025

Just got a little bit further I think

I installed autopoint but now it complains about glib-2.0:

Package 'glib-2.0', required by 'virtual:world', not found

Since the full log is lengthy, I put it into a text file I'll be attaching to this message 👍

marco_build_log.txt

Update: The last dependency missing for me is this: mate-desktop-2.0 but I couldn't find a way to satisfy it yet

configure: error: Package requirements (gtk+-3.0 >= 3.22.0 gio-2.0 >= 2.25.10 pango >= 1.2.0 libcanberra-gtk3 mate-desktop-2.0 >= 1.27.1 xcomposite >= 0.3 xfixes xrender xdamage xres xcursor) were not met:

Package 'mate-desktop-2.0', required by 'virtual:world', not found

@cwendling
Copy link
Member Author

cwendling commented Jan 28, 2025

@caiodev Have you run sudo apt-get build-dep marco (which installs all dependencies the installed version of Marco needs to be built)? Although this only works on Debian, Ubuntu, Mint and other Apt-based distros. Not sure what is the equivalent one others, sorry (edit: for Fedora it seems there's dnf builddep marco).

Anyhow, for mate-desktop-2.0 you need a package similar to libmate-desktop-dev (which is Debian's name for it, but something on the lines of libmate-desktop-devel or so probably exists in Fedora, etc.).
However, the version from your distro might be too old, as current development version of Marco needs 1.27.1. If that's the case, you then need to build that one as well (which is not harder), which you can find there: https://github.com/mate-desktop/mate-desktop/

@raveit65
Copy link
Member

Commit is already in fedora f40/41/rawhide in a few days :-)
https://bodhi.fedoraproject.org/updates/FEDORA-2025-0733c31535

@caiodev
Copy link

caiodev commented Jan 28, 2025

@caiodev Have you run sudo apt-get build-dep marco (which installs all dependencies the installed version of Marco needs to be built)? Although this only works on Debian, Ubuntu, Mint and other Apt-based distros. Not sure what is the equivalent one others, sorry (edit: for Fedora it seems there's dnf builddep marco).

Anyhow, for mate-desktop-2.0 you need a package similar to libmate-desktop-dev (which is Debian's name for it, but something on the lines of libmate-desktop-devel or so probably exists in Fedora, etc.).
However, the version from your distro might be too old, as current development version of Marco needs 1.27.1. If that's the case, you then need to build that one as well (which is not harder), which you can find there: https://github.com/mate-desktop/mate-desktop/

Oh I see, @cwendling. I'll try that as soon as I can. I haven't had much time to test it, but I think I'll be able to do it till the end of the week max. Will try to do my best. Thanks for your guys' patience 👍

@caiodev
Copy link

caiodev commented Feb 3, 2025

Hello guys. Just to update you on my attempts to test the solution branch, I really could not build it because the version of MATE I'm using is not compatible with the required one and I got this error:

Package dependency requirement 'mate-desktop-2.0 >= 1.27.1' could not be satisfied.
Package 'mate-desktop-2.0' has version '1.26.2', required version is '>= 1.27.1'

Screenshot at 2025-02-03 01-53-08

I downloaded the latest version of MATE from their Github page as @cwendling suggested but since I own 2 PCs running Ubuntu MATE 24.04.1 and I always try to test anything MATE related (New releases etc) on baremetal because I think it is a more accurate environment, when I was about to start building it, I saw reports of some inconsistencies on the latest MATE vesion and since these PCs are shared by the whole family, I decided I couldn't go any further because of that and because I might mess with something that will take me some time to fix making at least one of those PCs unavailable for use for some time ):

Since this PR has been open for 1 month now and @raveit65 has already tested it, imho we could go with his report on it but that's you guys' call.

Finally, I'd like to thank you guys once again for your patience, for submitting/testing this fix and for all you guys do here for the community 🤝️

@cwendling
Copy link
Member Author

@caiodev if you're not afraid of testing binaries from the web, you're in luck today: I just built a patched Ubuntu 24.04 package with the changes form this PR applied: marco_1.26.2-4.1_amd64.zip

@lukefromdc lukefromdc merged commit 79c00a9 into master Feb 11, 2025
@lukefromdc lukefromdc deleted the client-pid branch February 11, 2025 02:43
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

Successfully merging this pull request may close these issues.

Firejail/Flatpak applications display "as superuser" on window title

7 participants