Re: gnome_win_hints_init()




Felix Bellaby <felix@pooh.u-net.com> writes:

> Hi all,
> 
> gnome_win_hints_init() unconditionally performs a collection of
> XInternAtom calls and is best done only once.

Just to mention something - if you use gdk_atom_intern() caches
the atoms client side, so if you use that instead of
XInternAtom(), you may not care too much about whether you
make the call once or several time.

> I want to use the gnome hints to move the gnome_client_save_*_dialogs 
> on top of the other windows on the desktop (because these dialogs are 
> the only windows which receive input during a session save: see 
> discussion on gtk-devel). This requires that gnome_win_hints_init() 
> is called somewhere in the gnome-libs.
> 
> Is there any objection to incorporating a call to gnome_win_hints_init()
> into gnome_init_with_popt_table() ?
> 
> BTW, are we happy with gnome-winhints.c using X and gdkprivate.h ?

As raster said, I don't think it really matters if portions
of code which are completely X specific use X calls.
 
> The win hints protocols which send ClientMessages to the WM seem  
> to require these. The format of these protocols is essentially 
> identical to the ICCCM protocol for instructing the WM to iconify 
> a client window. (The use of the SubstructureNotifyMask is not 
> specified in the ICCCM but helps restrict the messages to the WM).
> 
> Perhaps we need a minor addition to gdk to help send these messages ?
> 
> gboolean
> gdk_event_send_client_message_to_wm (GdkEvent *event, GdkWindow *window)
> {
>   GdkWindowPrivate *private = (GdkWindowPrivate *)window;
>   XEvent sev;
> 	
>   g_return_val_if_fail(private != NULL, FALSE);
>   g_return_val_if_fail(event != NULL, FALSE);
>   
>   sev.xclient.type = ClientMessage;
>   sev.xclient.display = gdk_display;
>   sev.xclient.format = event->client.data_format;
>   sev.xclient.window = private->xwindow;
>   memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
>   sev.xclient.message_type = event->client.message_type;
>   
>   return gdk_send_xevent (gdk_root_window, False, 
> 			  SubstructureNotifyMask, &sev);
> }

Hmmm, this looks rather overspecialized to me. But, in any,
case, this would have to be a GTK+-1.3 thing. I think
using X directly is fine for now.
 
> (Note that this function passes a GdkWindow* not an xid. Why does 
>  gdk_event_send_client_message pass an xid ?)

The client message stuff in GDK is rather hacked on top
than done well. It probably uses the xid because the
person who added it was using it to communicate with
windows where they only had the xid, and they didn't
want to use gdk_window_foreign_new().

                                        Owen



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