Ubuntu

gvim gets no global menu, timeout warning on the console

Reported by Marius Gedminas on 2011-05-03
762
This bug affects 198 people
Affects Status Importance Assigned to Milestone
DBus Menu
Undecided
Unassigned
vim (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: vim

Whenever I launch gvim from a terminal in Unity, I get this message after a few seconds

  ** (vim:5800): WARNING **: Unable to register window with path '/com/canonical/menu/5400003': Timeout was reached

The gvim window has a regular menu bar and doesn't use Unity's global menu.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: vim-gnome 2:7.3.035+hg~8fdc12103333-1ubuntu7
ProcVersionSignature: Ubuntu 2.6.38-9.43-generic 2.6.38.4
Uname: Linux 2.6.38-9-generic i686
Architecture: i386
Date: Tue May 3 18:41:32 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
ProcEnviron:
 LANGUAGE=lt_LT:en
 LC_CTYPE=lt_LT.UTF-8
 PATH=(custom, user)
 LANG=lt_LT.UTF-8
 SHELL=/bin/bash
SourcePackage: vim
UpgradeStatus: Upgraded to natty on 2011-04-29 (4 days ago)

Marius Gedminas (mgedmin) wrote :
Carsten Agger (agger) wrote :

Workaround: launch as "gvim -f" and the menu reappears.

This should not be necessary, though; and the warning is still printed on the console:

(gvim:10543): GnomeUI-WARNING **: While connecting to session manager:
None of the authentication protocols specified are supported.

Changed in vim (Ubuntu):
status: New → Confirmed
Carsten Agger (agger) wrote :

Of course, the warning mentioned above may be unimportant. This is what matters, i suspect:

** (gvim:10615): WARNING **: Unable to register window with path '/com/canonical/menu/4800003': Tiden løb ud

And you don't see that with gvim -f.

Colin D Bennett (colinb) wrote :

Workaround confirmed. Running “gvim -f” makes the global menu appear correctly. Of course it's not usually convenient to run gvim -f so it would be nice to have this bug actually fixed.

Hi,

I recently upgraded to Ubuntu 11.04 and I am using Unity.

when I run "gvim" or "gvim -f" from the terminal window I get none of the usual 2 menu bars(icons and the "file, edit, etc".

When I run "gvim" from Unity application search window I do get the menu bar with the icons but still not get the text menu bar. I also use the latex suite. This means that when I open a latex file I can not get any of the specific menu options for latex.

For the time being I am going to switch to gnome again. I like unity but this bug is a mayor problem for me. Any chance any body can find a solution?

Please let me know if you need any further input from me.

Also note that I tried adding the menu bar from inside vim (set guioptions+=m) without any changes.

I also deleted the ~/.gnome2/Vim file as this created the same problems for the previous ubuntu version. It did not change anything as far as I can see.

Thanks!

Harry van Haaren (harryhaaren) wrote :

Can't reproduce the dissapearing icons upon using "gvim -f", can confirm the "timeout warning" & no menu bar. Marking as confirmed in unity.

Changed in unity:
status: New → Confirmed
Bart (bart-geluykens) wrote :

I guess the best workarount is to add in ~/.bashrc the lines

function gvim () { /usr/bin/gvim -f $* & }

Juan J. Martínez (jjmartinez) wrote :

@Bart the -f workaround is fine if you never launch gvim from your shell.

In my case that means loosing a terminal every time I open gvim :(

Bart (bart-geluykens) wrote :

@Juan
That's the point of the function

The & sign at the end of the gvim command starts gvim in an other process so you do'nt lose your terminal.

That's why I've created a function and not an alias.

Didier Roche (didrocks) on 2011-06-20
Changed in unity (Ubuntu):
status: New → Confirmed

Hi,

gvim (with and without -f) from the unity application search window works fine now
From shell:
gvim -f opens a partial menu list with only 3 items for me, all of them refer to add ons: Tools, Bash, C++. All the other menus are missing.

gvim without -f from shell is missing all the menu. entries.

Creating the function gvim "function gvim () { /usr/bin/gvim -f $* & }" and then running gvim from the same shell has the same partial menu as simply running gvim -f from the shell.

Cheers

Stephan Adig (sadig) wrote :

Moins,

I don't see the error message on the terminal when starting gvim.
But gvim -f helps here.

But the disappearance of the global menu bar came with the last update of Unity in Natty.
before that it worked as expected.

ANything you need to track down the problem?

Regards,

\sh

eldad (eldad-a) wrote :

In my case the forking (-f) or launching using the Unity interface worked ONLY after
removing ~/.gnome2/Vim and all ~/.gnome2/gvim* files.

for now, when I launch from the command line (which is the usual case):
gvim filename.ext -f &

Gregory Symons (gsymons) wrote :

I'm seeing this problem still. I'm not actually that concerned with the menus not appearing, since I don't use them anyway. But if I don't have gvim maximized, then the window has no title bar. Is this a related issue or is there another bug for it?

I see the problem in vim creating the gtk menu before the fork(). With the original gtk menu this is no problem. But appmenu-gtk creates the menu using dbus. Probably, the dbus connection for the global menu creation does not survive the fork(). Or, if the dbus connection survives the fork, it might be that the ongoing dbus transaction (i.e. the menu creation) does not.

Having the same problem in ubuntu 11.10

Farmbuyer (farmbuyer) wrote :

This same bug (apparently) just got fixed in fedora last month:
https://bugzilla.redhat.com/show_bug.cgi?id=727385

Marius Gedminas (mgedmin) wrote :

This is also fixed upstream, I think: http://code.google.com/p/vim/source/detail?r=3ecf9e91d88acdb5eaaf93cc15a18914b60e0eb3

    changeset: 3087:3ecf9e91d88a
    tag: v7-3-315
    user: Bram Moolenaar <email address hidden>
    date: Wed Sep 14 19:04:39 2011 +0200
    files: src/gui.c src/version.c
    description:
    updated for version 7.3.315
    Problem: Opening a window before forking causes problems for GTK.
    Solution: Fork first, create the window in the child and report back to the
                parent process whether it worked. If successful the parent exits,
                if unsuccessful the child exits and the parent continues in the
                terminal. (Tim Starling)

I've built the newest upstream from sources, and I can confirm that the fix works fine: gvim (*without* -f) has a working global menu.

Changed in unity:
status: Confirmed → Invalid
Changed in unity (Ubuntu):
status: Confirmed → Invalid
Marius Gedminas (mgedmin) wrote :

Setting bug status of Unity bug tasks to Invalid, since this is a purely vim issue (besides, fixed upstream in vim already).

Mgedmin: if it's fixed in vim already, when will new vim packages be available for oneiric?

Marius Gedminas (mgedmin) wrote :

Most likely, not until someone submits a SRU request (see https://wiki.ubuntu.com/StableReleaseUpdates). I'm a bit fuzzy on the details, since I've never done that. I'm not even sure if a SRU is appropriate here (is this a "high-impact bug"?).

Precise already has vim 2:7.3.333-1ubuntu1, which should have the upstream fix. Can anyone verify that this bug is fixed there?

Szabolcs (szhorvat) wrote :

Possibly related bug (also worked around by gvim -f): https://bugs.launchpad.net/ubuntu/+source/vim/+bug/856779

Morten Siebuhr (msiebuhr) wrote :

Installing the Precise-packages on Oneiric doesn't work (just in case anybody else might want to try that out):

  > sudo dpkg -i vim-gnome_7.3.333-1ubuntu2_amd64.deb
  (Reading database ... 283960 files and directories currently installed.)
  Preparing to replace vim-gnome 2:7.3.333-1ubuntu2 (using vim-gnome_7.3.333-1ubuntu2_amd64.deb) ...
  Unpacking replacement vim-gnome ...
  dpkg: dependency problems prevent configuration of vim-gnome:
   vim-gnome depends on libacl1 (>= 2.2.51-4); however:
    Version of libacl1 on system is 2.2.51-3.
   vim-gnome depends on libperl5.14 (>= 5.14.2); however:
    Package libperl5.14 is not installed.
  dpkg: error processing vim-gnome (--install):
   dependency problems - leaving unconfigured
  Errors were encountered while processing:
   vim-gnome

I unfortunately don't have the time to try install a virtual Precise, just to check it out.

(Perhaps someone has a Vim-PPA for Oneiric somewhere?)

Gediminas Paulauskas (menesis) wrote :

I found one PPA that has the same version as in precise, rebuilt:

https://launchpad.net/~yofel/+archive/backports

and vim-gtk from there has a working global menu.

Weeble (clockworksaint) wrote :

I found the workaround in #7 helpful, but it had two problems, one major, one minor: It doesn't dissociate vim from the terminal, so if you close the terminal window vim gets abruptly terminated too; also, vim spits out quite a few GTK warnings on the console, which I'd rather not see. Here's what I'm using now:

function gvim {
    /usr/bin/gvim -f $* > /dev/null 2> /dev/null & disown
}

I tried nohup to begin with, but it didn't seem to help. The process was still killed by a sighup when the terminal closed. The redirect and disown seems to work better.

Seeing this in precise beta. Neither gvim nor gvim -f get me a global menu.

Reece H. Dunn (msclrhd-gmail) wrote :

I am seeing the following in Precise:

$ gvim
** (gvim:31556): WARNING **: Unable to create Ubuntu Menu Proxy: Timeout was reached

when running in Gnome Shell.

$ gnome-shell --version
GNOME Shell 3.4.0

$ gvim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 6 2011 08:53:30)
Included patches: 1-353
Compiled by reece@freya
Normal version with GTK2 GUI. Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi
+file_in_path +find_in_path +float +folding -footer +fork() +gettext
-hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall
+linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname
+mouse +mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm
-mouse_sysmouse +mouse_xterm -mouse_urxvt +multi_byte +multi_lang -mzscheme
+netbeans_intg +path_extra -perl +persistent_undo +postscript +printer -profile
 -python -python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
 +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
+xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/local/include -g -O2 -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lnsl -lselinux -ldl

$ pkg-config --modversion gtk+-2.0
2.24.10

$ pkg-config --modversion gtk+-3.0
3.4.0

Tobias Quinn (tobias-quinn) wrote :

This also happens with gnome-shell 3.4.1 and gtk+-3.0 3.4.1

Yubin Kim (shdwfeather) wrote :

Gvim starts immediately in Precise (if you are not running ibus), but there is still no global menu.

For those who are still experiencing delays in gvim with the error message "** (gvim:10361): WARNING **: Unable to create Ubuntu Menu Proxy: Timeout was reached", it may be because you are running ibus. Take a look at https://bugs.launchpad.net/ubuntu/+source/vim/+bug/987707

Charl P. Botha (cpbotha) wrote :

In the released 12.04, vim-gnome, started from gnome-console, unfortunately keeps its own menubar when maximized, instead of merging with global. Starting gvim with -f fixes this behaviour.

gvim when started from searching in the dash shows the correct behaviour.

Tobias Quinn (tobias-quinn) wrote :

Placing the line:

export UBUNTU_MENUPROXY=0

at them end of ~/.bashrc stops the spurious line being emitted when gvim is launched from the terminal.

#30 works fine, but for those who want to keep the global menus, here's some improvements on the solutions in #7 and #24:

Add this to ~/.bashrc:
function gvim () { (/usr/bin/gvim -f "$@" &) }

Or, to also suppress all output from gvim:
function gvim () { (/usr/bin/gvim -f "$@" &>/dev/null &) }

The improvements:
Handle filenames with spaces etc. correctly.
Also, use a subshell, (foo &), instead of the method in #24, foo & disown, to run gvim in the background (although either method seems to work fine).

Bruno França (qrntt) wrote :

Starting the gui mode from terminal vim makes the global menu appear correctly. So one possible workaround is to alias "gvim" to "vim -c :gui".

Omer Akram (om26er) on 2012-05-24
no longer affects: unity (Ubuntu)
affects: unity → dbusmenu
Changed in dbusmenu:
status: Invalid → New
Bilal Akhtar (bilalakhtar) wrote :

Starting up GVim from Unity dash gives me the global menu. Starting Gvim from terminal without -f doesn't give me global menu, while -f does.

I guess it's fixed, either way it has nothing to do with dbusmenu. It's a problem with GVim.

Changed in dbusmenu:
status: New → Invalid
wdesmet (kromagg) wrote :

Since a recent Unity update, this also freezes the vim UI for me until the timeout has been reached, which really slows things down.

Until this is solved, I'll put a "set guioptions+=f" into my vimrc. Gvim will then occupy the console, but I can regain the console easily with "CTRL-Z" and "bg". This is also the same behavior every other X11 application has when started from the console.

Some further internal notes:
1) The "fix" mentioned in Comment #17 is already included with Precise
2) gtk_init_check() is called before (!) the fork by gui_mch_init_check() in gui_gtk_x11.c. My guess is that gtk_init_check() has to be called after the fork (i.e. in the child process) in order for the dbusmenu to succeed.

tags: added: precise
tantalum (blit32) on 2013-02-09
description: updated
dino99 (9d9) on 2013-05-04
tags: removed: natty
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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