Re: GtkApplication and argc/arv



On Thu, 10 Mar 2011 11:12:39 +0100
Alexandre Mazari <scaroo gmail com> wrote:
> > However, the deficiency I have found in the past with respect to
> > implementing single instance programs using gtk+/gnome is the window
> > manager.  Usually in the circumstances I have described you want
> > gtk_window_present() to do what it says it does (for the remote dbus
> > callback to bring up the chosen main application window to the
> > user), but the window manager seems to do its best to sabotage all
> > attempts to do so.
> 
> I am pretty sure you should do the gtk_window_present in your primary
> instance at one of your application's actions activation.
> Actually, it would be nice if the activation callback could receive
> the timestamp of
> the event, so we can use _present_with_time.

You can (and would), but gtk_window_present() doesn't do the job.  Try
for example moving to a new desktop and restarting the program (which,
following this arrangement, would cause the remote primary instance to
call gtk_window_present() on its main window). You can try combining
this with gdk_x11_window_move_to_current_desktop() or its libwnck
equivalent but you will still find the primary instance remains obscured
after a few restarts. Or you can just stay on the same desktop and
obscure the window, and restart a few times: the window manager
(metacity) will quickly become confused.  I have no idea how mutter
handles this, nor do I know if gtk_window_present_with_time() behaves
differently: ordinarily as you say following this arrangement you are
not in an event providing a time stamp.

This is I think in part to comply with some interface guidelines agreed
with KDE.

Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]