Nheko-Reborn / nheko

Desktop client for Matrix using Qt and C++20.
https://nheko-reborn.github.io/
GNU General Public License v3.0
1.9k stars 200 forks source link

Titlebar shouldn't be there on mobile (flatpak version) #1460

Open Melechtna opened 1 year ago

Melechtna commented 1 year ago

Describe the bug

Since I'm on arch, I CAN just compile it and remove this issue, but the less compiling needed the better, so I installed it via flatpak. With that said, the title bar is stuck at the top on my pinephone, and I can find no reasonable way to hide the titlebar. I thought this was a toggle in the settings, but either it's not, or, it's not there with the flatpak version.

To Reproduce

  1. Install via flatpak on Pinephone
  2. no way to hide the titlebar in phosh

What happened?

Stated in description

Expected behavior

Either no titlebar at all (seems to ignore the purism flags) or a toggle to remove it.

Screenshots

Screenshot from 2023-05-20 09-29-18

Version

0.11.3-d27e42d

Operating system

Linux

Installation method

Flathub

Qt version

No response

C++ compiler

No response

Desktop Environment

Arch Phosh

Did you use profiles?

Relevant log output

No response

Backtrace

No response

deepbluev7 commented 1 year ago

It is just a Qt application, so you can remove the titlebar in your Qt theme. I don't know how to do that on Phosh and with a flatpak, but it should be possible without Nheko changes and should probably done by phosh for all Qt apps (using a common Qt theme), instead of patching that into each Qt app manually. Also on Arch on amd64 you don't need to use the flatpak, since Nheko is just in the repos.

Melechtna commented 1 year ago

It is just a Qt application, so you can remove the titlebar in your Qt theme. I don't know how to do that on Phosh and with a flatpak, but it should be possible without Nheko changes and should probably done by phosh for all Qt apps (using a common Qt theme), instead of patching that into each Qt app manually. Also on Arch on amd64 you don't need to use the flatpak, since Nheko is just in the repos.

Yes, let me torch my phone every update because the only thing that can build is the git repo, which ALWAYS builds, and the default repo is missing the aarch64 flag, so won't install, and neither seems to care to actually add that flag even though both have been told multiple times to add it. Regardless of that, if you know how to do so with Phosh, that would be much appreciated, but at the same time, the mobile flag declared with the purism variable SHOULD do that anyway, but it doesn't with the flatpak for some bizarre reason.

deepbluev7 commented 1 year ago

Maybe there is a flatpak specific theme package you need to install?

Melechtna commented 1 year ago

Maybe there is a flatpak specific theme package you need to install?

If you look at the resulting .desktop that the flatpak downloads/creates/whatever it does, there's a variable at the bottom with 2 flags, these two flags SHOULD declare to both qt and phosh, that the app is mobile, so should discard the title bar, it doesn't though with flatpak, it does with the native compiled app though. So either it's a bug with flatpak, or a bug with how this variable is implemented.

deepbluev7 commented 1 year ago

Is there any documentation for that and does it work, if you manually edit the .desktop file?

Melechtna commented 1 year ago

Is there any documentation for that and does it work, if you manually edit the .desktop file?

I wouldn't know what to edit it to, as I've cross referenced other .desktop files to make sure that it's declaring it correctly, and it seems like it is, but the documentation is sparse, so, maybe? Nothing concrete I could point you too ultimately when it comes to how the .desktop files should be formatted, but the one in the flatpak seems to be the same as when compiled native, so, my assumption is it's a flatpak specific issue, and I have no idea what would need to be done to correct for that. I've already tried adjusting its privileges, infact in frustration for some other stuff I just granted it every permission, so it doesn't seem to be the usual culprit.

deepbluev7 commented 1 year ago

The .desktop files are just text files, so if you manage to locate it on your system, you should be able to edit it using any text editor.

However since I have no idea, what the correct value should be and since we do advertise a mobile form factor, I don't really know how to proceed, since I can't find any documentation for those values.

Melechtna commented 1 year ago

The .desktop files are just text files, so if you manage to locate it on your system, you should be able to edit it using any text editor.

However since I have no idea, what the correct value should be and since we do advertise a mobile form factor, I don't really know how to proceed, since I can't find any documentation for those values.

Not sure if you just TL:DR'd my last message, but, not only do I know they're text files, I stated I checked them, checked privlages, checked other .desktop files, and checked the one created when compiled native, and the only one with the problem is specifically the flatpak version.

deepbluev7 commented 1 year ago

I don't quite follow where the problem is then. The flatpak .desktop files are correct and they are what controls if phosh shows a title bar? So they can't be the problem? Is the problem possibly some wayland vs X11 issue then?

Melechtna commented 1 year ago

I don't quite follow where the problem is then. The flatpak .desktop files are correct and they are what controls if phosh shows a title bar? So they can't be the problem? Is the problem possibly some wayland vs X11 issue then?

Possibly? I genuinely don't know. My only other guess, is that perhaps the libs packaged in the flatpak are missing something specific to act accordingly to that purism flag, or maybe too many are added, and the systems libs and the flatpaks are clashing.

Another example, I have Mobians Snapshot installed via flatpak, because it absolutely can't compile in Arch atm. It however DOES render correctly, but it's mobile first so that's likely the difference. It's either a library or a config that's throwing this off, and I don't know which, nor how I'd track that down.

deepbluev7 commented 1 year ago

We don't package any libraries though (which control looks), we just use the KDE flatpak runtime.

Melechtna commented 1 year ago

We don't package any libraries though (which control looks), we just use the KDE flatpak runtime.

Do you happen to know which libs would be needed (in gnome since they're basically the same thing) to control qt applications looks?

deepbluev7 commented 1 year ago

It is difficult, but usually you need to install an extension package like here: https://www.reddit.com/r/flatpak/comments/y9jmqj/the_general_flatpak_qt_and_gtk_theming_guide/

Melechtna commented 1 year ago

Let me look into this and I'll get back to you if I figure anything out.

Melechtna commented 1 year ago

Installed the qt package (this is 5) didn't do anything, installed qt6, didn't do anything, installed kvantum, not sure what to do with it or how it relates to mobile, installed qt6-wayland, nothing, installed qt5-wayland, still nothing.

Digging into kvantum, it just seems like a theme unifier between gnome and qt applications, and isn't ultimately related to the problem, as I don't think it's a theming issue, it's just an issue with the titlebar not being discarded like it's supposed to, I.E, window decorations. The theme for the title bar doesn't seem to change with kvantum in use anyway.

brunnerm4x commented 3 months ago

Running PureOS Byzantium on an Librem5, a simple Solution for hiding the title bar of (all ?) QT Applications that works for me is setting an environment variable using the application Flatseal:

In Flatseal select nheko, scroll down to section Environment (Variables) and add following entry (Environment variable):

QT_WAYLAND_DISABLE_WINDOWDECORATION=1

Restart nheko - finished.