Giter Site home page Giter Site logo

Comments (45)

tsujan avatar tsujan commented on August 16, 2024 1

but volume change isn't actually a notification coming from elsewhere

There's no distinction in the code. Volume change comes from Panel, while lxqt-notificationd doesn't depend on lxqt-panel. Moreover, some users might complain rightly ("It was supposed not to disturb...").

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024 1

but shouldn't be both the same (the bell)?

You mean using "notifications" for the usual mode? I had the same idea but saw that "notifications" didn't exist in GTK icon themes.

Maybe we can use "notifications" and go to "preferences-desktop-notification" only if it doesn't exist.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024 1

Does LXQt (or Qt itself) have something similar?

Yes, of course. LXQt also follows freedesktop standards and looks for "dash fallbacks". If no icon is found, the generic icon will be used.

In addition to that, each app can decide which icon to use when a specific icon isn't found.

from lxqt-notificationd.

jmfernandez avatar jmfernandez commented on August 16, 2024

Yes, it would be very useful in this "teleconferences" world, in order to avoid showing any notification for half an our or one hour, for instance, in order to avoid them when screen is being shared, or video or slideshow are in progress.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

At the moment this can be achieved by stopping the notification module in "Session Settings", but there will be no "missed" notifications when reactivating.

from lxqt-notificationd.

jmfernandez avatar jmfernandez commented on August 16, 2024

At the moment this can be achieved by stopping the notification module in "Session Settings", but there will be no "missed" notifications when reactivating.

An additional drawback is that it will not be automatically re-enable after a timeout.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

There's a design problem that should be solved before adding codes for the new mode:

We show the tray icon only when there are unattended notifications. So, unlike in power management, we can't add a pause menu there. On the other hand, if we always show the tray icon, it'll lose its usefulness as a reminder that there are unattended notifications.

Adding a pause setting in the notifications config dialog isn't the solution because it's hidden from the user.

Using the tray icon of power management for this is impossible. Even if it was possible, we shouldn't do it because notifications aren't related to power management — to say nothing of computers without battery.

Showing the icon permanently and using another icon when there are unattended notifications would be a solution if there was a good icon for the latter in all icon sets, but that's not the case. Should we add our own icon?

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

A simple solution — as far as designing is concerned — is forgetting about pause, adding a permanent setting for the new mode to the config dialog and showing a startup notification about it, as KDE does.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

I didn't quite understand the latter.

A possibility could be "Don't show notification popups" setting, and then always show the icon, with a counter.
So this would not disturb.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

... and then always show the icon, with a counter.

The existence of the icon informs the user about the existence of unattended notifications by a glance. I think we shouldn't sacrifice this important functionality.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

I've in mind to have all somehow:

  • Behavior as it is now: icon only pops up when there are unattended notifications
  • Always shows icon with unattended notifications,
  • Toggle popups (do not disturb). This is hard to activate when no icon is present, needs to be done in settings.
  • Showing number of last unattended notifications.

I don't use the unattended notifications, as I hardly click away any notification - I just read it on the fly and let it expire, and doing so it will end up as "not seen".

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

Always shows icon with unattended notifications,

This is the same as "Behavior as it is now:.."; isn't it?

Toggle popups (do not disturb). This is hard to activate when no icon is present, needs to be done in settings.

We can add an option for the "do-not-disturb" mode to settings dialog. But what if the user forgets about it? I mean how do we remind he/she that he'll see no notification because he's activated the do-not-disturb mode?

Some people don't like it when I say the do-not-disturb mode is at odds with the concept of notification. OK, we might add it but we should also make sure that the user won't forget about it. The question is "How?".

Showing number of last unattended notifications.

Why? What's the use of showing the number? If there are unattended notifications, there will be a tray icon and the user could click it and see the list. If there's no unattended notification, there will be no tray icon.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

but we should also make sure that the user won't forget about it... The question is "How?"

Is the following answer to my above question acceptable to you?

When "do-not-disturb" mode is activated, treat all notifications as unattended (because they aren't shown) and add an appropriate emblem to the tray icon, accompanied by an appropriate tooltip.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Always shows icon with unattended notifications,

This is the same as "Behavior as it is now:.."; isn't it?

No, as it disappears when they are cleared. This would be useful to toggle "do not disturb".

Is the following answer to my above question acceptable to you?

When "do-not-disturb" mode is activated, treat all notifications as unattended (because they aren't shown) and add an appropriate emblem to the tray icon, accompanied by an appropriate tooltip.

The downside is that is has to be activated in settings, right?
Could be undone automatically with "clear all & stop "do not disturb mode".

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

No, as it disappears when they are cleared.

The tray icon already disappears when the list is cleared.

EDIT: Probably, I still don't understand what you mean but, as I said above, IMO, it's important to show the tray icon only when there's an unattended notification. Clearing the list means that the user has paid attention to the notifications.

The downside is that is has to be activated in settings

IMHO, it isn't a downside because the user can't ignore that he has activated the mode as soon as the first notification is triggered (silently) — because of the emblem. Moreover, the tray menu already has an item for opening the config dialog.

There will be several important details that should be considered in the code. The implementation won't be easy but is doable in a clean way.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

The emblem can be like this, with a semi-transparent background for it to bee seen with all icons:

emblem

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

EDIT: I don't know if I've made a mistake or the implementation was much easier than I thought because it took only 15 minutes; should test it for a day or two.

Used a pause emblem (like that of power management tray icon), instead of the above alarming icon:

icon

And this is the new option:

settings

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Looks fine!
In the icon menu an item "exit do not disturb" "show notifications" or similar?

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

In the icon menu an item "exit do not disturb" "show notifications" or similar?

I didn't touch the menu. Since the "Options" menu-item is there, the user won't have any problem. The whole patch is as small as possible: it sees all notifications unattended with the do-not-disturb mode and saves them, instead of showing them. I let the app save up to 50 notifications in this mode, which is more than what's needed in practice. The settings of unattended notifications are ignored with it.

Will make a PR today.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

As mentioned here lxqt/lxqt#2054 (reply in thread) to be sure I switched back to the master branch, and telegram icon is back. I've no idea why, but this was the only difference to before.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Note: I didn't saw this happen with the first commit.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

Note: I didn't saw this happen with the first commit.

I assure you that Telegram's icon doesn't have the slightest relation to this patch. But it makes me worry about Status Notifier (see the second paragraph of #271 (comment)).

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

@stefonarch
If you ran Telegram after installing it, the generic icon is quite possible. See lxqt/libqtxdg#226. In that case, restarting the panel will restore the correct icon once for all.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Sure I restarted telegram, panel, session and even laptop - always generic icon with telegram.
I can try repeat it, atm recompiling panel, but I saw only new translations, everything should be quite git master.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

If it persists, please open an issue at panel's bug tracker. Here isn't a good place.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Sure I restarted everything, from panel to session to laptop.
Recompiled panel now (although I saw only new translations) and reinstalled the "do not disturb" *.deb package, and it didn't happen again. So for the moment all good but there is something sleeping with those generic icons.

by the way: maybe the volume change notifications should be always shown, as immediate feedback on actions.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

but there is something sleeping with those generic icons.

It may be just lxqt/libqtxdg#226 but, since you said you restarted panel, there may be more.

by the way: maybe the volume change notifications should be always shown

"Don't disturb" is what it means ;) Frankly, I won't use it because, IMO, it's at odds with notification but if a user is disturbed by notifications, there's an option now. IMO, having another exception list for the do-not-disturb mode would be weird, if not an overkill.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

I didn't think of another option, but volume change isn't actually a notification coming from elsewhere but an action feedback, triggered by the user.
I see now that libqtxdg had an update 750380b..dcac08a so not all was up-to date with git master.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Today after clearing the notifications at the next notificationsI got again the generic icon, clearing them and doing an notify-send test -t 10 icon was ok.
System was only suspended and all relevant components should be up-to-date, will check later.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

Do you have d31eb11 too?

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Yes.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

Yes.

Since you've seen the same thing with Telegram a few times and because Telegram also adds emblems to its tray icon, I suspect Panel's Status Notifier plugin.

There's nothing wrong about the icon in this code or in Telegrams's code (I checked Telegrams's source) — the "workaround" I added here seems redundant (but it's harmless).

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

It happened again, after suspending for a long time (~4h), same behavior. A short suspend doesn't trigger it.
With telegram or others no issue atm, could try those other apps where this issue was seen with,

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

I checked the code of Status Notifier and found no issue in it either. We might need reports by different users to compare them.

If you want to test with other apps, you'll need to find those, whose tray icons have emblems. Telegram is such an app (with unread messages); I'm sure about that.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

I think also meteo-qt is one of those.
schermata-08-09-22-34

Will report, until now it didn't happen again.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

I think also meteo-qt is one of those.

I'm not sure — not comfortable with python+Qt codes — but it may be.

Could you please be more specific about what you see? Are you saying that the icon+emblem is there, then you suspend the computer and, after resuming, the icon is changed to the generic icon?

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Are you saying that the icon+emblem is there, then you suspend the computer and, after resuming, the icon is changed to the generic icon?

Exactly, this was twice the case now.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

Exactly, this was twice the case now.

Oh, that's different from what I thought and a lot stranger! Thanks! I didn't think icons could change after resuming from suspend — and I've never seen it. Have no idea how it's possible.

EDIT1: I usually reboot/shut down my laptop once in 1-2 weeks. So, it has long periods of suspension.

EDIT2: I'll test it on my old laptop, which I may suspend for days.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

I think I've found a weird way of reproducing it on my old machine. It isn't related to resuming from suspend. Keeping my fingers crossed, I hope it'll be still reproducible when I find the time to investigate it.

EDIT: I reproduced it 4 times by doing a ritual :)

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Well, nice! I rebooted yesterday and didn't see it again for now.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

I found a little time to investigate it. Fortunately, it's 100% reproducible with a sequence of actions.

Most probably, the cause of this weird problem is deep inside Qt. It only happens with hiding and showing the tray icon. I'd encountered a similar problem years ago (about not showing the tray menu). The workaround is elementary but I prefer to get nearer to its root before adding a commit to the PR. That may need more time.

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

OK, done!

A short explanation:

QSystemTrayIcon definitely has a bug (under X11, at least), which shows up when the tray icon isn't a theme icon (like the emblemized icon I used): as soon as the tray icon is hidden, the non-theme icon is lost. The workaround I had in mind was re-adding it before the tray icon was shown, and it worked. However, because of another nasty problem in QSystemTrayIcon, there was a small memory leak. Also, removing and recreating the tray icon caused the same memory leak.

Since I hate memory leaks even when they're small, I removed the emblem and used the icon "notifications-disabled" for the do-not-disturb mode. If it doesn't exist in a theme, the usual icon ("preferences-desktop-notification") will be used. In this way, the code is simplified too.

NOTE: The above-mentioned bug doesn't happen with the power manager's emblem ("Pause idleness checks") because its tray icon is either shown or removed — we never hide it.

from lxqt-notificationd.

stefonarch avatar stefonarch commented on August 16, 2024

Testing, looks like that now, I like the do-not-disturb icon more than the previous, but shouldn't be both the same (the bell)?
Could be confusing a little.

schermata-08-11-08-11 schermata-08-11-08-14

from lxqt-notificationd.

tsujan avatar tsujan commented on August 16, 2024

Added a commit to the PR for the last idea. You're right; the usual and no-disturb modes are more consistent with those icons.

If someone uses a GTK icon set, he'll only see "preferences-desktop-notification" but we know that GTK icon sets aren't good for Qt DEs in general.

from lxqt-notificationd.

jmfernandez avatar jmfernandez commented on August 16, 2024

Added a commit to the PR for the last idea. You're right; the usual and no-disturb modes are more consistent with those icons.

If someone uses a GTK icon set, he'll only see "preferences-desktop-notification" but we know that GTK icon sets aren't good for Qt DEs in general.

Maybe my current question is very off-topic. Something very useful in gtk-3.0 is that it is possible to set up a fallback icon theme where the toolkit looks for icons, in case the main icon theme does not have some icon for any reason. Does LXQt (or Qt itself) have something similar?

Your work providing an alternate icon name in case first icon name is not found is another way, assuring a decent fallback.

from lxqt-notificationd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.