Commit 0393469d authored by Hugo Pereira Da Costa's avatar Hugo Pereira Da Costa
Browse files

do not set transparency on windows that have _XEMBED_INFO property set.

CCBUG: 326043
parent 6fdd219c
......@@ -33,6 +33,12 @@
#include <QtGui/QDialog>
#include <QtGui/QIcon>
#ifdef Q_WS_X11
#include <QtGui/QX11Info>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#endif
namespace Oxygen
{
......@@ -43,7 +49,16 @@ namespace Oxygen
_applicationType( AppUnknown ),
_enabled( false ),
_opacity( 0xff )
{}
{
#ifdef Q_WS_X11
// create atom
_xEmbedAtom = XInternAtom( QX11Info::display(), "_XEMBED_INFO", False);
#endif
}
//______________________________________________________________
void ArgbHelper::registerApplication( QApplication* app )
......@@ -124,6 +139,7 @@ namespace Oxygen
widget->inherits( "QSplashScreen") ) break;
if( widget->windowFlags().testFlag( Qt::FramelessWindowHint ) ) break;
if( isXEmbed( widget ) ) break;
// setup transparency and return
setupTransparency( widget );
......@@ -243,4 +259,30 @@ namespace Oxygen
return;
}
//______________________________________________________________
bool ArgbHelper::isXEmbed( QWidget* widget ) const
{
#ifdef Q_WS_X11
// QTextStream( stdout ) << "ArgbHelper::isXEmbed" << endl;
Atom type = None;
int format = 0;
unsigned char *data = 0x0;
unsigned long count = 0;
unsigned long after = 0;
const int length = 32768;
// get window property
return XGetWindowProperty(
QX11Info::display(), widget->winId(), _xEmbedAtom,
0L, length, false, XA_ATOM, &type, &format, &count, &after, &data) == Success && data;
#else
return false;
#endif
}
}
......@@ -38,6 +38,10 @@
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#ifdef Q_WS_X11
#include <X11/Xdefs.h>
#endif
namespace Oxygen
{
class ArgbHelper: public QObject
......@@ -126,6 +130,9 @@ namespace Oxygen
// transparency
void setupTransparency( QWidget* );
// true if window is of type X11 embed
bool isXEmbed( QWidget* ) const;
private:
//! helper
......@@ -147,6 +154,14 @@ namespace Oxygen
typedef QSet<const QObject*> ObjectSet;
ObjectSet _transparentWidgets;
#ifdef Q_WS_X11
//! XEmbed atom
Atom _xEmbedAtom;
#endif
};
// inline functions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment