Hi,
if you want to make a ARGB window using xlib/Qt here is the code i use
/**files to include from xlib*/
#include <X11/extensions/Xrender.h>
#include <X11/Xlib.h>
/**getting display*/
Display *dpy = XOpenDisplay ( 0 ); // open default display
if ( !dpy ) {
qWarning ( "Cannot connect to the X server" );
exit ( 1 );
}
/**code for argb visual*/
bool argbVisual=false;
int screen = DefaultScreen ( dpy );
Colormap colormap = 0;
Visual *visual = 0;
int eventBase, errorBase;
if ( XRenderQueryExtension ( dpy, &eventBase, &errorBase ) ) {
qWarning ("You have ARGB support");
int nvi;
XVisualInfo templ;
templ.screen = screen;
templ.depth = 32;
templ.c_class = TrueColor;
XVisualInfo *xvi = XGetVisualInfo ( dpy, VisualScreenMask |
VisualDepthMask |
VisualClassMask, &templ, &nvi );
for ( int i = 0; i < nvi; ++i ) {
XRenderPictFormat *format = XRenderFindVisualFormat ( dpy,
xvi[i].visual );
if ( format->type == PictTypeDirect && format->direct.alphaMask ) {
visual = xvi[i].visual;
colormap = XCreateColormap ( dpy, RootWindow ( dpy, screen ),
visual, AllocNone );
argbVisual=true;
break;
}
}
}
/**end of code for argb visual*/
then QApplication app (dpy, argc, argv,Qt::HANDLE ( visual ), Qt::HANDLE ( colormap ) );
Am Thursday 14 May 2009 schrieb Harald Hvaal:if you want an effect on desktops/windows (like the cube switch etc.) that's likely the best location
> Do I need to write graphics routines through kwin plugin framework? Is
Qt 4.5 (only on window type widgets QWidget::isWindow())
> there a flag in Qt that I can use to get an alpha blended backgroudn for a
> qmainwindow?
QWidget::setAttribute(Qt::WA_TranslucentBackground)
this will however (obviously) only work on composited desktopsif you want whatever you want on the desktop layer (i.e. below all normal windows), you can make a plasmoid (QGraphicsViewItem) and just use alpha blending
> Maybe plasma has something for this? Is it even possible?
Thomas
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<