mate-desktop / mate-notification-daemon

Daemon to display passive pop-up notifications
https://mate-desktop.org
GNU General Public License v2.0
30 stars 26 forks source link

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

Open sunweaver opened 9 years ago

sunweaver commented 9 years ago

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 commented 9 years ago

I can confirm this issue.

sunweaver commented 9 years ago

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

monsta commented 9 years ago

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

infirit commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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... :smile:

cschramm commented 9 years ago

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 commented 9 years ago

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

monsta commented 9 years ago

Ok, script updated

sunweaver commented 9 years ago

@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 commented 9 years ago

@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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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,

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

infirit commented 9 years ago

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

monsta commented 9 years ago

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? :smile:

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 commented 9 years ago

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

monsta commented 9 years ago

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 commented 9 years ago

As for blueman itself, I couldn't even find a way to make that notification appear at all (see https://github.com/blueman-project/blueman/issues/329#issuecomment-124108689). That's why I had to make the script. :smile:

infirit commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 8 years ago

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 commented 8 years ago

your link gives an 404 error

roberdaniel commented 8 years ago

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

raveit65 commented 8 years ago

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

roberdaniel commented 8 years ago

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

raveit65 commented 8 years ago

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

infirit commented 8 years ago

Debug patch and instructions, https://github.com/mate-desktop/mate-notification-daemon/issues/51#issuecomment-128689144

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 commented 8 years ago

Do you get this with all our notification themes?

infirit commented 8 years ago

Also try slider instead of nodoka.

roberdaniel commented 8 years ago

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

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 commented 7 years ago

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:

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 commented 3 years ago

gsettings set org.blueman.general notification-daemon false

works for me. Using i3.

raveit65 commented 1 year ago

Does the issue still exists?