Re: GdkLibrary



Hey,

On Thu, 20 Jun 2002, Owen Taylor wrote:

> > 	I just noticed the need for something like this. I would have
> > thought something like
> >
> > GdkDisplay *gdk_library_lookup_display (const gchar *display_name);
> >
> > 	would have been nice, or that the lookup would be implicit in
> > gdk_open_display. Or maybe it should be lookup_screen, since that's
> > the lowest denominator of DISPLAY really ...
>
> Hmm, such a function gets into the really sticky question of
> "when are two server strings the same", which is, in general
> pretty much impossible to answer without opening up a connection
> to the display, setting a root window property on one server
> and seeing if you get it on the other...

	hmm, yes - icky :/

> What would you imagine using this for?

	Well, for BonoboControls. If you want to embed the plug in
sockets on different displays the BonboControlFrame would tell the
control which display its destined for - but how does the component
know if it already has that display open? Does it open a new
connection for every control? yuck ...

> > 	While we're on it, it might be nice to have a utility function
> > which takes a GdkScreen and munges the display name with the screen
> > number. This is a pain to do by hand and both the panel and nautilus
> > needs this for launching apps on different screens.
>
> Hmmm, so what you want is:
>
>  gdk_screen_get_display_name_that_would_make_this_the_default_screen()?
>
> I don't have much of an sense of what to call this function
> or how to implement it, but it does sound somewhat generally useful
> if a multihead-aware program is wanting to launch non-multihead
> functions.
>
> Bugzilla it; a patch would help if you want it in 2.2.

	gdk_screen_get_display_name() maybe ? Its in #86013.

> > 	Another thing I noticed was that there is a
> > gtk_plug_new_for_display, but no gtk_window_new_for_display. How
> > come?
>
> gtk_plug_new() has an argument that doesn't make sense without
> a GdkDisplay:
>
>   GtkWidget*      gtk_plug_new    (GdkNativeWindow  socket_id);
>
> So, the multihead variant needed a GdkDisplay; for a GtkWindow
> it's fine to first create the window, then set the display,
> so we can avoid cluttering the API.

	Right. But how do you do about realising windows on different
displays? Do you have to set the default display each time ?

> > 	Anyway, I managed to answer without addressing your questions -
> > how helpful of me :-)
>
> I never really _expect_ to get feedback on these type of questions;
> it's more like a vague hope. It's can encouraging to know that
> people are even reading the mails. :-)

	Heh, well I'm using the APIs in earnest at the moment so its
in my own interests to reply :-)

Good Luck,
Mark.




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