Notification popup badly placed when no icon is shown.

Bug #32666 reported by Mathieu Pillard
10
Affects Status Importance Assigned to Milestone
gnome-power-manager (Ubuntu)
Fix Released
Medium
Daniel Silverstone

Bug Description

Because of bug 32655 I had no icon displayed, but notification popup about the fact that I was now running on battery showed up (thanks to the patch in bug 32644). It was wrongly placed on the top left of my screen, with an arrow pointing to that direction; however, my panel and the notification area are in the bottom, so the notification area is badly placed, and so is its arrow.

This is still with latest dapper, using gnome-power-manager 2.13.91-0ubuntu2.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

You got a screenshot please?

Revision history for this message
Mathieu Pillard (diox) wrote :

I didn't screenshot at that time, and I'm having trouble reproducing it. It might only happen with your patch from bug 326444, which I am not using right now, and was when I reported the bug.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

This is the function for finding the center of the widget:

static gboolean
get_widget_position (GtkWidget *widget,
       int *x,
       int *y)
{
 g_assert (widget);

 gdk_window_get_origin (GDK_WINDOW (widget->window), x, y);

 *x += widget->allocation.x;
 *y += widget->allocation.y;
 *x += widget->allocation.width / 2;
 *y += widget->allocation.height;

 gpm_debug ("widget position x=%i, y=%i", *x, *y);

 return TRUE;
}

We probably need to add a test in there somehow, or maybe inprove the algorithm used.

Revision history for this message
Mathieu Pillard (diox) wrote :

I reproduced the problem while testing bug 32665. It seems the notification appears just before the icon and is wronly placed in consequence. I have a screenshot, no log yet though, I'll work on that.

Revision history for this message
Mathieu Pillard (diox) wrote : Screenshot of the problem

This is a screenshot of the top left corner of my screen. The notification area is is at the bottom, towards the middle.

PS: if it's related to the icon being absent at the time of the notification, maybe you should just let the notification be "arrowless", like for instance gnome-volume-manager's disk full warnings. These appear at the bottom right of my screen, stacking.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

>PS: if it's related to the icon being absent at the time of the notification,
>maybe you should just let the notification be "arrowless"

In CVS, I think this is what I've got:

if (tray->priv->is_visible) {
 get_widget_position (GTK_WIDGET (tray), &x, &y);
 notify_notification_set_hint_int32 (tray->priv->notify, "x", x);
 notify_notification_set_hint_int32 (tray->priv->notify, "y", y);
}

Richard.

Revision history for this message
Mathieu Pillard (diox) wrote :

Ah, looks good. I'll try to test out CVS as soon as I can.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Any luck testing this further? Dapper should contain the relevant changes now.

Changed in gnome-power-manager:
assignee: nobody → dsilvers
status: Unconfirmed → Needs Info
Revision history for this message
Mathieu Pillard (diox) wrote :

Yes, it seems to be working fine now: when there is no icon the notification is simply put in the corner of the screen, without the arrow.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote : Re: [Bug 32666] Re: Notification popup badly placed when no icon is shown.

Thanks for following up!

 status FixReleased

Changed in gnome-power-manager:
status: Needs Info → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.