大佬教程收集整理的这篇文章主要介绍了c – 带有Xlib的空或透明窗口仅显示边框线,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
只有当您的X11和图形硬件配置支持深度为32位的视觉效果时,它才会起作用.
#include <X11/Xlib.h> #include <X11/Xutil.h> int main(int argc,char* argv[]) { Display* display = XOpenDisplay(null); XVisualInfo vinfo; XMatchVisualInfo(display,DefaultScreen(display),32,TrueColor,&vinfo); XSetWindowAttributes attr; attr.colormap = XCreateColormap(display,DefaultRootWindow(display),vinfo.visual,AllocNonE); attr.border_pixel = 0; attr.BACkground_pixel = 0; Window win = XCreateWindow(display,300,200,vinfo.depth,InputOutput,CWColormap | CWBorderPixel | CWBACkPixel,&attr); XSELEcTinput(display,win,StructureNotifymask); GC gc = XCreateGC(display,0); Atom wm_delete_window = XInternAtom(display,"WM_deletE_WINDOW",0); XSetWMProtocols(display,&wm_delete_window,1); XMapWindow(display,win); int keep_running = 1; XEvent event; while (keep_running) { XNextEvent(display,&event); switch(event.typE) { case Clientmessage: if (event.xclient.message_type == XInternAtom(display,"WM_PROTOCOLS",1) && (Atom)event.xclient.data.l[0] == XInternAtom(display,1)) keep_running = 0; break; default: break; } } XDestroyWindow(display,win); XCloseDisplay(display); return 0; }
以上是大佬教程为你收集整理的c – 带有Xlib的空或透明窗口仅显示边框线全部内容,希望文章能够帮你解决c – 带有Xlib的空或透明窗口仅显示边框线所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。