gnome_win_hints_init()



Hi all,

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

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 ?

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);
}

(Note that this function passes a GdkWindow* not an xid. Why does 
 gdk_event_send_client_message pass an xid ?)

Felix



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