summaryrefslogtreecommitdiffstats
path: root/twin
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2014-03-31 23:10:03 -0500
committerTimothy Pearson <[email protected]>2014-03-31 23:10:03 -0500
commit24e34ad9892c4c5bf774bd0c32e369be52954936 (patch)
tree03819b1b63f5b60797d8072e1bda8a35fcefaf52 /twin
parent39cbbdb1607e656aac07834d77573b204a717540 (diff)
downloadtdebase-24e34ad9892c4c5bf774bd0c32e369be52954936.tar.gz
tdebase-24e34ad9892c4c5bf774bd0c32e369be52954936.zip
Add basic support for a modified compton compositor instead of the old buggy kompmgr
Update additional Xorg atom names
Diffstat (limited to 'twin')
-rw-r--r--twin/CMakeLists.txt1
-rw-r--r--twin/COMPLIANCE6
-rw-r--r--twin/activation.cpp2
-rw-r--r--twin/atoms.cpp14
-rw-r--r--twin/clients/b2/b2client.cpp2
-rw-r--r--twin/clients/keramik/keramik.cpp2
-rw-r--r--twin/kcmtwin/twinoptions/windows.cpp72
-rw-r--r--twin/kcmtwin/twinoptions/windows.h1
-rw-r--r--twin/lib/kcommondecoration.cpp2
-rw-r--r--twin/workspace.cpp18
10 files changed, 94 insertions, 26 deletions
diff --git a/twin/CMakeLists.txt b/twin/CMakeLists.txt
index aa9f41057..32d497513 100644
--- a/twin/CMakeLists.txt
+++ b/twin/CMakeLists.txt
@@ -23,6 +23,7 @@ tde_conditional_add_subdirectory( WITH_XCOMPOSITE kompmgr )
include_directories(
+ ${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/lib
${TDE_INCLUDE_DIR}
diff --git a/twin/COMPLIANCE b/twin/COMPLIANCE
index 7ae943630..c51bfae3a 100644
--- a/twin/COMPLIANCE
+++ b/twin/COMPLIANCE
@@ -156,7 +156,7 @@ version 2.0
======================
/ 1.2.3.
- KWin uses KWIN_RUNNING atom that's missing the leading underscore.
+ KWin uses TWIN_RUNNING atom that's missing the leading underscore.
Some parts of KDE perhaps may be missing the leading underscore.
/ 1.2.6.
Should be checked.
@@ -228,10 +228,10 @@ KDE-specific extensions (for completeness):
Property Name Type
==========================================================================
-_KDE_WM_CHANGE_STATE root window message
+_TDE_WM_CHANGE_STATE root window message
_KDE_NET_SYSTEM_TRAY_WINDOWS root window property
_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR window property
-_KDE_NET_WM_FRAME_STRUT window property
+_TDE_NET_WM_FRAME_STRUT window property
_NET_WM_CONTEXT_HELP
- Qt extension
- has no vendor prefix even though it's not part of the spec
diff --git a/twin/activation.cpp b/twin/activation.cpp
index 36b9e88f1..6f79c47cc 100644
--- a/twin/activation.cpp
+++ b/twin/activation.cpp
@@ -774,7 +774,7 @@ Time Client::readUserTimeMapTimestamp( const TDEStartupInfoId* asn_id, const TDE
{ // The window doesn't have any timestamp.
// If it's the first window for its application
// (i.e. there's no other window from the same app),
- // use the _KDE_NET_WM_USER_CREATION_TIME trick.
+ // use the _TDE_NET_WM_USER_CREATION_TIME trick.
// Otherwise, refuse activation of a window
// from already running application if this application
// is not the active one (unless focus stealing prevention is turned off).
diff --git a/twin/atoms.cpp b/twin/atoms.cpp
index de2dfff9f..840f1be44 100644
--- a/twin/atoms.cpp
+++ b/twin/atoms.cpp
@@ -27,7 +27,7 @@ Atoms::Atoms()
int n = 0;
atoms[n] = &twin_running;
- names[n++] = (char *) "KWIN_RUNNING";
+ names[n++] = (char *) "TWIN_RUNNING";
atoms[n] = &wm_protocols;
names[n++] = (char *) "WM_PROTOCOLS";
@@ -54,21 +54,21 @@ Atoms::Atoms()
names[n++] = (char *) "_NET_WM_PING";
atoms[n] = &kde_wm_change_state;
- names[n++] = (char *) "_KDE_WM_CHANGE_STATE";
+ names[n++] = (char *) "_TDE_WM_CHANGE_STATE";
atoms[n] = &net_wm_user_time;
names[n++] = (char *) "_NET_WM_USER_TIME";
atoms[n] = &kde_net_wm_user_creation_time;
- names[n++] = (char *) "_KDE_NET_WM_USER_CREATION_TIME";
+ names[n++] = (char *) "_TDE_NET_WM_USER_CREATION_TIME";
atoms[n] = &kde_system_tray_embedding;
- names[n++] = (char*) "_KDE_SYSTEM_TRAY_EMBEDDING";
+ names[n++] = (char*) "_TDE_SYSTEM_TRAY_EMBEDDING";
atoms[n] = &net_wm_take_activity;
names[n++] = (char*) "_NET_WM_TAKE_ACTIVITY";
atoms[n] = &net_wm_window_opacity;
- names[n++] = (char*) "_TDE_WM_WINDOW_OPACITY";
+ names[n++] = (char*) "_NET_WM_WINDOW_OPACITY";
atoms[n] = &net_wm_window_shadow;
names[n++] = (char*) "_TDE_WM_WINDOW_SHADOW";
@@ -83,7 +83,7 @@ Atoms::Atoms()
names[n++] = (char*) "_TDE_WM_WINDOW_DECOHASH";
atoms[n] = &net_wm_system_modal_notification;
- names[n++] = (char*) "_KDE_WM_MODAL_SYS_NOTIFICATION";
+ names[n++] = (char*) "_TDE_WM_MODAL_SYS_NOTIFICATION";
Atom fake;
atoms[n] = &fake;
@@ -99,7 +99,7 @@ Atoms::Atoms()
atoms[n] = &net_frame_extents;
names[n++] = (char*) "_NET_FRAME_EXTENTS";
atoms[n] = &kde_net_wm_frame_strut;
- names[n++] = (char*) "_KDE_NET_WM_FRAME_STRUT";
+ names[n++] = (char*) "_TDE_NET_WM_FRAME_STRUT";
assert( n <= max );
diff --git a/twin/clients/b2/b2client.cpp b/twin/clients/b2/b2client.cpp
index d63d6c093..6a7a8296e 100644
--- a/twin/clients/b2/b2client.cpp
+++ b/twin/clients/b2/b2client.cpp
@@ -440,7 +440,7 @@ bool B2Client::isModalSystemNotification()
int format, result;
unsigned long n, left;
Atom kde_wm_system_modal_notification;
- kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
+ kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
result = XGetWindowProperty(tqt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 )
{
diff --git a/twin/clients/keramik/keramik.cpp b/twin/clients/keramik/keramik.cpp
index cdfd822c4..55eb5787d 100644
--- a/twin/clients/keramik/keramik.cpp
+++ b/twin/clients/keramik/keramik.cpp
@@ -1031,7 +1031,7 @@ bool KeramikClient::isModalSystemNotification()
int format, result;
unsigned long n, left;
Atom kde_wm_system_modal_notification;
- kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
+ kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
result = XGetWindowProperty(tqt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 )
{
diff --git a/twin/kcmtwin/twinoptions/windows.cpp b/twin/kcmtwin/twinoptions/windows.cpp
index dbaee8b0b..ad207014f 100644
--- a/twin/kcmtwin/twinoptions/windows.cpp
+++ b/twin/kcmtwin/twinoptions/windows.cpp
@@ -93,6 +93,7 @@
#define MAX_WNDW_SNAP 100
#define MAX_EDGE_RES 1000
+TQString TDECompositor = TDE_COMPOSITOR_BINARY;
KFocusConfig::~KFocusConfig ()
{
@@ -1279,7 +1280,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
KActiveLabel *label = new KActiveLabel(i18n("<qt><b>It seems that alpha channel support is not available.</b><br><br>"
"Please make sure you have "
"<a href=\"http://www.freedesktop.org/\">Xorg &ge; 6.8</a>,"
- " and installed the kompmgr that came with twin.<br>"
+ " and installed the composition manager that came with twin.<br>"
"Also, make sure you have the following entries in your XConfig (e.g. /etc/X11/xorg.conf):<br><br>"
"<i>Section \"Extensions\"<br>"
"Option \"Composite\" \"Enable\"<br>"
@@ -1339,6 +1340,15 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
disableARGB = new TQCheckBox(i18n("Disable ARGB windows (ignores window alpha maps, fixes gtk1 apps)"),tGroup);
vLay->addWidget(disableARGB);
+ if (TDECompositor == "compton-tde") {
+ disableARGB->hide();
+ }
+
+ useOpenGL = new TQCheckBox(i18n("Use OpenGL compositor (best performance)"),tGroup);
+ vLay->addWidget(useOpenGL);
+ if (TDECompositor != "compton-tde") {
+ useOpenGL->hide();
+ }
vLay->addStretch();
tabW->addTab(tGroup, i18n("Opacity"));
@@ -1463,6 +1473,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
connect(dockWindowTransparency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
connect(keepAboveAsActive, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
+ connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
connect(removeShadowsOnResize, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
connect(removeShadowsOnMove, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
@@ -1503,6 +1514,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
// handle kompmgr restarts if necessary
connect(useTranslucency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr()));
connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr()));
+ connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr()));
connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr()));
connect(inactiveWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr()));
connect(baseShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr()));
@@ -1560,6 +1572,7 @@ void KTranslucencyConfig::load( void )
conf_.setGroup("xcompmgr");
disableARGB->setChecked(conf_.readBoolEntry("DisableARGB",FALSE));
+ useOpenGL->setChecked(conf_.readBoolEntry("useOpenGL",FALSE));
useShadows->setChecked(conf_.readEntry("Compmode","").compare("CompClientShadows") == 0);
shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",-200)));
@@ -1592,8 +1605,9 @@ void KTranslucencyConfig::load( void )
void KTranslucencyConfig::save( void )
{
- if (!kompmgrAvailable_)
- return;
+ if (!kompmgrAvailable_)
+ return;
+
config->setGroup( "Notification Messages" );
config->writeEntry("UseTranslucency",useTranslucency->isChecked());
@@ -1628,6 +1642,7 @@ void KTranslucencyConfig::save( void )
conf_->writeEntry("Compmode",useShadows->isChecked()?"CompClientShadows":"");
conf_->writeEntry("DisableARGB",disableARGB->isChecked());
+ conf_->writeEntry("useOpenGL",useOpenGL->isChecked());
conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value());
conf_->writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value());
@@ -1646,6 +1661,55 @@ void KTranslucencyConfig::save( void )
delete conf_;
+ // Now write out compton settings
+ TQFile* compton_conf_file_ = new TQFile(TQDir::homeDirPath() + "/.compton-tde.conf");
+ if ( compton_conf_file_->open( IO_WriteOnly ) ) {
+ TQTextStream stream(compton_conf_file_);
+
+ stream << "shadow = " << (useShadows->isChecked()?"true":"false") << ";\n";
+ stream << "shadow-offset-y = " << (-1*shadowTopOffset->value()) << ";\n";
+ stream << "shadow-offset-x = " << (-1*shadowLeftOffset->value()) << ";\n";
+
+ int r, g, b;
+ shadowColor->color().rgb( &r, &g, &b );
+ stream << "shadow-red = " << (r/255.0) << ";\n";
+ stream << "shadow-green = " << (g/255.0) << ";\n";
+ stream << "shadow-blue = " << (b/255.0) << ";\n";
+
+ stream << "shadow-radius = " << baseShadowSize->value() << ";\n";
+
+ bool fadeOpacity = fadeOnOpacityChange->isChecked();
+ bool fadeWindows = fadeInWindows->isChecked();
+ bool fadeMenuWindows = fadeInMenuWindows->isChecked();
+ stream << "fading = " << ((fadeWindows || fadeMenuWindows || fadeOpacity)?"true":"false") << ";\n";
+ stream << "no-fading-opacitychange = " << (fadeOpacity?"false":"true") << ";\n";
+ stream << "no-fading-openclose = " << (fadeWindows?"false":"true") << ";\n";
+ stream << "wintypes:" << "\n";
+ stream << "{" << "\n";
+ stream << " menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
+ stream << " dropdown_menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
+ stream << " popup_menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
+ stream << "}" << "\n";
+
+ stream << "fade-in-step = " << (fadeInSpeed->value()/1000.0) << ";\n";
+ stream << "fade-out-step = " << (fadeOutSpeed->value()/1000.0) << ";\n";
+
+ stream << "backend = \"" << (useOpenGL->isChecked()?"glx":"xrender") << "\";\n";
+ stream << "vsync = \"" << (useOpenGL->isChecked()?"opengl":"none") << "\";\n";
+
+ // Global settings
+ stream << "no-dock-shadow = true;\n";
+ stream << "no-dnd-shadow = true;\n";
+ stream << "clear-shadow = true;\n";
+ stream << "shadow-ignore-shaped = true;\n";
+
+ // Features not currently supported by compton
+// stream << "DisableARGB = " << (disableARGB->isChecked()?"true":"false") << ";\n";
+
+ compton_conf_file_->close();
+ }
+ delete compton_conf_file_;
+
if (standAlone)
{
config->sync();
@@ -1707,7 +1771,7 @@ bool KTranslucencyConfig::kompmgrAvailable()
{
bool ret;
TDEProcess proc;
- proc << "kompmgr" << "-v";
+ proc << TDECompositor << "-v";
ret = proc.start(TDEProcess::DontCare, TDEProcess::AllOutput);
proc.detach();
return ret;
diff --git a/twin/kcmtwin/twinoptions/windows.h b/twin/kcmtwin/twinoptions/windows.h
index 10424207d..27ea02a8d 100644
--- a/twin/kcmtwin/twinoptions/windows.h
+++ b/twin/kcmtwin/twinoptions/windows.h
@@ -258,6 +258,7 @@ private:
TQCheckBox *dockWindowTransparency;
TQCheckBox *keepAboveAsActive;
TQCheckBox *disableARGB;
+ TQCheckBox *useOpenGL;
TQCheckBox *fadeInWindows;
TQCheckBox *fadeInMenuWindows;
TQCheckBox *fadeOnOpacityChange;
diff --git a/twin/lib/kcommondecoration.cpp b/twin/lib/kcommondecoration.cpp
index 48db91040..54ee415e2 100644
--- a/twin/lib/kcommondecoration.cpp
+++ b/twin/lib/kcommondecoration.cpp
@@ -328,7 +328,7 @@ bool KCommonDecoration::isModalSystemNotification()
int format, result;
unsigned long n, left;
Atom kde_wm_system_modal_notification;
- kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
+ kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
result = XGetWindowProperty(tqt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
if (result == Success && data != None && format == 32 )
{
diff --git a/twin/workspace.cpp b/twin/workspace.cpp
index 4dd5113ed..210ab7754 100644
--- a/twin/workspace.cpp
+++ b/twin/workspace.cpp
@@ -48,6 +48,8 @@ License. See the file "COPYING" for the exact licensing terms.
#include <pwd.h>
+#include "config.h"
+
namespace KWinInternal
{
@@ -227,7 +229,7 @@ Workspace::Workspace( bool restore )
{
kompmgr = new TDEProcess;
connect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int)));
- *kompmgr << "kompmgr";
+ *kompmgr << TDE_COMPOSITOR_BINARY;
startKompmgr();
}
else if (!disable_twin_composition_manager)
@@ -1135,7 +1137,7 @@ void Workspace::slotReconfigure()
{
kompmgr = new TDEProcess;
connect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int)));
- *kompmgr << "kompmgr";
+ *kompmgr << TDE_COMPOSITOR_BINARY;
}
TQTimer::singleShot( 200, this, TQT_SLOT(startKompmgr()) ); // wait some time to ensure system's ready for restart
}
@@ -1850,7 +1852,7 @@ bool Workspace::removeSystemTrayWin( WId w, bool check )
// reparenting the window into itself, or if it's the window
// going away. This is obviously a flaw in the design, and we were
// just lucky it worked for so long. Kicker's systray temporarily
- // sets _KDE_SYSTEM_TRAY_EMBEDDING property on the window while
+ // sets _TDE_SYSTEM_TRAY_EMBEDDING property on the window while
// embedding it, allowing KWin to figure out. Kicker just mustn't
// crash before removing it again ... *shrug* .
int num_props;
@@ -2815,7 +2817,7 @@ void Workspace::startKompmgr()
options->useTranslucency = FALSE;
TDEProcess proc;
proc << "kdialog" << "--error"
- << i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.")
+ << i18n("The Composite Manager could not be started.\\nMake sure you have \"" TDE_COMPOSITOR_BINARY "\" in a $PATH directory.")
<< "--title" << "Composite Manager Failure";
proc.start(TDEProcess::DontCare);
}
@@ -2907,7 +2909,7 @@ void Workspace::restartKompmgr( TDEProcess *proc )
// {
// kompmgr = new TDEProcess;
// kompmgr->clearArguments();
-// *kompmgr << "kompmgr";
+// *kompmgr << TDE_COMPOSITOR_BINARY;
// }
// -------------------
if (!kompmgr->start(TDEProcess::NotifyOnExit, TDEProcess::Stderr))
@@ -2917,7 +2919,7 @@ void Workspace::restartKompmgr( TDEProcess *proc )
options->useTranslucency = FALSE;
TDEProcess proc;
proc << "kdialog" << "--error"
- << i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.")
+ << i18n("The Composite Manager could not be started.\\nMake sure you have \"" TDE_COMPOSITOR_BINARY "\" in a $PATH directory.")
<< "--title" << i18n("Composite Manager Failure");
proc.start(TDEProcess::DontCare);
}
@@ -2936,9 +2938,9 @@ void Workspace::handleKompmgrOutput( TDEProcess* , char *buffer, int buflen)
if (output.contains("Started",false))
; // don't do anything, just pass to the connection release
else if (output.contains("Can't open display",false))
- message = i18n("<qt><b>kompmgr failed to open the display</b><br>There is probably an invalid display entry in your ~/.xcompmgrrc.</qt>");
+ message = i18n("<qt><b>The TDE composition manager failed to open the display</b><br>There is probably an invalid display entry in your ~/.compton-tde.conf file.</qt>");
else if (output.contains("No render extension",false))
- message = i18n("<qt><b>kompmgr cannot find the Xrender extension</b><br>You are using either an outdated or a crippled version of XOrg.<br>Get XOrg &ge; 6.8 from www.freedesktop.org.<br></qt>");
+ message = i18n("<qt><b>The TDE composition manager cannot find the Xrender extension</b><br>You are using either an outdated or a crippled version of XOrg.<br>Get XOrg &ge; 6.8 from www.freedesktop.org.<br></qt>");
else if (output.contains("No composite extension",false))
message = i18n("<qt><b>Composite extension not found</b><br>You <i>must</i> use XOrg &ge; 6.8 for translucency and shadows to work.<br>Additionally, you need to add a new section to your X config file:<br>"
"<i>Section \"Extensions\"<br>"