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

Bring back attention flash on GNU/Linux #3582

Closed
1 task done
jeaye opened this issue Sep 9, 2019 · 23 comments
Closed
1 task done

Bring back attention flash on GNU/Linux #3582

jeaye opened this issue Sep 9, 2019 · 23 comments

Comments

@jeaye
Copy link

jeaye commented Sep 9, 2019

  • I have searched open and closed issues for duplicates

Bug Description

Recently, Signal stopped flashing when I receive a message in i3wm. The change in the source is pretty clear here, showing what happened:

Steps to Reproduce

  1. Use Signal on GNU/Linux with i3 or dwm
  2. Receive a message while Signal is not focused

Actual Result:

No visual indicator or flash is shown.

Expected Result:

The window flash will trigger i3 to highlight that window/desktop number.

Screenshots

Platform Info

Signal Version: 1.27.2-1 (from AUR)

Operating System: Arch Linux

Linked Device Version: 4.46.2 (Android)

Link to Debug Log

@scottnonnenberg-signal
Copy link
Contributor

Sadly, we received reports of pretty extreme window manager behaviors related to this simple call. We decided to turn it off because off the wide range of potential interpretations.

@jeaye
Copy link
Author

jeaye commented Sep 13, 2019

Thanks for the response. Signal desktop is basically unusable, in i3, without these flashes. Can we please put this behind a flag or setting, compile-time or run-time, so that those of us who need it can have it?

Or can we have a more generic approach and run a command on flash (which the user can specify)? I just need some way to know when a new message comes in.

@scottnonnenberg-signal
Copy link
Contributor

@jeaye You don't have anything registered to handle Signal Desktop notifications?

@jeaye
Copy link
Author

jeaye commented Sep 13, 2019

@scottnonnenberg Apparently not, since I've never seen any. Seeing some desktop notifs would certainly help, since it's better than no visual indication at all. However, I don't think those notifs would flash the window the same way, to trigger my window manager to highlight that desktop as needing attention. So, if I miss the notif (AFK) and come back to work, I have no idea about the new message.

@sdelafond
Copy link

Seconded, signal-desktop is unusable without the flash: I do use desktop notifications, but as @jeaye noted they only show up for a small amount of time and therefore do not solve the "received a message while AFK" situation.

@kxxvii
Copy link

kxxvii commented Sep 19, 2019

Saw this issue, kept an eye on it and seeing that it got closed I feel that I should say something. So: Seconded, I've got the same problem.

More or less guessing if someone wrote, or relying on my phone when I'm using a desktop application sort of backwards. (dwm user)

@blackbit42
Copy link

Sadly, we received reports of pretty extreme window manager behaviors related to this simple call. We decided to turn it off because off the wide range of potential interpretations.

I believe what occurs is that the _NET_WM_STATE_DEMANDS_ATTENTION property is set, as described in the spec.
Now, if there are window managers that 'go extreme' about this - by the way, which ones are those?, I think they should be asked to adjust and not applications adapted in a way to accommodate non straight-forward window manager behavior.
Philosophy aside, for me it would be good enough to have a commandline switch or similar that enables setting the ..._DEMANDS_ATTENTION property on incoming messages, as suggested by multiple people above already.

@protist
Copy link

protist commented Oct 5, 2019

I agree with a lot of these comments. Now when I come back to my computer, there is no indication if I've missed messages. FWIW the previous behaviour worked fine with KDE/Kwin. For anyone looking for a quick fix, you can just patch the file as follows:

