summaryrefslogtreecommitdiffstats
path: root/kdm
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-15 22:17:46 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-15 22:17:46 +0000
commit34869df7a3d0fb0dbf63885fb9421df772d953ee (patch)
treed140d73a32a8e348ff81b6bcc47a326fcf6f073c /kdm
parentd4fbbf542788f9028d8cb20f49ea703feb657d96 (diff)
downloadtdebase-34869df7a3d0fb0dbf63885fb9421df772d953ee.tar.gz
tdebase-34869df7a3d0fb0dbf63885fb9421df772d953ee.zip
Allow kdm to preload kwin
This provides a smoother and more unified logon experience git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253865 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdm')
-rw-r--r--kdm/config.def10
-rw-r--r--kdm/kfrontend/kfdialog.cpp35
-rw-r--r--kdm/kfrontend/kfdialog.h1
-rw-r--r--kdm/kfrontend/kgapp.cpp17
4 files changed, 60 insertions, 3 deletions
diff --git a/kdm/config.def b/kdm/config.def
index cfeada944..c7388471f 100644
--- a/kdm/config.def
+++ b/kdm/config.def
@@ -1996,6 +1996,16 @@ Comment:
Description:
Specify the Xorg compositing manager. Currently only kompmgr is supported.
+Key: WindowManager
+Type: string
+Default: "kwin"
+User: greeter
+Instance: #*/""
+Comment:
+ Window manager binary name, if window decorations are desired. "" means no window manager support.
+Description:
+ Specify the Xorg window manager. Currently only kwin is supported.
+
Key: UseAdminSession
Type: bool
Default: false
diff --git a/kdm/kfrontend/kfdialog.cpp b/kdm/kfrontend/kfdialog.cpp
index 5ae1c4ec1..3d790f9f2 100644
--- a/kdm/kfrontend/kfdialog.cpp
+++ b/kdm/kfrontend/kfdialog.cpp
@@ -35,15 +35,37 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <tqapplication.h>
#include <tqcursor.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+extern bool has_kwin;
+extern bool is_themed;
+
FDialog::FDialog( TQWidget *parent, bool framed )
- : inherited( parent, 0, true/*, framed ? 0 : WStyle_NoBorder*/ )
+ : inherited( parent, 0, true, (framed&&has_kwin)?0:WX11BypassWM ), winFrame(NULL), m_wmTitle(has_kwin)
{
if (framed) {
+ // Signal that we do not want any window controls to be shown at all
+ Atom kde_wm_system_modal_notification;
+ kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
+ XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
+ }
+
+ if (framed) {
winFrame = new TQFrame( this, 0, TQt::WNoAutoErase );
- winFrame->setFrameStyle( TQFrame::WinPanel | TQFrame::Raised );
+ if (m_wmTitle)
+ winFrame->setFrameStyle( TQFrame::NoFrame );
+ else
+ winFrame->setFrameStyle( TQFrame::WinPanel | TQFrame::Raised );
winFrame->setLineWidth( 2 );
} else
winFrame = 0;
+
+ setCaption(i18n("Trinity Desktop Environment"));
+
+ if (framed) {
+ if (m_wmTitle) setFixedSize(sizeHint());
+ }
}
void
@@ -53,6 +75,7 @@ FDialog::resizeEvent( TQResizeEvent *e )
if (winFrame) {
winFrame->resize( size() );
winFrame->erase();
+ if (m_wmTitle) setFixedSize(sizeHint());
}
}
@@ -133,8 +156,14 @@ FDialog::box( TQWidget *parent, TQMessageBox::Icon type, const TQString &text )
}
KFMsgBox::KFMsgBox( TQWidget *parent, TQMessageBox::Icon type, const TQString &text )
- : inherited( parent )
+ : inherited( parent, !is_themed )
{
+ if (type == TQMessageBox::NoIcon) setCaption(i18n("TDE"));
+ if (type == TQMessageBox::Question) setCaption(i18n("TDE") + " - " + i18n("Question"));
+ if (type == TQMessageBox::Information) setCaption(i18n("TDE") + " - " + i18n("Information"));
+ if (type == TQMessageBox::Warning) setCaption(i18n("TDE") + " - " + i18n("Warning"));
+ if (type == TQMessageBox::Critical) setCaption(i18n("TDE") + " - " + i18n("Error"));
+
TQLabel *label1 = new TQLabel( this );
label1->setPixmap( TQMessageBox::standardIcon( type ) );
TQLabel *label2 = new TQLabel( text, this );
diff --git a/kdm/kfrontend/kfdialog.h b/kdm/kfrontend/kfdialog.h
index 783ce0ae8..d433594a4 100644
--- a/kdm/kfrontend/kfdialog.h
+++ b/kdm/kfrontend/kfdialog.h
@@ -51,6 +51,7 @@ class FDialog : public TQDialog {
private:
TQFrame *winFrame;
+ bool m_wmTitle;
};
class KFMsgBox : public FDialog {
diff --git a/kdm/kfrontend/kgapp.cpp b/kdm/kfrontend/kgapp.cpp
index 03bc361c2..0aaaa6e9b 100644
--- a/kdm/kfrontend/kgapp.cpp
+++ b/kdm/kfrontend/kgapp.cpp
@@ -63,6 +63,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <pwd.h>
bool argb_visual_available = false;
+bool has_kwin = false;
+bool is_themed = false;
static int
ignoreXError( Display *dpy ATTR_UNUSED, XErrorEvent *event ATTR_UNUSED )
@@ -260,6 +262,7 @@ kg_main( const char *argv0 )
SecureDisplay( dpy );
KProcess *proc = 0;
KProcess *comp = 0;
+ KProcess *kwin = 0;
if (!_grabServer) {
if (_useBackground) {
proc = new KProcess;
@@ -277,6 +280,13 @@ kg_main( const char *argv0 )
comp->start(KProcess::NotifyOnExit, KProcess::Stdin);
}
+ if (!_windowManager.isEmpty()) {
+ kwin = new KProcess;
+ *kwin << TQCString( argv0, strrchr( argv0, '/' ) - argv0 + 2 ) + _windowManager.ascii();
+ kwin->start();
+ has_kwin = true;
+ }
+
GSendInt( G_Ready );
kdDebug() << timestamp() << " main1" << endl;
@@ -323,8 +333,10 @@ kg_main( const char *argv0 )
XSetErrorHandler( ignoreXError );
KThemedGreeter *tgrt;
dialog = tgrt = new KThemedGreeter;
+ is_themed = true;
kdDebug() << timestamp() << " themed" << endl;
if (!tgrt->isOK()) {
+ is_themed = false;
delete tgrt;
dialog = new KStdGreeter;
dialog->move(dialog->x() + primaryScreenPosition.x(), dialog->y() + primaryScreenPosition.y());
@@ -394,6 +406,11 @@ kg_main( const char *argv0 )
comp->detach();
delete comp;
}
+ if (kwin) {
+ kwin->closeStdin();
+ kwin->detach();
+ delete kwin;
+ }
delete proc;
UnsecureDisplay( dpy );
restore_modifiers();