Variety menu shows up in left corner, instead of under the icon

Bug #1598298 reported by Jeremy M
74
This bug affects 9 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
Low
Unassigned
Variety
Fix Released
Critical
Unassigned
variety (Ubuntu)
Fix Released
Low
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Yakkety
Invalid
Undecided
Unassigned

Bug Description

Every time I click the Variety icon in the Mate panel, it shows the menu in the far left corner. It's been this way for several weeks now. I think it may have something to do with gtk 3.20. I'm using ArchLinux, and this behavior started about the time gtk 3.20 got pushed out.

This error shows up when running Variety in verbose log mode and clicking the icon:
TypeError: pos() takes exactly 2 arguments (4 given)

I also attached the log.

ArchLinux (x64, rolling), Linux desktop 4.6.3-1-ck
Variety 6.0
gtk 3.20
mate 1.12

----
Below is the SRU template (James Lu):

[Impact]

With newer versions of GTK+ / python-gi, some menus in Variety are showing up in the top left corner of the screen, instead of where the mouse clicks. Although this has no immediate impact on the menus' functionality, this bug is very noticeable when triggered and has been reported numerous times.

[Test Case]

A fair bit of menus are affected by this bug, including:

 * The menu that opens when clicking the "Add" button in Variety Preferences->General

 * The menu when right clicking a picture in the Wallpaper Selector

 * Some reporters have stated that this affects the menu that pops up from the Variety tray icon, but I haven't been able to reproduce this.

[Regression Potential]

I think the regression potential here is low, but any potential syntax errors or variable typos could break menus or cause the program to not start at all.

