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

[Linux]Show progress in window icon #284

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

JakobDev
Copy link
Contributor

@JakobDev JakobDev commented Feb 5, 2024

This shows the current progress in the window icon on Linux. It is not supported by every desktop. You can use KDE if you want to test it. Cubiomes Viewer must be installed to make this work.

Screenshot_20240205_085801

This is also possible under Windows, but I don't know how it works there.

Cubitect added a commit that referenced this pull request Feb 10, 2024
* added progress indication via app icon (#284)
* changed build setup and code for qt6 compatibility
* tweaked app icon
* tweaked screenshots for better readablilty
* tweaked default layout
@Cubitect
Copy link
Owner

Interesting, I didn't really know anything about DBus.

However, this implementation is specifc to only few desktop environments. (Seems to be mostly for Ubuntu/Unity, but might be KDE compatible. It doesn't seem to work on the KDE 4 system that I've available though.)
It also requires a new dependency, which I'd really like to avoid in general, so with_dbus wouldn't be enabled for the releases.

We can get a similar result though, by drawing on the app icon. It's not as integrated as the native approach,
but it's more flexible and should work on pretty much all platforms, and can be done with the current gui modules.

icon_ubuntu
icon_windows

I'm still tweaking the look. Windows has very small icons compared to some of the other DEs.

@JakobDev
Copy link
Contributor Author

should work on pretty much all platforms

Except Linux. The Linux World is currently transiting from XServer to Wayland. Wayland don't allow Applications to set a own Icon. It will just use the Icon from the desktop file. setWindowIcon will just do nothing here.

Even on other Platforms this could be a Problem. Nobody is expecting a Window Icon to do such things. This could cause some weird Problems. It's better to just use the native Implementation of each Platform.

However, this implementation is specifc to only few desktop environments.

I know, but if a Desktop don't want to show a Progress Bar, than this should not be forced. KDE is known to work. It is also supported by the Dash to Dock GNOME Extension. It is probably also supported by other Programs/Desktops.

so with_dbus wouldn't be enabled for the releases.

We could just enable it for the Flatpak/the AUR package. I'm also not sure if compiling without D_Bus could cause some Issues.

It doesn't seem to work on the KDE 4 system that I've available though

Wow, that's really old.

@Cubitect
Copy link
Owner

Except Linux.

It would work on almost all systems that have an XServer, which I would guess is still the majority of Linux systems.
That screenshot was taken on Ubuntu 22.04 with the default Wayland configuration and with Qt 6.6.1. I haven't investigated how or why it works, probably via xwayland. Qt still depends on xcb, in any case.

Nobody is expecting a Window Icon to do such things.

A lot of image viewers and some editors show a live miniature of their content for their window icon. I will concede though that it is uncommon for other applications to do this. My plan had been to make this a feature which can be enabled in the settings.

Wow, that's really old.

When you want to keep ABI compatibility, you tend to use the oldest maintained LTS OS releases available, usually Debian or Centos, so the binaries will work on all the newer OSes. This has the side effect that a lot of the software can be 5 or even 10 years behind.

I have taken the liberty to adapt your PR to the current trunk, and I've disabled the setWindowIcon() code.
I still haven't actually gotten the DBus code to function on any of my systems. Should it work on Ubuntu? They ship with "Ubuntu Dock for GNOME Shell" instead of Dock-to-Dock, which is an "extension that is a modified version of Dash To Dock with different defaults."

@JakobDev
Copy link
Contributor Author

I still haven't actually gotten the DBus code to function on any of my systems.

I got it working now on Gnome. The API needs the correct desktop file. GNOME was for some reason not aviable to connect the Window to the desktop file, even when launching from the Menu. Please don't ask me why. You can tell this by hovering with the Mouse over the Icon. If it shows cubiomes-viewer (the binary name) than the Window is not connected to the desktop file. If it says Cubiomes Viewer (the name from the desktop file), it works. I needed to build the Flatpak from the latest committo get this working. This is how it looks like:

grafik

On never KDE versions it should work as expected, as long as you have the desktop file installed. You may need to start Cubiomes Viewer from the Menu.

probably via xwayland

A little tip: You can check if a Window is Wayland or XWayland by using xeyes. Just start xeyes and move the cursor in the Window around. If xeyes follows the cursor, the Window is XWayland, if not it's Wayland.

Qt still depends on xcb, in any case.

Wayland is for some reason a Qt Plug-in at the Moment. Maybe you don't have it installed for some reason.

A lot of image viewers and some editors show a live miniature of their content for their window icon.

GIMP is the only one I know and they have dropped it.

which I would guess is still the majority of Linux systems.

A lot of Distros that use GNOME/KDE ship with Wayland as default. GNOME is already planning on removing X11. KDE 6 will use Wayland as default. Lots of smaller Desktops are working on a Wayland session. Fedora 40 is planning the ship without XServer. I think we will see X11 vanish from the default configuration most distros in the next 1 or 2 Years.

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.

2 participants