Open sunweaver opened 9 years ago
I can confirm this issue.
@stefano-k: do we have a solution for this?
Is it reproducible with notifications from any other apps, besides blueman?
As a workaround blueman has a fall-back notification widget which should allow folks to pair.
gsettings set org.blueman.general notification-daemon false
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?
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.
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:
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.
@monsta: Can you paste latest test script version here? Thanks.
Ok, script updated
@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).
@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.
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.
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?
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,
@GiedriusS, slider completely ignores the positional data it is given so that is also expected :smile:
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.
@monsta, to be clear. You always see the notification top left with blueman and my modified script? Or only one of the two?
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.
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:
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).
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)
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
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
your link gives an 404 error
I left here another link http://dai.ly/x49686v
Does not play here in 2 different browsers, why not uploading a video to a normal cloud like ie. dropbox?
Sorry, Lets try again. https://youtu.be/_LOB3ry-vo0 Please see at second 17
Whoow, what an amazing animation.... I never saw that before. Do you get this with other applications? @infirit @cschramm any thoughts?
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.
Do you get this with all our notification themes?
Also try slider instead of nodoka.
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
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 ?
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.
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:
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.
Hope it helps.
gsettings set org.blueman.general notification-daemon false
works for me. Using i3.
Does the issue still exists?
Filed as DebianBug#779870: