GVim does not show its menu structure

Bug #733265 reported by Alberto Ruiz
116
This bug affects 22 people
Affects Status Importance Assigned to Milestone
DBus Menu
Triaged
High
Ted Gould

Bug Description

GVim does not show its menu structure at startup. After a while the menus come back to the window and this debugging output is shown:

** (gvim:7581): WARNING **: Unable to register window with path '/com/canonical/menu/640001E': Timeout was reached

** (gvim:7581): WARNING **: Unable to register window with path '/com/canonical/menu/640001E': Timeout was reached

Revision history for this message
Sebastien Bacher (seb128) wrote :

is gvim using gtk for its ui? does it get its menu hidden from the dialog?

Changed in dbusmenu:
assignee: nobody → Ted Gould (ted)
Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 733265] Re: GVim does not show its menu structure

On Fri, 2011-03-11 at 14:06 +0000, Sebastien Bacher wrote:
> is gvim using gtk for its ui? does it get its menu hidden from the
> dialog?

They get hidden until the timeout expires. The odd part to me is that
it also gets this error a minute or so later:

LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Operation was
cancelled

Which makes me wonder if there's some way that GVim is being run that
make it so it can't connect to the session bus properly. We should be
able to detect this better in appmenu-gtk though.

Revision history for this message
Konstantin Alekseev (kv-alekseev) wrote :

For me, Gvim menu works well if it started from the shortcut, but shows this error when you run it from terminal or Alt+F2
** (gvim:4667): WARNING **: Unable to register window with path '/com/canonical/menu/3600003':

Revision history for this message
Ted Gould (ted) wrote :

This works for me with the current dbusmenu. I seem to get all the menus.

Changed in dbusmenu:
status: New → Fix Released
Revision history for this message
traxxas (traxxas) wrote :

The problem still persists when launched from terminal or Alt+F2. To fix it gvim needs to launched with the -f switch to Not fork when starting GUI. This is how it is launched from the shortcut. I added a base alias and everything works great now.

Revision history for this message
Aaron Bentley (abentley) wrote :

This bug also affects me, when gvim is run from the commandline (the only way I run it).

Revision history for this message
Aaron Bentley (abentley) wrote :

If I run it with -f, the global menu is used, and backgrounding it with "&" works fine.

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Why is this marked fix released? There is still a bug. Using -f and & is a work-around, not a fix

Revision history for this message
Pascal Hartig (passy) wrote :

I'm still experiencing this.

Changed in dbusmenu:
status: Fix Released → Triaged
importance: Undecided → High
Revision history for this message
John Clemens (clemej) wrote :

Agreed. when developing, I jump around the source tree in my terminal and spawn gvims to load files.. often a few at a time. the auto-backgrounding feature of GVim is rather essential to this mode of operation, which I suspect is one of the main use cases of GVim. If dbusmenu can't handle programs which are backgrounded, that's a very serious design flaw in dbusmenu, and is most certainly a bug. I hit this every day at work and at home.

At the very least, is there some way to disable dbusmenu for GVim? a blacklist somewhere, perhaps?

Revision history for this message
Aaron Bentley (abentley) wrote :

@John, the simplest solution for me was to add this script as ~/home/bin/gvim:

#!/bin/sh
/usr/bin/gvim -f $@ &

Revision history for this message
Rob Golding (rob-robgolding) wrote :

A better workaround is to disable the menu proxy by adding an alias to gvim as such:

alias gvim='UBUNTU_MENUPROXY= gvim'

See http://www.webupd8.org/2011/03/disable-appmenu-global-menu-in-ubuntu.html for a little more info on this setting.

Revision history for this message
sinkog (sinkog0208) wrote :

insert into a bridging solution;. bashrc

gvim(){ /usr/bin/gvim -f "$@" & true; }

I do not like a solution but at least it works ... So that developers of a popular program for all functionality to work here ... there must write miscellaneous and we'll get corrected if I'm not going to know in life, and unnecessarily complicates the explicit anyway 'simple' is not in an bashrc.

In the meantime, while not measured can not be corrected in a global setting arm of the provisional solution ?....

Revision history for this message
Aaron Bentley (abentley) wrote :

@Rob Golding
I don't think your workaround is better. The other solution makes Gvim use the unified menu. Yours prevents Gvim from using it.

Revision history for this message
John Clemens (clemej) wrote :

The question is, WHY is this happening? Why does launching gvim and having it detach from the terminal cause a gtk menu not to work? this seems like a strange quirk of DBUS. Can one of the dbus/dbusmenu devs explain, or point to some developer docs that explain?

I could tackle fixing this since I've got some time and it -really- annoys me, but I don't understand the problem.

Revision history for this message
Berto (bertosmailbox) wrote :

In my .gvimrc I had the following line that was causing the problem for me:

set guioptions-=T

After commenting it out (a double quote at the beginning of the line), the problem went away and gvim would do the menubar magic.

Hope this helps.

Revision history for this message
Berto (bertosmailbox) wrote :

Sorry for the confusion, the problem still persists without the guioptions line.

Revision history for this message
inye (j-contrerasferrada) wrote :

running with sudo works fine
               sudo gvim hello

, but like a normal user still the probleme here.

Revision history for this message
Mark Wilkinson (mhw) wrote :

Bug #776499 looks like a duplicate of this one, but has more activity so I'm not sure which one to mark as a duplicate.

Revision history for this message
voyeg3r (voyeg3r) wrote :

#I've found a simplest solution

sudo cp /usr/share/icons/gvim.desktop /usr/share/icons/gnome-gvim.desktop

#And my gvim came back normally

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers