[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/utils/yakuake
From:       Eike Hein <hein () kde ! org>
Date:       2009-03-18 20:17:01
Message-ID: 1237407421.206839.9595.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 941068 by hein:

Add a codepath that does translucency support without X11-specific
code on Qt 4.5+ and KDE 4.3+. The KDE version check will have to
be adjusted to the version number of a pre-release depending on
when the required changes to the Konsole codebase get into trunk,
and I still need to figure out how to eliminate a then-unneeded
target_link_libraries() from the CMakeLists.txt.


 M  +2 -0      ChangeLog  
 M  +1 -1      app/application.cpp  
 M  +1 -1      app/application.h  
 M  +3 -5      app/main.cpp  
 M  +14 -2     app/mainwindow.cpp  


--- trunk/extragear/utils/yakuake/ChangeLog #941067:941068
@@ -10,6 +10,8 @@
 * Added support for moving tabs on the tab bar by drag and drop.
 * Added the frequently-requested 'sessionIdForTerminalId(int terminalId)'
   and 'terminalIdsForSessionId(int sessionId)' D-Bus interfaces.
+* Rewrote the translucency support not to use X11-specific code on Qt 4.5
+  or higher and KDE 4.3 or higher.
 
 
 Changes in 2.9.4:
--- trunk/extragear/utils/yakuake/app/application.cpp #941067:941068
@@ -28,7 +28,7 @@
     init();
 }
 
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) && QT_VERSION < 0x040500
 Application::Application(Display* display, Qt::HANDLE visual, Qt::HANDLE colormap)
     : KUniqueApplication(display, visual, colormap)
 {
--- trunk/extragear/utils/yakuake/app/application.h #941067:941068
@@ -34,7 +34,7 @@
 
     public:
         explicit Application();
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) && QT_VERSION < 0x040500
         explicit Application(Display* display, Qt::HANDLE visual, Qt::HANDLE \
colormap);  #endif
         virtual ~Application();
--- trunk/extragear/utils/yakuake/app/main.cpp #941067:941068
@@ -28,13 +28,11 @@
 
 #include <QString>
 
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) && QT_VERSION < 0x040500
 #include <X11/Xlib.h>
 #include <X11/extensions/Xrender.h>
-#endif
 
 
-#ifdef Q_WS_X11
 void getDisplayInformation(Display*& display, Visual*& visual, Colormap& colormap);
 #endif
 
@@ -70,7 +68,7 @@
         exit(0);
     }
 
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) && QT_VERSION < 0x040500
     if (KWindowSystem::compositingActive()) 
     {
             Display* display = 0;
@@ -93,7 +91,7 @@
 }
 
 // Code from the Qt 4 graphics dojo examples at http://labs.trolltech.com
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) && QT_VERSION < 0x040500
 void getDisplayInformation(Display*& display, Visual*& visual, Colormap& colormap)
 {
     display = XOpenDisplay(0);
--- trunk/extragear/utils/yakuake/app/mainwindow.cpp #941067:941068
@@ -47,7 +47,7 @@
 #include <QtDBus/QtDBus>
 #include <QTimer>
 
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) && QT_VERSION < 0x040500
 #include <QX11Info>
 
 #include <X11/Xlib.h>
@@ -60,6 +60,10 @@
 {
     QDBusConnection::sessionBus().registerObject("/yakuake/window", this, \
QDBusConnection::ExportScriptableSlots);  
+#if QT_VERSION >= 0x040500 && KDE_IS_VERSION(4,3,0)
+    setAttribute(Qt::WA_TranslucentBackground, true);
+#endif
+
     m_skin = new Skin();
     m_menu = new KMenu(this);
     m_helpMenu = new KHelpMenu(this, KGlobal::mainComponent().aboutData());
@@ -920,7 +924,10 @@
 
 void MainWindow::updateUseTranslucency()
 {
-#ifdef Q_WS_X11
+    m_useTranslucency = true;
+    return;
+
+#if defined(Q_WS_X11) && QT_VERSION < 0x040500
     bool ARGB = false;
 
     int screen = QX11Info::appScreen();
@@ -941,6 +948,11 @@
         m_useTranslucency = KWindowSystem::compositingActive();
     }
     else
+#elif QT_VERSION >= 0x040500 && KDE_IS_VERSION(4,3,0)
+    if (Settings::translucency())
+    {
+        m_useTranslucency = KWindowSystem::compositingActive();
+    }
 #endif
     {
         m_useTranslucency = false;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic