楼主我参考了些程序,也写了个背景透明的测试程序,可是怎么都不能透明,能不能帮我看看,谢谢
是不是哪里有问题?如果有问题,请指出,或者给我个示例程序,谢谢!
[code:1]
#include <gtk/gtk.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#define OPAQUE 0xffffffff
unsigned int opacity = 0x0fffffff;
int main( int argc, char *argv[] )
{
GtkWidget *window;
gtk_init (&argc, &argv);
// _KDE_WM_WINDOW_OPACITY
// _NET_WM_WINDOW_OPACITY
/*
gdk_property_delete(gdk_window,
(GdkAtom)gdk_x11_xatom_to_atom(property));
*/
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gdk_error_trap_push ();
gdk_property_change(window->window,
gdk_atom_intern("_NET_WM_WINDOW_OPACITY", FALSE),
gdk_atom_intern("CARDINAL", FALSE),
32, GDK_PROP_MODE_REPLACE,
(guchar*) &opacity, 1L);
gdk_error_trap_pop ();
gtk_main ();
return 0;
}
[/code:1] |