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

Notifications "fly away" (in Debian jessie) #51

Open
sunweaver opened this issue Mar 9, 2015 · 36 comments
Open

Notifications "fly away" (in Debian jessie) #51

sunweaver opened this issue Mar 9, 2015 · 36 comments

Comments

@sunweaver
Copy link
Member

sunweaver commented Mar 9, 2015

Filed as DebianBug#779870:

Dear Maintainer,

   * What led up to the situation?

I'm running a recent install of debian jessie with MATE. To use bluetooth, I
installed the blueman package. I wanted to copy files from one device to
another.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

On trying to configure the connection to another device via bluetooth, I am
asked to confirm the connection and password via a notification. The problem
ist that the notification does not stay in the upper right corner, but it is
moving rather quickly to the left. It's so fast I can't read it, I had to make
screenshots of it. But I never managed to click the "confirm" button, which is
in the notification.

   * What was the outcome of this action?

As I found no other way to confirm a connection, blueman renders useless, I had
to send the files via mail.

   * What outcome did you expect instead?

Setting up a bluetooth connection.


PS: m-n-d kept using ca. 60% of the CPU, I had to kill the process (I only
realised that some time later, because of fan noise).It's completely
reproducible for me.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9346301-notifications-fly-away-in-debian-jessie?utm_campaign=plugin&utm_content=tracker%2F1172660&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1172660&utm_medium=issues&utm_source=github).
@Natureshadow
Copy link

I can confirm this issue.

@sunweaver
Copy link
Member Author

@stefano-k: do we have a solution for this?

@monsta
Copy link
Contributor

monsta commented Jul 22, 2015

Is it reproducible with notifications from any other apps, besides blueman?

@infirit
Copy link
Contributor

infirit commented Jul 22, 2015

As a workaround blueman has a fall-back notification widget which should allow folks to pair.

gsettings set org.blueman.general notification-daemon false

@monsta
Copy link
Contributor

monsta commented Jul 24, 2015

I've made a script out of blueman's code. It tries to imitate the real notification bubble behavior.

#!/usr/bin/python

from blueman.gui.Notification import Notification
from blueman.Functions import get_icon
from gi.repository import cairo

class StatusIconMock:
  def get_geometry(self):
    return (None, None, cairo.RectangleInt(-8536, -8951, 16, 16), None)

def ok():
    print ("Ok")

def err():
    print ("Err")

def RequestConfirmation(device, passkey, ok, err):
    def on_confirm_action(n, action):
        if action == "confirm":
            ok()
        else:
            err()

    alias = "Test alias"
    notify_message = _("Pairing request for:") + "\n%s" % alias
    if passkey:
        notify_message += "\n" + _("Confirm value for authentication:") + " <b>%s</b>" % passkey
    actions = [["confirm", _("Confirm")], ["deny", _("Deny")]]

    Notification("Bluetooth", notify_message, 0,
                 actions, on_confirm_action, pixbuf=get_icon("blueman", 48), status_icon=StatusIconMock())

RequestConfirmation(None, "Test passkey", ok, err)

Can you please run it and check if the notification bubble moves somewhere like described in the report?

@cschramm
Copy link

If that code is not enough to reproduce the issue it may be due to the missing pixbuf and status_icon parameters. The _NotificationBubble class uses the pixbuf for set_icon_from_pixbuf and the geometry of the status_icon (its center actually) for set_hint_int32. Could be involved in causing the issue.

@monsta
Copy link
Contributor

monsta commented Jul 27, 2015

I've added pixbuf=get_icon("blueman", 48) argument but still can't reproduce the issue.
As for status_icon, I can't figure out which class/function to pick from the code... 😄

@cschramm
Copy link

That's hard to add. It's the instance of the applet plugin class StatusIcon. You could also use some GtKWindow or any other object with a compatible get_geometry method to fake this, but I'd wait for @sunweaver's feedback first.

@sunweaver
Copy link
Member Author

@monsta: Can you paste latest test script version here? Thanks.

@monsta
Copy link
Contributor

monsta commented Jul 28, 2015

Ok, script updated

@sunweaver
Copy link
Member Author

@monsta: @schramm: The notification that comes up with monsta's script looks fine. No flying away notification can be seen here (on Debian jessie with MATE 1.8.x).

@cschramm
Copy link

@monsta You can use the following class to mock the status_icon parameter:

import cairo

class StatusIconMock:
  def get_geometry(self):
    return (None, None, cairo.RectangleInt(-8536, -8951, 16, 16), None)

