Make sure that the right visual is used for the frame when embedding
an ARGB window. Reviewed by Seli and Keith Packard. svn path=/trunk/kdebase/kwin/; revision=272507
This commit is contained in:
parent
ab07ba1c70
commit
0f1aecf06b
2 changed files with 16 additions and 7 deletions
2
client.h
2
client.h
|
@ -357,7 +357,7 @@ class Client : public QObject, public KDecorationDefines
|
|||
void killProcess( bool ask, Time timestamp = CurrentTime );
|
||||
void updateUrgency();
|
||||
|
||||
void embedClient( Window w );
|
||||
void embedClient( Window w, const XWindowAttributes &attr );
|
||||
void detectNoBorder();
|
||||
void destroyDecoration();
|
||||
void updateFrameStrut();
|
||||
|
|
21
manage.cpp
21
manage.cpp
|
@ -44,7 +44,7 @@ bool Client::manage( Window w, bool isMapped )
|
|||
// from this place on, manage() mustn't return false
|
||||
block_geometry = 1;
|
||||
|
||||
embedClient( w );
|
||||
embedClient( w, attr );
|
||||
|
||||
// SELI order all these things in some sane manner
|
||||
|
||||
|
@ -494,7 +494,7 @@ bool Client::manage( Window w, bool isMapped )
|
|||
}
|
||||
|
||||
// called only from manage()
|
||||
void Client::embedClient( Window w )
|
||||
void Client::embedClient( Window w, const XWindowAttributes &attr )
|
||||
{
|
||||
assert( client == None );
|
||||
assert( frame == None );
|
||||
|
@ -507,8 +507,19 @@ void Client::embedClient( Window w )
|
|||
XWindowChanges wc; // set the border width to 0
|
||||
wc.border_width = 0; // TODO possibly save this, and also use it for initial configuring of the window
|
||||
XConfigureWindow( qt_xdisplay(), client, CWBorderWidth, &wc );
|
||||
frame = XCreateSimpleWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0, 0, 0 );
|
||||
wrapper = XCreateSimpleWindow( qt_xdisplay(), frame, 0, 0, 1, 1, 0, 0, 0 );
|
||||
|
||||
XSetWindowAttributes swa;
|
||||
swa.colormap = attr.colormap;
|
||||
swa.background_pixmap = None;
|
||||
swa.border_pixel = 0;
|
||||
|
||||
frame = XCreateWindow( qt_xdisplay(), qt_xrootwin(), 0, 0, 1, 1, 0,
|
||||
attr.depth, InputOutput, attr.visual,
|
||||
CWColormap | CWBackPixmap | CWBorderPixel, &swa );
|
||||
wrapper = XCreateWindow( qt_xdisplay(), frame, 0, 0, 1, 1, 0,
|
||||
attr.depth, InputOutput, attr.visual,
|
||||
CWColormap | CWBackPixmap | CWBorderPixel, &swa );
|
||||
|
||||
XDefineCursor( qt_xdisplay(), frame, arrowCursor.handle());
|
||||
// some apps are stupid and don't define their own cursor - set the arrow one for them
|
||||
XDefineCursor( qt_xdisplay(), wrapper, arrowCursor.handle());
|
||||
|
@ -533,8 +544,6 @@ void Client::embedClient( Window w )
|
|||
EnterWindowMask | LeaveWindowMask |
|
||||
KeyPressMask | KeyReleaseMask
|
||||
);
|
||||
XSetWindowBackgroundPixmap( qt_xdisplay(), frameId(), None );
|
||||
XSetWindowBackgroundPixmap( qt_xdisplay(), wrapperId(), None );
|
||||
updateMouseGrab();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue