apps-menu: Exception: can't convert event.get_time() to an integer #7

Open
Jifl opened this Issue May 2, 2015 · 7 comments

Comments

Projects
None yet
7 participants
@Jifl

Jifl commented May 2, 2015

After a while of using the applications menu extension, sometimes items no longer execute when clicked on. Notably, gnome-shell outputs the following when you try:

JS ERROR: !!! Exception was: Error: can't convert event.get_time() to an integer
JS ERROR: !!! message = '"can't convert event.get_time() to an integer"'
JS ERROR: !!! fileName = '"/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js"'
JS ERROR: !!! lineNumber = '77'
JS ERROR: !!! stack = '"([object GObject_Union])@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:77
wrapper([object GObject_Union])@/usr/share/gjs-1.0/lang.js:213
([object GObject_Object],[object GObject_Union])@/usr/share/gnome-shell/js/ui/popupMenu.js:87
wrapper([object GObject_Object],[object GObject_Union])@/usr/share/gjs-1.0/lang.js:213
"'

The only way to stop it which I could find was to log out entirely - even restarting gnome-shell was insufficient.

Changing line 77 from:
this._app.open_new_window(event.get_time());
to e.g.:
this._app.open_new_window(-1);

makes this problem go away though. But obviously this is not a true fix. Hopefully a real fix should be easy so please have a look, thanks :-)

@eburgueno

This comment has been minimized.

Show comment
Hide comment
@eburgueno

eburgueno Jun 21, 2015

I can confirm the same issue and error.

I can confirm the same issue and error.

@sej7278

This comment has been minimized.

Show comment
Hide comment
@sej7278

sej7278 Oct 14, 2015

this seems to be present on the version of the plugin that comes as part of centos7, and not fixed in any update (just did a yum update and it reverted my manual -1 fix)

sej7278 commented Oct 14, 2015

this seems to be present on the version of the plugin that comes as part of centos7, and not fixed in any update (just did a yum update and it reverted my manual -1 fix)

@Circuitsoft

This comment has been minimized.

Show comment
Hide comment
@Circuitsoft

Circuitsoft Jan 4, 2016

I am now seeing this issue on a Debian Jessie box, with 28 days of uptime. Maybe, it's a problem once milliseconds since kernel reboot is outside a 32-bit signed integer range? This is a 64-bit platform, though...

I am now seeing this issue on a Debian Jessie box, with 28 days of uptime. Maybe, it's a problem once milliseconds since kernel reboot is outside a 32-bit signed integer range? This is a 64-bit platform, though...

@notklaatu

This comment has been minimized.

Show comment
Hide comment
@notklaatu

notklaatu Apr 29, 2016

This occurs on RHEL7.2 as well.

This occurs on RHEL7.2 as well.

@andrewgdotcom

This comment has been minimized.

Show comment
Hide comment
@andrewgdotcom

andrewgdotcom Jul 19, 2016

I opened an issue in debian for this ages ago, but have had no response there either.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810571

I opened an issue in debian for this ages ago, but have had no response there either.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810571

@Jifl

This comment has been minimized.

Show comment
Hide comment
@Jifl

Jifl Oct 16, 2016

Furthermore, the same thing can happen with the Places menu. Again, a workaround (not fix) is to edit /usr/share/gnome-shell/extensions/places-menu@gnome-shell-extensions.gcampax.github.com/placeDisplay.js and change line 46 from:
let launchContext = global.create_app_launch_context(timestamp, -1);
to:
let launchContext = global.create_app_launch_context(-1, -1);

Jifl commented Oct 16, 2016

Furthermore, the same thing can happen with the Places menu. Again, a workaround (not fix) is to edit /usr/share/gnome-shell/extensions/places-menu@gnome-shell-extensions.gcampax.github.com/placeDisplay.js and change line 46 from:
let launchContext = global.create_app_launch_context(timestamp, -1);
to:
let launchContext = global.create_app_launch_context(-1, -1);

@andyholmes

This comment has been minimized.

Show comment
Hide comment
@andyholmes

andyholmes Mar 3, 2018

I came across this while investigating a similar bug in my own extension. FWIW, the correct solution seems to be:

global.create_app_launch_context(0, -1)

Which is now used many places in Gnome Shell and explicitly allowed in the Shell global object documentation: https://developer.gnome.org/shell/stable/shell-shell-global.html#shell-global-create-app-launch-context

I came across this while investigating a similar bug in my own extension. FWIW, the correct solution seems to be:

global.create_app_launch_context(0, -1)

Which is now used many places in Gnome Shell and explicitly allowed in the Shell global object documentation: https://developer.gnome.org/shell/stable/shell-shell-global.html#shell-global-create-app-launch-context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment