2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#include "kwinglobals.h"
|
|
|
|
|
2011-06-11 12:48:16 +00:00
|
|
|
#include <QPainter>
|
|
|
|
#include <QPaintEngine>
|
|
|
|
#include <QPixmap>
|
|
|
|
|
2007-09-26 16:31:06 +00:00
|
|
|
#include <config-X11.h>
|
|
|
|
|
2008-02-24 11:41:55 +00:00
|
|
|
#include <assert.h>
|
|
|
|
|
2007-09-26 16:31:06 +00:00
|
|
|
#include <kdebug.h>
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/extensions/shape.h>
|
|
|
|
|
|
|
|
#include <X11/extensions/Xdamage.h>
|
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
#include <X11/extensions/sync.h>
|
|
|
|
#endif
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2011-06-11 12:48:16 +00:00
|
|
|
bool Extensions::non_native_pixmaps = false;
|
2007-09-26 16:31:06 +00:00
|
|
|
|
|
|
|
void Extensions::init()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2012-04-13 06:39:04 +00:00
|
|
|
static bool initPerformed = false;
|
|
|
|
if (initPerformed) {
|
|
|
|
return;
|
|
|
|
}
|
2012-12-21 14:11:31 +00:00
|
|
|
// it seems like no events are delivered to XLib when the extension is not queried
|
2008-02-24 11:41:55 +00:00
|
|
|
int event_base, error_base;
|
2012-12-21 14:11:31 +00:00
|
|
|
XShapeQueryExtension(display(), &event_base, &error_base);
|
|
|
|
XRRQueryExtension(display(), &event_base, &error_base);
|
|
|
|
XDamageQueryExtension(display(), &event_base, &error_base);
|
2007-09-26 16:31:06 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
2012-12-21 14:11:31 +00:00
|
|
|
XSyncQueryExtension(display(), &event_base, &error_base);
|
2011-01-30 14:34:42 +00:00
|
|
|
#endif
|
2012-12-21 14:11:31 +00:00
|
|
|
|
2011-06-11 12:48:16 +00:00
|
|
|
QPixmap pix(1,1);
|
|
|
|
QPainter p(&pix);
|
|
|
|
non_native_pixmaps = p.paintEngine()->type() != QPaintEngine::X11;
|
|
|
|
p.end();
|
2012-12-21 14:11:31 +00:00
|
|
|
kDebug(1212) << " non_native_pixmaps: " << non_native_pixmaps << endl;
|
2012-04-13 06:39:04 +00:00
|
|
|
initPerformed = true;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-09-26 16:31:06 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
} // namespace
|
|
|
|
|