Adding foreign_new_xdisplay for Gdk X11



Hello,

 I am writting a Qt style that uses GTK+ to render its stuff; the inverse of 
gtk-qt-engine [1], and so I need to re-use the Qt Display connection. Would 
it be possible to add a function with the following signature to Gdk X11?
 GdkDisplay *gdk_x11_foreign_new_xdisplay (Display *)

 I have made this patch for mine 2.8.18:
http://www.alunos.dcc.fc.up.pt/~c0607045/trash/gdkdisplay-foreign.patch

 Just copied the bulk of gdk_display_open() to a function that creates a 
GdkDisplay from a X Display, which is then be used by gdk_display_open() and 
a new gdk_x11_foreign_new_xdisplay(). Also, added an is_foreign flag to 
GdkDisplayX11, so that gdk_display_close() doesn't get called on dispose.

 Btw, could the GtkStyle painting methods signature be changed so they take a 
generic GdkDrawable rather than a GdkWindow? Because I don't see a reason for 
why engines would need a GdkWindow and passing a GdkPixmap is sometimes 
useful. I understand if it breaks stuff, but at least document that a 
GdkPixmap is also acceptable.

Thanks,
 Ricardo

[1] http://www.alunos.dcc.fc.up.pt/~c0607045/trash/gtk4qt.png

-- 
You can't start worrying about what's going to happen.  You get spastic
enough worrying about what's happening now.
		-- Lauren Bacall



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