Upstream suggests testing the following in particular:
- Add and Remove buttons in Preferences should popup the menu exactly below the pressed button (like a dropdown).
- Thumbs window's right-click menu should popup at mouse position (e.g. History, Wallpaper Selector)
- Indicator should work both when using the indicator API (e.g. under Unity, or under Gnome with AppIndicator support extension installed - https://extensions.gnome.org/extension/615/appindicator-support/), as well as when using the StatusIcon API (e.g. under Gnome with no appindicator support).

Also, other things I haven't tried include multi-monitor support, and menus on DEs other than Cinnamon and Xfce.

[Other Info]

Some time between Ubuntu 14.04 and 16.04 (from what I can gather from https://bugs.launchpad.net/variety/+bug/1598298/comments/23), the arguments for https://lazka.github.io/pgi-docs/#Gtk-3.0/callbacks.html#Gtk.MenuPositionFunc changed in a breaking manner. More specifically, what used to pass 2 arguments now passes 4. Part of this fix makes the relevant functions accept a variable amount of arguments, so that it should be compatible with all system versions.

The other half of the fix is for the Variety indicator, and replaces a custom MenuPositionFunc using the old argument set with a static Gtk.StatusIcon.position_menu.

Related branches

Revision history for this message
Jeremy M (jskier) wrote :
Revision history for this message
Jeremy M (jskier) wrote :

Have been using Ubuntu 16 Mate, and the menu icon itself is fine, but when I right click the wallpaper selector reel the menu pops up in the left corner.

Revision history for this message
j s n j (jsnj) wrote :

I can confirm this menu behavior in GNOME Shell 3.20.3, 4.7.0-1-ARCH x86_64 GNU/Linux

Revision history for this message
Advisor (master-of-shadows) wrote :

This bug is actual.

Ubuntu 16.04 x64.

James Lu (jlu5)
Changed in variety:
status: New → Confirmed
summary: - Variety menu in left corner, Mate DE
+ Variety menu shows up in left corner, instead of under the icon
Peter Levi (peterlevi)
Changed in variety:
importance: Undecided → High
Revision history for this message
Peter Levi (peterlevi) wrote :

Patch for this bug appreciated, especially if tested to work in several DEs on both 14.04 and 16.04. I cannot reproduce it in my current setup (Unity on 14.04) and no time and hdd space right now for VMs.

James Lu (jlu5)
Changed in variety (Ubuntu):
status: New → Confirmed
Changed in variety (Ubuntu):
importance: Undecided → High
importance: High → Low
status: Confirmed → Triaged
Revision history for this message
James Lu (jlu5) wrote :

I'll take a look at this sometime soon.

Changed in variety:
assignee: nobody → James Lu (glolol)
Revision history for this message
James Lu (jlu5) wrote :

Hmm, I have MATE 1.14 and GTK+ 3.22 on Debian Testing/Unstable, and I can't reproduce the issue. Could it be that this is specific to GTK+ 3.20 and fixed later on?

Revision history for this message
Jeremy M (jskier) wrote :

Just tried gtk3.22 in Arch Linux testing, still a problem for me (no change). Running Mate 1.16.

James Lu (jlu5)
Changed in variety:
assignee: James Lu (glolol) → nobody
Revision history for this message
Jeremy M (jskier) wrote :

Confirming in xfce4 as well. Arch released GTK 3.22 recently to extra repo, no change, problem continues to persist.

Revision history for this message
Richard (zeph33) wrote :

Confirming in Gnome 3.22.2 on ArchLinux with variety 0.6.3

Revision history for this message
Richard (zeph33) wrote :

Change pos by None on line 323 and 326 in file indicator.py and menu is show on mouse pos

-- 323 self.menu.popup(None, None, pos, self.status_icon, 0, time)
++ 323 self.menu.popup(None, None, None, self.status_icon, 0, time)

-- 326 self.menu.popup(None, None, pos, self.status_icon, 0, Gtk.get_current_event_time())
++ 326 self.menu.popup(None, None, None, self.status_icon, 0, Gtk.get_current_event_time())

Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Ryan Beckett (mrbeckett) wrote :

Experiencing this issue also with Antergos & GNOME Shell 3.22.2

Revision history for this message
Hennie Marais (hennie-2) wrote :

I run Antergos with MATE 1.16 and GTK 3.20 and have this same problem. I managed to fix it with the following change to indicator.py:
--- indicator.py.old 2016-11-22 09:32:35.572057252 +0200
+++ indicator.py 2016-11-22 09:32:48.745402358 +0200
@@ -316,8 +316,8 @@
         self.status_icon = None
         self.visible = True

- def pos(menu, icon):
- return Gtk.StatusIcon.position_menu(self.menu, icon)
+ def pos(menu, x, y, icon):
+ return Gtk.StatusIcon.position_menu(self.menu, x, y, icon)

         def right_click_event(icon, button, time):
             self.menu.popup(None, None, pos, self.status_icon, 0, time)

Maybe the x and y arguments where made mandatory recently?

Revision history for this message
Jeremy M (jskier) wrote :

Thanks Hennie, that works great for the status icon for me.

The wallpaper selector Still goes to the upper left of the active monitor.

Revision history for this message
James Lu (jlu5) wrote :

Hi everyone,

Can you test the attached patch and see if it fixes this bug?

Revision history for this message
James Lu (jlu5) wrote :

For reference, my patch includes Hennie Marais's indicator change, as well as an update for the wallpaper selector (_compute_position() as mentioned in https://bugs.launchpad.net/bugs/1655606).

Revision history for this message
Jeremy M (jskier) wrote : Re: [Bug 1598298] Re: Variety menu shows up in left corner, instead of under the icon

Wallpaper selector still doesn't work for me (taskbar icon all good still):

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/variety/ThumbsManager.py", line
272, in _compute_position
    x, y = event.get_root_coords()[0], event.get_root_coords()[1]
AttributeError: 'NoneType' object has no attribute 'get_root_coords'

Running gtk3 3.22.6.

Revision history for this message
Jeremy M (jskier) wrote :

Same error with History bar as well.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-menu-positions.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Balló György (ballogy) wrote :

This patch fixes all popup menus.

Revision history for this message
Jeremy M (jskier) wrote :

Tested, works great, thank you György.

Revision history for this message
James Lu (jlu5) wrote :

I can confirm that György's patch also doesn't have any side effects for those who weren't affected by the original patch. Thanks!

James Lu (jlu5)
Changed in variety:
status: Confirmed → Triaged
Changed in hundredpapercuts:
status: Confirmed → Triaged
Peter Levi (peterlevi)
Changed in variety:
importance: High → Critical
Revision history for this message
Peter Levi (peterlevi) wrote :

Hi guys, sorry for the long silence from me, long period with zero time for Variety.

I tried György's patch, but it breaks a couple of things for me, on Ubuntu 14.04 with Unity.
1. ThumbsManager's popup menu stops appearing at all making that window unclosable
2. The menus for Add/Remove start appearing at the mouse cursor instead of right below the button, as was the intention

It seems that at some moment the API for https://lazka.github.io/pgi-docs/#Gtk-3.0/callbacks.html#Gtk.MenuPositionFunc has changed. The current documentation is for Gtk 3.22
(as seen here: https://lazka.github.io/pgi-docs/#Gtk-3.0), and I cannot find the older version of the documentation.

I have tried to make a universal fix that should work on any of the two versions by making the position functions accept variable number of parameters. Committed and pushed to master, and also attaching the patch here. Please give it a try and comment.

The things that need testing:
- Add and Remove buttons in Preferences should popup the menu exactly below the pressed button (like a dropdown).
- Thumbs window's right-click menu should popup at mouse position (e.g. History, Wallpaper Selector)
- Indicator should work both when using the indicator API (e.g. under Unity, or under Gnome with AppIndicator support extension installed - https://extensions.gnome.org/extension/615/appindicator-support/), as well as when using the StatusIcon API (e.g. under Gnome with no appindicator support).

Changed in variety:
status: Triaged → Fix Committed
Revision history for this message
Andreas Schöneck (as-) wrote :

@peterlevi Thank you.

Just pulled in the changes and tried it out. It now even works with Wayland for me, which did not before. At least for the history, the context menus are displayed correctly.

The appindicator issue is something I cannot test under Wayland since the icon is not shown at all with that setup.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package variety - 0.6.3-2

---------------
variety (0.6.3-2) experimental; urgency=medium

  * Add menu-position-varargs.patch from upstream Bzr revision 582
    (https://bazaar.launchpad.net/~peterlevi/variety/trunk/revision/582)
    to fix menus showing up at the top left of the screen on some systems.
    (LP: #1598298)

 -- James Lu <email address hidden> Wed, 15 Mar 2017 12:12:09 -0700

Changed in variety (Ubuntu):
status: Triaged → Fix Released
James Lu (jlu5)
description: updated
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

According to the logs, also yakkety needs fixes here.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :
Changed in variety (Ubuntu Xenial):
status: New → In Progress
Changed in variety (Ubuntu Yakkety):
status: New → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Jeremy, or anyone else affected,

Accepted variety into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/variety/0.6.2-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in variety (Ubuntu Yakkety):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Jeremy M (jskier) wrote : Re: [Bug 1598298] Re: Variety menu shows up in left corner, instead of under the icon
Download full text (5.3 KiB)

Thank you for fixing upstream. I've been using variety 0.6.3 in Arch
Linux for a couple of months now, and it patches in the fix for the
menus. It's been working great for me. The person who maintains the
package will (most likely) adopt any changes upstream in future
releases.

If interested, Arch build (source files contains the patch it uses):
https://www.archlinux.org/packages/community/any/variety/

I will try the upstream version in Arch and see how it works, but it
may be a few days. I don't really have a need to go into Ubuntu
anytime soon though.

--
Jeremy MJ

On Thu, Mar 23, 2017 at 1:33 PM, Brian Murray <email address hidden> wrote:
> Hello Jeremy, or anyone else affected,
>
> Accepted variety into yakkety-proposed. The package will build now and
> be available at
> https://launchpad.net/ubuntu/+source/variety/0.6.2-1ubuntu1 in a few
> hours, and then in the -proposed repository.
>
> Please help us by testing this new package. See
> https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
> to enable and use -proposed.Your feedback will aid us getting this
> update out to other Ubuntu users.
>
> If this package fixes the bug for you, please add a comment to this bug,
> mentioning the version of the package you tested, and change the tag
> from verification-needed to verification-done. If it does not fix the
> bug for you, please add a comment stating that, and change the tag to
> verification-failed. In either case, details of your testing will help
> us make a better decision.
>
> Further information regarding the verification process can be found at
> https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
> advance!
>
> ** Changed in: variety (Ubuntu Yakkety)
> Status: In Progress => Fix Committed
>
> ** Tags added: verification-needed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1598298
>
> Title:
> Variety menu shows up in left corner, instead of under the icon
>
> Status in One Hundred Papercuts:
> Triaged
> Status in Variety:
> Fix Committed
> Status in variety package in Ubuntu:
> Fix Released
> Status in variety source package in Xenial:
> In Progress
> Status in variety source package in Yakkety:
> Fix Committed
>
> Bug description:
> Every time I click the Variety icon in the Mate panel, it shows the
> menu in the far left corner. It's been this way for several weeks now.
> I think it may have something to do with gtk 3.20. I'm using
> ArchLinux, and this behavior started about the time gtk 3.20 got
> pushed out.
>
> This error shows up when running Variety in verbose log mode and clicking the icon:
> TypeError: pos() takes exactly 2 arguments (4 given)
>
> I also attached the log.
>
> ArchLinux (x64, rolling), Linux desktop 4.6.3-1-ck
> Variety 6.0
> gtk 3.20
> mate 1.12
>
> ----
> Below is the SRU template (James Lu):
>
> [Impact]
>
> With newer versions of GTK+ / python-gi, some menus in Variety are
> showing up in the top left corner of the screen, instead of where the
> mouse clicks. Although this has no immediate impact on the menus'
> functionalit...

Read more...

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Jeremy, or anyone else affected,

Accepted variety into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/variety/0.6.0-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in variety (Ubuntu Xenial):
status: In Progress → Fix Committed
James Lu (jlu5)
Changed in variety:
status: Fix Committed → Fix Released
milestone: none → 0.6.4
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [variety/xenial] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for xenial for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Jeremy M (jskier) wrote :

The fix works for me.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Change of SRU verification policy

As part of a recent change in the Stable Release Update verification policy we would like to inform that for a bug to be considered verified for a given release a verification-done-$RELEASE tag needs to be added to the bug where $RELEASE is the name of the series the package that was tested (e.g. verification-done-xenial). Please note that the global 'verification-done' tag can no longer be used for this purpose.

Thank you!

Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

Please verify the fix for Xenial.

Revision history for this message
karsibali (karsibali) wrote :

I have version 0.6.4 installed on Ubuntu 16.04 LTS and can verify that it works correctly.

Revision history for this message
Paul White (paulw2u) wrote :

Over four years after the last comment (#35) I'm closing this in the best way that I can bearing in mind that the SRU process did not complete as the documentation process required it to do so.

Ubuntu 16.10 (yakkety) reached end-of-life on July 20, 2017.
Ubuntu 16.04 (xenial) reached end-of-life on April 29, 2021.

Changed in variety (Ubuntu Xenial):
status: Fix Committed → Fix Released
Changed in variety (Ubuntu Yakkety):
status: Fix Committed → Invalid
Changed in hundredpapercuts:
status: Triaged → 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.