Only the four numeric values are relevant to the _NotificationBubble. 16 should be the same while -8536 and -8951 - the center of the icon - could differ. If this still does not produce the issue, we may need to get @sunweaver's values in there.

@monsta
Copy link
Contributor

monsta commented Jul 28, 2015

Ok, now that's something. With this icon mock the notification bubble is always shown in the top left corner (current m-n-d setting is top right one). But it doesn't "flash" or "fly away" - I see it appearing there without any "animations".

Also I get a warning, not sure if it's major:

monsta@jessica:~$ ./notify_test.py 
./notify_test.py:9: TypeError: Passing arguments to gi.types.Boxed.__init__() is deprecated. All arguments passed will be ignored.
  return (None, None, cairo.RectangleInt(-8536, -8951, 16, 16), None)

@sunweaver: updated script once more.

@GiedriusS
Copy link
Contributor

Reproducible for me as well with that script and the notification moves away to the top left corner like it does for @monsta.
EDIT: Doesn't happen for me with the "Slider" theme. With all other themes it goes to the top left corner. Can anyone else confirm or deny this?

@infirit
Copy link
Contributor

infirit commented Aug 5, 2015

It is expected that the notification is shown in the different corner then configured when positional data is provided, which is what blueman does and so does the mock status icon. The bit that is responsible for this in the daemon can be found here. So if it show up at the top left corner it means the X and Y position are both zero or invalid. And in the script the rectangle has only zero for x, y, width and height. See below [1] updated script that does work.

Some questions,

  • Does the notification start under the blueman tray icon and then move off to zero X and Y coordinates?
  • Do the folks that see this have a notification area with the blueman trayicon?

[1] https://gist.github.com/infirit/8d54897d4a09d8091721

@infirit
Copy link
Contributor

infirit commented Aug 5, 2015

@GiedriusS, slider completely ignores the positional data it is given so that is also expected 😄

@monsta
Copy link
Contributor

monsta commented Aug 7, 2015

It is expected that the notification is shown in the different corner then configured when positional data is provided, which is what blueman does and so does the mock status icon.

Ah... so it's a feature rather than bug? 😄

Does the notification start under the blueman tray icon and then move off to zero X and Y coordinates?

For me it always appears right in the X,Y point. No moving.

Do the folks that see this have a notification area with the blueman trayicon?

In my VMs it doesn't matter if I have the applet running before the test or not. The behavior is always the same.

@infirit
Copy link
Contributor

infirit commented Aug 7, 2015

@monsta, to be clear. You always see the notification top left with blueman and my modified script? Or only one of the two?

@monsta
Copy link
Contributor

monsta commented Aug 7, 2015

My script shows it in the top left corner, your script shows it near that corner - with some offset (I guess this is due to rect.x = rect.y = 100). Otherwise, they behave the same.

@monsta
Copy link
Contributor

monsta commented Aug 7, 2015

As for blueman itself, I couldn't even find a way to make that notification appear at all (see blueman-project/blueman#329 (comment)).
That's why I had to make the script. 😄

@infirit
Copy link
Contributor

infirit commented Aug 7, 2015

your script shows it near that corner

Which is what I would expect so mate-notification-dameon is doing it correctly with the script. Mine with the x and y position at 100 and yours with x any y at zero.

The reason it is zero with cairo.RectangleInt(-8536, -8951, 16, 16) is that the positional data that is passed are ignored (which is what the warning is about).

@infirit
Copy link
Contributor

infirit commented Aug 7, 2015

Please apply the below debug patch (or add the two lines manually if the patch does not apply) and run the applet from a terminal as described here. This will provide the positional data that is provided to mate-notification-daemon.

diff --git a/blueman/gui/Notification.py b/blueman/gui/Notification.py
index fb995a8..0c7f18c 100644
--- a/blueman/gui/Notification.py
+++ b/blueman/gui/Notification.py
@@ -143,6 +143,8 @@ class _NotificationBubble(Notify.Notification):
             self.set_timeout(timeout)
         if status_icon:
             _, screen, area, orientation = status_icon.get_geometry()
+            debug_data = (area.x, area.y, area.width, area.height)
+            dprint("X pos: %s - Y pos: %s - Width: %s - Height: %s" % debug_data)
             self.set_hint_int32("x", area.x + area.width / 2)
             self.set_hint_int32("y", area.y + area.height / 2)

@monsta
Copy link
Contributor

monsta commented Aug 7, 2015

My script says: X pos: 0 - Y pos: 0 - Width: 0 - Height: 0
Yours says: X pos: 100 - Y pos: 100 - Width: 50 - Height: 50

@roberdaniel
Copy link

roberdaniel commented May 7, 2016

Hi all.
I want to say that this issue is also present in Debian Stretch with Mate 1.12.1
I recorded an explanatory video http://www.dailymotion.com/video/x49686v_blueman-notification-fly-like-superman-in-screen_tech . See video in Chrome/Chromiun (Firefox fails to show properly)
Please let me know how I could help.

Regards.

Edited

@raveit65
Copy link
Member

raveit65 commented May 7, 2016

your link gives an 404 error

@roberdaniel
Copy link

roberdaniel commented May 7, 2016

I left here another link http://dai.ly/x49686v

@raveit65
Copy link
Member

raveit65 commented May 7, 2016

Does not play here in 2 different browsers, why not uploading a video to a normal cloud like ie. dropbox?

@roberdaniel
Copy link

Sorry, Lets try again. https://youtu.be/_LOB3ry-vo0
Please see at second 17

@raveit65
Copy link
Member

raveit65 commented May 8, 2016

Whoow, what an amazing animation....
I never saw that before. Do you get this with other applications?
@infirit
@cschramm
any thoughts?

@infirit
Copy link
Contributor

infirit commented May 8, 2016

Debug patch and instructions, #51 (comment)

Test script, https://gist.github.com/infirit/8d54897d4a09d8091721

But I highly doubt this is blueman, it just uses libnotify, the rest is up to the notification daemon. And looking at the screencap the notification looks as if it got it's position data confused.

@raveit65
Copy link
Member

raveit65 commented May 8, 2016

Do you get this with all our notification themes?

@infirit
Copy link
Contributor

infirit commented May 8, 2016

Also try slider instead of nodoka.

@roberdaniel
Copy link

Hi guys.
I tried with with slider theme as suggested @infirit and it worked well 👍

Standard theme --------------> do nothing or sometimes blinks a bit top left corner.
Nodoka -------------------------> fly away behavior
Slider ----------------------------> works fine
Coco -----------------------------> do nothing

I tried other notifications, as suggested by @raveit65, the only that occurred to me is when you unplug Ethernet cable. This notification works well in all themes.
Hope this help.
Regards

@MoonSweep
Copy link

MoonSweep commented Apr 22, 2017

Hi,

Debian user here. I didn't witness the "flying window" problem but I did see other ones, I guess that they're all related to some extent. In the hope to be helpful, here are my findings.

First of all, note that all those problems happened since MATE was built against GTK3, which is the case in Debian from MATE 1.16 IIRC.

For all themes, I made four screenshots; normal popups and Bluetooth pairing popups, the first ones taken from my Sid box (1680x1050), which runs mate-notification-daemon with OpenBox/compton (that's why you can see a shadow around popups), and the second ones taken from my laptop running a full-fledged MATE desktop (1280x800), freshly upgraded from Jessie to Stretch (MATE 1.8.1 to 1.16.1); you can see that the various behaviors I describe for all themes are consistent, so OpenBox/compton are clearly not at fault here.

So, as was already said in this thread, the "Slider" theme (which, if I'm not mistaken, is the "real" default one, before MATE forked gnome's notification daemon) apparently ignores placement data, which makes it the only one to behave correctly, with a consistent spacing of the popups from the screen/panel borders. All other themes behave more or less badly, so maybe ignoring placement data altogether is the way to go ?

slider
slider_bt
slider
slider_bt

The "Coco" theme is the worst of all : popups asking for a Bluetooth pairing are half off-screen. This really hampers usability. Also note the popup placement, which overlaps the panel.

coco
coco_bt
coco
coco_bt

The "Default" theme is IMHO slightly better in the sense that its problems are only aesthetic, but there are many of them, making it quite ugly:

  • No black border line on the bottom and right side of the popup (both normal popups and Bluetooth)
  • Larger white padding inside the black border on the top side (Bluetooth)
  • Overfilling outside the black border on the top side (Bluetooth, I guess this is caused by the "arrow" pointing to Blueman applet)

standard
standard_bt
standard
standard_bt

The "Nodoka" theme is mostly right, apart of the fact that the Bluetooth popup is aligned with the right border of the screen, making me believe that it may be similar to the awful placing with "Coco", but to a lesser extent.

nodoka
nodoka_bt
nodoka
nodoka_bt

Hope it helps.

@pauldraper
Copy link

gsettings set org.blueman.general notification-daemon false

works for me. Using i3.

@raveit65
Copy link
Member

raveit65 commented Aug 9, 2023

Does the issue still exists?

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

No branches or pull requests