Do not use saveunder in opaque modes as it slows down

moving/resizing significantly.
(kwin_iii port later)

svn path=/trunk/kdebase/kwin/; revision=231502
This commit is contained in:
Karol Szwed 2003-06-15 07:19:05 +00:00
parent 79a98219bb
commit cf8e983d87
3 changed files with 16 additions and 7 deletions

View file

@ -1851,7 +1851,7 @@ void Client::mouseMoveEvent( QMouseEvent * e)
if (options->showGeometryTip())
{
if (!geometryTip)
geometryTip = new GeometryTip( this, &xSizeHint );
geometryTip = new GeometryTip( this, &xSizeHint, isResize() );
geometryTip->setGeometry( geom );
if (!geometryTip->isVisible()) {
@ -1884,7 +1884,7 @@ void Client::mouseMoveEvent( QMouseEvent * e)
{
// Position and Size display
if (!geometryTip)
geometryTip = new GeometryTip( this, &xSizeHint );
geometryTip = new GeometryTip( this, &xSizeHint, isResize() );
geometryTip->setGeometry( geom );
if (!geometryTip->isVisible()) {

View file

@ -5,12 +5,15 @@
*/
#include "geometrytip.h"
#include "options.h"
#include <X11/Xlib.h>
using namespace KWinInternal;
extern Options* options;
GeometryTip::GeometryTip( const Client* client, const XSizeHints* xSizeHints ):
GeometryTip::GeometryTip( const Client* client, const XSizeHints* xSizeHints, bool resizing ):
QLabel(NULL, "kwingeometry", WStyle_Customize | WStyle_StaysOnTop |
WStyle_NoBorder | WX11BypassWM )
{
@ -19,9 +22,15 @@ GeometryTip::GeometryTip( const Client* client, const XSizeHints* xSizeHints ):
// For this to work properly have 'Option "backingstore"' set in the Screen
// section of your XF86Config. (some drivers may not support saveunder,
// oh well, we tried.)
XSetWindowAttributes wsa;
wsa.save_under = True;
XChangeWindowAttributes( qt_xdisplay(), winId(), CWSaveUnder, &wsa );
// Only do this in transparent mode, as it slows down opaque mode...
if ( (resizing && options->resizeMode == Options::Transparent) ||
(!resizing && options->moveMode == Options::Transparent) )
{
XSetWindowAttributes wsa;
wsa.save_under = True;
XChangeWindowAttributes( qt_xdisplay(), winId(), CWSaveUnder, &wsa );
}
c = client;
setMargin(1);

View file

@ -16,7 +16,7 @@ class GeometryTip: public QLabel
{
Q_OBJECT
public:
GeometryTip( const Client* client, const XSizeHints* xSizeHints );
GeometryTip( const Client* client, const XSizeHints* xSizeHints, bool resizing );
~GeometryTip();
void setGeometry( const QRect& geom );