summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-25 18:37:54 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-25 18:37:54 +0000
commitd6bcc187d2f408e3e27598dd7f03821647e51c2e (patch)
tree7e5039a28026c3b682c21ff697cc18ec8c960639
parent648e1d840818ee963970f6d69e6aa59fc2651d1f (diff)
downloadtdebase-d6bcc187d2f408e3e27598dd7f03821647e51c2e.tar.gz
tdebase-d6bcc187d2f408e3e27598dd7f03821647e51c2e.zip
Fix taskbar when parent application is using ARGB windows
Fix composition configuration default settings Add logout notice to give the user feedback that yes, the logout command actually WAS accepted git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1249522 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--kicker/taskbar/taskcontainer.cpp26
-rw-r--r--ksmserver/shutdown.cpp8
-rw-r--r--ksmserver/shutdowndlg.cpp153
-rw-r--r--ksmserver/shutdowndlg.h44
-rw-r--r--kwin/kcmkwin/kwinoptions/windows.cpp6
5 files changed, 221 insertions, 16 deletions
diff --git a/kicker/taskbar/taskcontainer.cpp b/kicker/taskbar/taskcontainer.cpp
index 5b084a962..dee5c12e5 100644
--- a/kicker/taskbar/taskcontainer.cpp
+++ b/kicker/taskbar/taskcontainer.cpp
@@ -57,6 +57,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar,
TQWidget *parent, const char *name)
: TQToolButton(parent, name),
+ animationTimer(0, "TaskContainer::animationTimer"),
+ dragSwitchTimer(0, "TaskContainer::dragSwitchTimer"),
+ attentionTimer(0, "TaskContainer::attentionTimer"),
+ m_paintEventCompressionTimer(0, "TaskContainer::paintEventCompressionTimer"),
currentFrame(0),
attentionState(-1),
lastActivated(0),
@@ -66,12 +70,7 @@ TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar,
taskBar(bar),
discardNextMouseEvent(false),
aboutToActivate(false),
- m_mouseOver(false),
- animationTimer(0, "TaskContainer::animationTimer"),
- dragSwitchTimer(0, "TaskContainer::dragSwitchTimer"),
- attentionTimer(0, "TaskContainer::attentionTimer"),
- m_paintEventCompression(false),
- m_paintEventCompressionTimer(0, "TaskContainer::paintEventCompressionTimer")
+ m_paintEventCompression(false)
{
init();
setAcceptDrops(true); // Always enabled to activate task during drag&drop.
@@ -88,6 +87,10 @@ TaskContainer::TaskContainer(Task::Ptr task, TaskBar* bar,
TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames,
TaskBar* bar, TQWidget *parent, const char *name)
: TQToolButton(parent, name),
+ animationTimer(0, "TaskContainer::animationTimer"),
+ dragSwitchTimer(0, "TaskContainer::dragSwitchTimer"),
+ attentionTimer(0, "TaskContainer::attentionTimer"),
+ m_paintEventCompressionTimer(0, "TaskContainer::paintEventCompressionTimer"),
currentFrame(0),
frames(startupFrames),
attentionState(-1),
@@ -99,11 +102,7 @@ TaskContainer::TaskContainer(Startup::Ptr startup, PixmapList& startupFrames,
discardNextMouseEvent(false),
aboutToActivate(false),
m_mouseOver(false),
- animationTimer(0, "TaskContainer::animationTimer"),
- dragSwitchTimer(0, "TaskContainer::dragSwitchTimer"),
- attentionTimer(0, "TaskContainer::attentionTimer"),
- m_paintEventCompression(false),
- m_paintEventCompressionTimer(0, "TaskContainer::paintEventCompressionTimer")
+ m_paintEventCompression(false)
{
init();
setEnabled(false);
@@ -481,7 +480,10 @@ void TaskContainer::paintEvent( TQPaintEvent* )
drawButton(&p);
p.end();
- bitBlt(this, 0, 0, pm);
+ TQPixmap iconPixmapToSet = *pm;
+ if (TQPaintDevice::x11AppDepth() == 32) iconPixmapToSet.convertFromImage(KImageEffect::convertToPremultipliedAlpha( iconPixmapToSet.convertToImage() ));
+
+ bitBlt(this, 0, 0, &iconPixmapToSet);
delete pm;
}
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index c97b05ffb..d298b2cf3 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -179,6 +179,14 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
// shall we save the session on logout?
saveSession = ( config->readEntry( "loginMode", "restorePreviousLogout" ) == "restorePreviousLogout" );
+ // shall we show a nice fancy logout screen?
+ bool showFancyLogout = KConfigGroup(KGlobal::config(), "Logout").readBoolEntry("showFancyLogout", true);
+
+ if (showFancyLogout) {
+// KSMShutdownIPFeedback::start(); // hide the UGLY logout process from the user
+ KSMShutdownIPDlg::showShutdownIP();
+ }
+
if ( saveSession )
sessionGroup = TQString("Session: ") + SESSION_PREVIOUS_LOGOUT;
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index a75eef343..52960ad6d 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -57,7 +57,7 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
#include <math.h>
#include <dmctl.h>
#include <kaction.h>
-
+#include <netwm.h>
#include <X11/Xlib.h>
@@ -494,6 +494,94 @@ void KSMShutdownFeedback::slotPaintEffect()
//////
+KSMShutdownIPFeedback * KSMShutdownIPFeedback::s_pSelf = 0L;
+
+KSMShutdownIPFeedback::KSMShutdownIPFeedback()
+ : TQWidget( 0L, "feedbackipwidget", Qt::WType_Popup | Qt::WStyle_StaysOnTop | Qt::WX11BypassWM ), m_sharedpixmap(0), m_timeout(0)
+
+{
+ m_sharedpixmap = new KSharedPixmap();
+ resize(0, 0);
+ setShown(true);
+
+ // At least show SOMETHING while waiting for the root pixmap...
+ TQPixmap drawable = TQPixmap(TQPixmap::grabWindow(qt_xrootwin(), 0, 0, TQApplication::desktop()->width(), TQApplication::desktop()->height())).convertToImage();
+ bitBlt( this, 0, 0, &drawable );
+
+ // Try to get and show the root pixmap
+ enableExports();
+ TQTimer::singleShot( 100, this, SLOT(slotPaintEffect()) );
+}
+
+KSMShutdownIPFeedback::~KSMShutdownIPFeedback()
+{
+ if (m_sharedpixmap)
+ delete m_sharedpixmap;
+}
+
+void KSMShutdownIPFeedback::fadeBack( void )
+{
+
+}
+
+TQString KSMShutdownIPFeedback::pixmapName(int desk) {
+ TQString pattern = TQString("DESKTOP%1");
+ int screen_number = DefaultScreen(qt_xdisplay());
+ if (screen_number) {
+ pattern = TQString("SCREEN%1-DESKTOP").arg(screen_number) + "%1";
+ }
+ return pattern.arg( desk );
+}
+
+void KSMShutdownIPFeedback::slotPaintEffect()
+{
+ NETRootInfo rinfo( qt_xdisplay(), NET::CurrentDesktop );
+ rinfo.activate();
+ int current_desktop = rinfo.currentDesktop();
+
+ m_sharedpixmap->loadFromShared(pixmapName(current_desktop), TQRect(0, 0, width(), height()));
+}
+
+void KSMShutdownIPFeedback::slotDone(bool success)
+{
+ if (!success)
+ {
+ kdWarning(270) << k_lineinfo << "loading of desktop background failed.\n";
+ if (m_timeout < 50) {
+ TQTimer::singleShot( 100, this, SLOT(slotPaintEffect()) );
+ m_timeout++;
+ return;
+ }
+ }
+
+ TQImage image = m_sharedpixmap->convertToImage();
+ TQPixmap drawable;
+ drawable.convertFromImage( image );
+ bitBlt( this, 0, 0, &drawable );
+}
+
+void KSMShutdownIPFeedback::enableExports()
+{
+#ifdef Q_WS_X11
+ kdDebug(270) << k_lineinfo << "activating background exports.\n";
+ DCOPClient *client = kapp->dcopClient();
+ if (!client->isAttached())
+ client->attach();
+ TQByteArray data;
+ TQDataStream args( data, IO_WriteOnly );
+ args << 1;
+
+ TQCString appname( "kdesktop" );
+ int screen_number = DefaultScreen(qt_xdisplay());
+ if ( screen_number )
+ appname.sprintf("kdesktop-screen-%d", screen_number );
+
+ client->send( appname, "KBackgroundIface", "setExport(int)", data );
+#endif
+}
+
+//////
+
KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
bool maysd, KApplication::ShutdownType sdtype )
: TQDialog( parent, 0, TRUE, (WFlags)WType_Popup ), targets(0)
@@ -963,6 +1051,69 @@ bool KSMShutdownDlg::confirmShutdown( bool maysd, KApplication::ShutdownType& sd
return result;
}
+void KSMShutdownIPDlg::showShutdownIP()
+{
+ kapp->enableStyles();
+ KSMShutdownIPDlg* l = new KSMShutdownIPDlg( 0 );
+
+ // Show dialog (will save the background in showEvent)
+ TQSize sh = l->tqsizeHint();
+ TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos());
+
+ l->move(rect.x() + (rect.width() - sh.width())/2,
+ rect.y() + (rect.height() - sh.height())/2);
+
+ TQTimer *timer = new TQTimer(l);
+ connect( timer, SIGNAL(timeout()), l, SLOT(exec()) );
+ timer->start( 0, TRUE );
+
+ kapp->disableStyles();
+}
+
+KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent)
+ : TQDialog( 0, "", TRUE, Qt::WType_Popup | Qt::WDestructiveClose )
+
+{
+ TQVBoxLayout* vbox = new TQVBoxLayout( this );
+
+ TQFrame* frame = new TQFrame( this );
+ frame->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised );
+ frame->setLineWidth( tqstyle().tqpixelMetric( TQStyle::PM_DefaultFrameWidth, frame ) );
+ // we need to set the minimum size for the window
+ frame->setMinimumWidth(400);
+ vbox->addWidget( frame );
+ TQGridLayout* gbox = new TQGridLayout( frame, 1, 1, 2 * KDialog::marginHint(), 2 * KDialog::spacingHint() );
+
+ TQWidget* ticon = new TQWidget( frame );
+ KIconLoader * ldr = KGlobal::iconLoader();
+ TQPixmap trinityPixmap = ldr->loadIcon("kmenu", KIcon::Panel, KIcon::SizeLarge, KIcon::DefaultState, 0L, true);
+ ticon->setBackgroundPixmap(trinityPixmap);
+ ticon->setMinimumSize(trinityPixmap.size());
+ ticon->setMaximumSize(trinityPixmap.size());
+ ticon->resize(trinityPixmap.size());
+// gbox->addMultiCellWidget( ticon, 0, 1, 0, 0, AlignCenter );
+ gbox->addWidget( ticon, 0, 0, AlignHCenter );
+
+ TQLabel* label = new TQLabel( i18n("Trinity is saving your settings, please wait..."), frame );
+ TQFont fnt = label->font();
+ fnt.setBold( true );
+ fnt.setPointSize( fnt.pointSize() * 1 );
+ label->setFont( fnt );
+ gbox->addWidget( label, 0, 1, AlignHCenter );
+
+// label = new TQLabel( i18n("Logging off"), frame );
+// fnt = label->font();
+// fnt.setBold( true );
+// fnt.setPointSize( fnt.pointSize() * 3 / 2 );
+// label->setFont( fnt );
+// gbox->addWidget( label, 0, 1, AlignHCenter );
+}
+
+KSMShutdownIPDlg::~KSMShutdownIPDlg()
+{
+
+}
+
KSMDelayedPushButton::KSMDelayedPushButton( const KGuiItem &item,
TQWidget *parent,
const char *name)
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index e3c67eb31..5beb32ca4 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -16,6 +16,7 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
#include <tqframe.h>
#include <kguiitem.h>
#include <tqtoolbutton.h>
+#include <ksharedpixmap.h>
class TQPushButton;
class TQVButtonGroup;
@@ -73,6 +74,34 @@ private:
};
+// The (singleton) widget that shows either pretty pictures or a black screen during logout
+class KSMShutdownIPFeedback : public TQWidget
+{
+ Q_OBJECT
+
+public:
+ static void start() { s_pSelf = new KSMShutdownIPFeedback(); }
+ static void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; }
+ static KSMShutdownIPFeedback * self() { return s_pSelf; }
+
+protected:
+ ~KSMShutdownIPFeedback();
+
+private slots:
+ void slotPaintEffect();
+ void slotDone(bool success);
+
+private:
+ static KSMShutdownIPFeedback * s_pSelf;
+ KSMShutdownIPFeedback();
+ int m_currentY;
+ TQPixmap m_root;
+ void fadeBack( void );
+ TQString pixmapName(int desk);
+ KSharedPixmap* m_sharedpixmap;
+ void enableExports();
+ int m_timeout;
+};
// The confirmation dialog
class KSMShutdownDlg : public TQDialog
@@ -104,6 +133,21 @@ private:
bool m_lockOnResume;
};
+// The shutdown-in-progress dialog
+class KSMShutdownIPDlg : public TQDialog
+{
+ Q_OBJECT
+
+public:
+ static void showShutdownIP();
+
+protected:
+ ~KSMShutdownIPDlg();
+
+private:
+ KSMShutdownIPDlg( TQWidget* parent );
+};
+
class KSMDelayedPushButton : public KPushButton
{
Q_OBJECT
diff --git a/kwin/kcmkwin/kwinoptions/windows.cpp b/kwin/kcmkwin/kwinoptions/windows.cpp
index 6b3e68fc1..30d0791e8 100644
--- a/kwin/kcmkwin/kwinoptions/windows.cpp
+++ b/kwin/kcmkwin/kwinoptions/windows.cpp
@@ -1518,11 +1518,11 @@ void KTranslucencyConfig::load( void )
config->setGroup( "Translucency" );
activeWindowTransparency->setChecked(config->readBoolEntry("TranslucentActiveWindows",false));
- inactiveWindowTransparency->setChecked(config->readBoolEntry("TranslucentInactiveWindows",true));
+ inactiveWindowTransparency->setChecked(config->readBoolEntry("TranslucentInactiveWindows",false));
movingWindowTransparency->setChecked(config->readBoolEntry("TranslucentMovingWindows",false));
removeShadowsOnMove->setChecked(config->readBoolEntry("RemoveShadowsOnMove",false));
removeShadowsOnResize->setChecked(config->readBoolEntry("RemoveShadowsOnResize",false));
- dockWindowTransparency->setChecked(config->readBoolEntry("TranslucentDocks",true));
+ dockWindowTransparency->setChecked(config->readBoolEntry("TranslucentDocks",false));
keepAboveAsActive->setChecked(config->readBoolEntry("TreatKeepAboveAsActive",true));
onlyDecoTranslucent->setChecked(config->readBoolEntry("OnlyDecoTranslucent",false));
@@ -1547,7 +1547,7 @@ void KTranslucencyConfig::load( void )
disableARGB->setChecked(conf_.readBoolEntry("DisableARGB",FALSE));
- useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0);
+ useShadows->setChecked(conf_.readEntry("Compmode","").compare("CompClientShadows") == 0);
shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",-80)));
shadowLeftOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetX",0)));