~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy

« back to all changes in this revision

Viewing changes to kcontrol/screensaver/kswidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-11 14:04:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071011140448-v0eb7lxbb24zagca
Tags: 3.94.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    : QWidget( parent, wf ), colormap( None )
13
13
{
14
14
// use visual with support for double-buffering, for opengl
15
 
// this code is (apparently) duplicated in kdebase/workspace/krunner/lock/
 
15
// this code is (partially) duplicated in kdebase/workspace/krunner/lock/
16
16
#ifdef HAVE_GLXCHOOSEVISUAL
17
17
    Visual* visual = CopyFromParent;
 
18
    int depth = CopyFromParent;
18
19
    XSetWindowAttributes attrs;
19
20
    int flags = 0;
20
21
    if( true /*mOpenGLVisual*/ )
47
48
            if( XVisualInfo* info = glXChooseVisual( x11Info().display(), x11Info().screen(), attribs[ i ] ))
48
49
            {
49
50
                visual = info->visual;
 
51
                depth = info->depth;
50
52
                colormap = XCreateColormap( x11Info().display(), RootWindow( x11Info().display(), x11Info().screen()), visual, AllocNone );
51
53
                attrs.colormap = colormap;
52
54
                flags |= CWColormap;
55
57
            }
56
58
        }
57
59
    }
58
 
    Window w = XCreateWindow( x11Info().display(), parentWidget() ? parentWidget()->winId() : RootWindow( x11Info().display(), x11Info().screen()),
59
 
        x(), y(), width(), height(), 0, x11Info().depth(), InputOutput, visual, flags, &attrs );
 
60
    Window w = XCreateWindow( x11Info().display(), RootWindow( x11Info().display(), x11Info().screen()),
 
61
        x(), y(), width(), height(), 0, depth, InputOutput, visual, flags, &attrs );
 
62
    if( parentWidget())
 
63
        XReparentWindow( x11Info().display(), w, parentWidget()->winId(), 0, 0 );
60
64
    create( w );
61
65
#endif
62
66
}