remote_foreground() doesn't work exactly on GTK (on KDE)

39 views
Skip to first unread message

ron

unread,
Dec 17, 2009, 3:13:05 AM12/17/09
to vim_dev
If the gvim server is minimized then using remote_foreground() does
make it restore to its original size. However, whether it was
minimized or not, if another window is above it in Z-order, the
restored gvim will appear *behind* the front window.

I would have thought that "foreground" begins the window to the front
of the Z-order where it can be interacted with directly, not that it
is merely restored to 'normal' size.

ron

unread,
Dec 17, 2009, 3:28:11 AM12/17/09
to vim_dev
Apparently it's a problem (==feature) with the way gtk_window_present
() works. Window managers have the option of ignoring the restacking
request. So is there are workaround?

Peter Odding

unread,
Dec 17, 2009, 10:48:56 AM12/17/09
to vim...@googlegroups.com
> So is there are workaround?

Not in Vim, but since you mention GTK the command-line program "wmctrl"
might offer a workaround? I'm using it in a shell script that
wraps /usr/bin/gvim to open files from the command-line and in the GUI
within a single Gvim instance. The following command raises an existing
Vim window whether it's on the current desktop or a different one, and
whether the window was minimized or not:

wmctrl -xa gvim.Gvim

Because of the -x it matches the window to raise by it's window class,
which means any single Vim window could be raised by the command. In
your case that probably wouldn't be very useful, because you intended
to use remote_foreground(). However wmctrl can also match windows by
their id and title string.

Hope this helps.

- Peter Odding

ron

unread,
Dec 17, 2009, 10:59:42 AM12/17/09
to vim_dev
Hi, Peter -

Thanks, that is a help. I'm using KDE though, so maybe some DCOP
incantation or similar would be what I need?

Best ,
Ron

Matt Wozniski

unread,
Dec 17, 2009, 12:02:34 PM12/17/09
to vim...@googlegroups.com

wmctrl is window manager agnostic - its basic features should work in
just about every window manager. So, while you might be able to do
some dcop magic instead, there's no reason you couldn't use wmctrl.

~Matt

ron

unread,
Dec 17, 2009, 12:06:53 PM12/17/09
to vim_dev
In fact, I just got wmctrl installed on my machine and checked it out
--- it works! Thanks guys!
Reply all
Reply to author
Forward
0 new messages