--- main.js.orig	2019-10-05 14:54:58.255575788 +1000
+++ main.js	2019-10-05 14:45:14.248803283 +1000
@@ -894,7 +894,7 @@
 });
 
 ipc.on('draw-attention', () => {
-  if (process.platform === 'win32' && mainWindow) {
+  if (process.platform === 'linux' && mainWindow) {
     mainWindow.flashFrame(true);
   }
 });

@jeaye
Copy link
Author

jeaye commented Oct 5, 2019

Yep, this is a quick fix to re-enable. Clearly people are vocal about this being an issue.

@scottnonnenberg-signal What do you say about opening this back up and coming to terms with how we can address it, either by re-enabling by default or behind a flag or config?

@doy
Copy link

doy commented Oct 5, 2019

i also just noticed this after a recent upgrade, and i agree that this makes signal-desktop pretty unusable for me (since i have no other way of seeing that i have new messages if the signal window is on a different desktop).

@cornerman
Copy link
Contributor

Can we get this back through some configuration at least? When I started using signal, the first thing I did was opening the PR for urgency hints on linux (#1820).

Without it, using signal on the desktop became a real hassle, I need to check the window frequently to see if there are new messages. I do not use any notification daemon, because I found them to be way too interruptive and so I solely rely on urgency hints.

Sadly, we received reports of pretty extreme window manager behaviors related to this simple call.

@scottnonnenberg Do you know what exactly happened or which window managers are affected? I do not know what "extreme" means in this case, because urgency hints work quite well normally. I would be willing to help if I had more information.

@scottnonnenberg-signal
Copy link
Contributor

scottnonnenberg-signal commented Oct 9, 2019

In one case 'extreme' meant pulling a user from one desktop to another, where Signal Desktop was. A disruption we weren't interested in causing for anyone.

But we are considering a change given that so many of you have reached out. Maybe the right decision is to have it on by default for Linux then something like a command-line option to turn it off.

@jeaye
Copy link
Author

jeaye commented Oct 9, 2019

Indeed, that is an extreme situation which warrants attention. It's also, I'd bet, quite the edge case and doesn't render Signal neigh unusable on Linux for everyone like the current solution does (I've found this issue also applies to GNOME, which rules in many more affected users).

I would agree that it seems we should still enable this flash by default and allow those users with extreme situations to disable it. Thanks, @scottnonnenberg-signal!

@protist
Copy link

protist commented Oct 9, 2019

Thanks @scottnonnenberg-signal! I appreciate how receptive you are to your users!

In once case 'extreme' meant pulling a user from one desktop to another, where Signal Desktop was. A disruption we weren't interested in causing for anyone.

That's obviously a bad situation for that user. However I seems like that's probably more an issue with their window manager. For example with KDE/kwin, there's an option to change "focus stealing prevention" along a range from None, Low, Medium, High, Extreme. My understanding is that you can intentionally set the WM to pull you to the desktop requiring attention, but you can tweak it yourself. Presumably the affected user's WM should have a similar setting too.

@cornerman
Copy link
Contributor

I would agree that it seems we should still enable this flash by default and allow those users with extreme situations to disable it.

Thank you for your response, that sounds awesome! Indeed, the focus-stealing sounds like an extreme measure from the window manager.

Looking at the standard protocol (https://tronche.com/gui/x/icccm/sec-4.html), it seems to be quite vague what the window manager should do, but I think raising the window is a very intrusive way of interpreting this flag:

The UrgencyHint flag, if set in the flags field, indicates that the client deems the window contents to be urgent, requiring the timely response of the user. [...] For example, the window manager may attract attention to an urgent window by adding an indicator to its title bar or its icon. Window managers may also take additional action for a window that is newly urgent, such as by flashing its icon (if the window is iconic) or by raising it to the top of the stack.

@norg
Copy link

norg commented Oct 10, 2019

But we are considering a change given that so many of you have reached out. Maybe the right decision is to have it on by default for Linux then something like a command-line option to turn it off.

Is this the correct Issue to follow for updates even though it's closed? Would like to know when it's related to a commit or even a release.

@scottnonnenberg-signal
Copy link
Contributor

If you're running the beta, please update and let us know what you think! f790694

@schwukas
Copy link

It's working great for me on Arch Linux and i3wm. However, it always worked fine for me. Someone with one of the "problematic" window managers should chime in maybe.

scottnonnenberg-signal pushed a commit that referenced this issue Aug 24, 2020
In many GNU/Linux setups, drawing attention when a notification arrives
causes the Signal window to steal focus immediately and interrupt the
user from what they were doing before the notification arrived. GNOME
Shell is the most prominent example of this behavior, but there are
likely other cases as well. Suddenly stealing focus on external events
like this can even pose a security problem in some cases, e.g. if the
user is in the middle of a typing a sudo password on one monitor while a
notification arrives and focuses Signal on another monitor. See #4452
for more information.

Disabling attention drawing entirely for Linux is also problematic
because some users rely on it as the sole indication of a new message,
as seen in #3582 and #3611.

Commit f790694 improved the situation
by adding a hidden "--disable-flash-frame" command-line argument, but
this argument is undocumented and manually adding command-line arguments
to the application's .desktop file is not user-friendly.

This commit adds a settings option for whether to draw attention when a
new notification arrives to make it easy for all Linux users to obtain
the appropriate behavior without relying on an undocumented
command-line argument.

Fixes #4452.
josh-signal pushed a commit that referenced this issue Sep 2, 2020
In many GNU/Linux setups, drawing attention when a notification arrives
causes the Signal window to steal focus immediately and interrupt the
user from what they were doing before the notification arrived. GNOME
Shell is the most prominent example of this behavior, but there are
likely other cases as well. Suddenly stealing focus on external events
like this can even pose a security problem in some cases, e.g. if the
user is in the middle of a typing a sudo password on one monitor while a
notification arrives and focuses Signal on another monitor. See #4452
for more information.

Disabling attention drawing entirely for Linux is also problematic
because some users rely on it as the sole indication of a new message,
as seen in #3582 and #3611.

Commit f790694 improved the situation
by adding a hidden "--disable-flash-frame" command-line argument, but
this argument is undocumented and manually adding command-line arguments
to the application's .desktop file is not user-friendly.

This commit adds a settings option for whether to draw attention when a
new notification arrives to make it easy for all Linux users to obtain
the appropriate behavior without relying on an undocumented
command-line argument.

Fixes #4452.
@ForeverNooob
Copy link

ForeverNooob commented Feb 10, 2023

@scottnonnenberg-signal

This issue became relevant again since Signal Desktop stopped marking the windows as urgent again.

Signal Desktop v6.5.0 (production) on Ubuntu 18.04

Though I believe previous version was also affected.

Edit:
Seems like it's an option now (which was turned off by default)
See screenshot:
Screenshot_20230210_213935

@scottnonnenberg-signal
Copy link
Contributor

@ForeverNooob Can you talk about what change you'd like to see? To set expectations, given that the option is now off by default, it's unlikely that we'll make any further changes here.

@blackbit42
Copy link

blackbit42 commented Feb 10, 2023

Well, this issue describes precisely what is broken now (again).
All workflows that rely on window managers reacting to events of applications by setting their window to X11 urgent are broken.

given that the option is now off by default, it's unlikely that we'll make any further changes here.

It would be helpful to understand which train of thought led to the functionality being changed (again).
Also, why is it unlikely that you make any further changes?
Are you saying this is on purpose? What has been achieved by this?

@scottnonnenberg-signal
Copy link
Contributor

Our desire was to notify users of new messages via notifications, not 'stealing focus,' something that often resulted in a 'Signal is Ready' notification before our real notification would show.

It sounds like you really want that 'draw attention' behavior to work (in a way that it's not working today), because that's your intended method of being notified that there's a new message?

@ForeverNooob
Copy link

@ForeverNooob Can you talk about what change you'd like to see? To set expectations, given that the option is now off by default, it's unlikely that we'll make any further changes here.

I'm running i3wm so for me personally it was pretty annoying finding out that notifications weren't turning the workspace icon into a red color and being able to switch to it using a shortcut that I usually use for this purpose.
All in all for me it was a minor annoyance resulting in me thinking that something broke in Signal.

I would have loved to see that option not being turned off by default, but as I've said it resulted in a minor annoyance and (perhaps an over-hastily made) comment from me on this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests