Merge ~mitya57/compiz:fix-popup-call into compiz:master

Proposed by Dmitry Shachnev
Status: Merged
Approved by: Dmitry Shachnev
Approved revision: b23bca0a9b941feec82f5c48445677946fd00a7f
Merged at revision: 79a94510af0c741c7a01cabe33faff6bdbbfc421
Proposed branch: ~mitya57/compiz:fix-popup-call
Merge into: compiz:master
Diff against target: 41 lines (+6/-2)
3 files modified
compizconfig/ccsm/ccm/Settings.py (+1/-1)
compizconfig/ccsm/ccsm (+4/-0)
debian/control (+1/-1)
Reviewer Review Type Date Requested Status
Alberts Muktupāvels Approve
Compiz Maintainers Pending
Review via email: mp+363332@code.launchpad.net

Commit message

ccsm: Fix TypeError when calling Gtk.Menu.popup() with invalid number of arguments.

Description of the change

It fixes this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ccm/Settings.py", line 723, in ButtonPressEvent
    self.Popup.popup(None, None, None, event.button, event.time)
TypeError: popup() missing 1 required positional argument: 'activate_time'

Replace the deprecated Gtk.Menu.popup() method with Gtk.Menu.popup_at_pointer().

Check GTK version on startup and exit if it is less than 3.22.

Steps to reproduce:

- Start CCSM.
- Open any plugin settings that have a list, e.g. Animation plugin, or Wizard plugin → Gravity tab.
- Click right mouse button on the list.

A context menu should open. No exception should be printed.

To post a comment you must log in.
Revision history for this message
Alberts Muktupāvels (muktupavels) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/compizconfig/ccsm/ccm/Settings.py b/compizconfig/ccsm/ccm/Settings.py
2index 58ebccb..ec498a9 100644
3--- a/compizconfig/ccsm/ccm/Settings.py
4+++ b/compizconfig/ccsm/ccm/Settings.py
5@@ -720,7 +720,7 @@ class BaseListSetting(Setting):
6 path, col, cellx, celly = pthinfo
7 treeview.grab_focus()
8 treeview.set_cursor(path, col, 0)
9- self.Popup.popup(None, None, None, event.button, event.time)
10+ self.Popup.popup_at_pointer(event)
11 return True
12
13 def KeyPressEvent(self, treeview, event):
14diff --git a/compizconfig/ccsm/ccsm b/compizconfig/ccsm/ccsm
15index 074ec74..6eb69fd 100755
16--- a/compizconfig/ccsm/ccsm
17+++ b/compizconfig/ccsm/ccsm
18@@ -37,6 +37,10 @@ from gi.repository import GdkX11
19 import sys
20 import os
21
22+if (Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION) < (3, 22):
23+ sys.exit("CCSM requires GTK 3.22 or later to run")
24+
25+
26 def try_register_dbus ():
27 '''Return instance of dbus control object on success, None on failure'''
28 try:
29diff --git a/debian/control b/debian/control
30index 9e49d6b..2161815 100644
31--- a/debian/control
32+++ b/debian/control
33@@ -313,7 +313,7 @@ Depends: ${shlibs:Depends},
34 ${misc:Depends},
35 ${python3:Depends},
36 gir1.2-gdkpixbuf-2.0,
37- gir1.2-gtk-3.0,
38+ gir1.2-gtk-3.0 (>= 3.22),
39 gir1.2-pango-1.0,
40 python3-compizconfig (>= ${source:Version}),
41 python3-gi,

Subscribers

People subscribed via source and target branches