1

I am working on a project and would like to create a window with a transparent background, but can't seem to find out how to do this. The call I am making is:

XWindow win = XCreateSimpleWindow(d, fl_xid(Root), winWidth, winHeight, 5, 5, 0, 0, NULL);

The 'NULL' value is not valid as it is looking for an unsigned int. Any help would greatly be appreciated!

user1646428
  • 179
  • 2
  • 12
  • Have a look at the first post in https://groups.google.com/forum/#!msg/fltkgeneral/Ga_FEutXUKk/f5y668eWu6IJ – cup Apr 18 '18 at 11:49
  • Note that Lubuntu does not use a compositor by default. Even if the X window opacity is changed, it is necessary to have a compositor, such as xcompmgr or compton, etc., running in order to achieve transparency. You typically install these to launch at startup. – DragonLord Nov 19 '20 at 15:22

1 Answers1

0

Depends on what you mean by 'transparent background'. If you want complete transparency, check out this answer.

If you want opacity and are using a compositor you should be able to do something like this:

Atom atom = XInternAtom(fl_display, "_NET_WM_WINDOW_OPACITY", False); 
uint opacity = 0x80000000; /* 0x0 .. 0xffffffff */
XChangeProperty(fl_display, fl_xid(win), atom, XA_CARDINAL, 32,
                PropModeReplace, (unsigned char*)&opacity, 1L);
FrodeTennebo
  • 531
  • 3
  • 13