Initial attempt at adding third part WM support to TDE

pull/2/head
Timothy Pearson 12 years ago
parent b5d92fb45b
commit 4546adf40c

@ -157,6 +157,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
##### tdebase directories #######################
add_subdirectory( tdmlib )
add_subdirectory( tdeinit )
tde_conditional_add_subdirectory( BUILD_L10N l10n )
tde_conditional_add_subdirectory( BUILD_PICS pics )

@ -35,6 +35,7 @@ static const KCmdLineOptions options[] =
{ "restore", I18N_NOOP("Restores the saved user session if available"), 0},
{ "w", 0, 0 },
{ "windowmanager <wm>", I18N_NOOP("Starts 'wm' in case no other window manager is \nparticipating in the session. Default is 'twin'"), 0},
{ "windowmanageraddargs <wm>", I18N_NOOP("Pass additional arguments to the window manager. Default is ''"), 0},
{ "nolocal", I18N_NOOP("Also allow remote connections"), 0},
KCmdLineLastOption
};
@ -203,6 +204,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
}
TQCString wm = args->getOption("windowmanager");
TQCString wmaddargs = args->getOption("windowmanageraddargs");
if ( wm.isEmpty() )
wm = "twin";
@ -218,7 +220,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
only_local = false;
#endif
KSMServer *server = new KSMServer( TQString::fromLatin1(wm), only_local);
KSMServer *server = new KSMServer( TQString::fromLatin1(wm), TQString::fromLatin1(wmaddargs), only_local);
kapp->dcopClient()->setDefaultObject( server->objId() );
IceSetIOErrorHandler( IoErrorHandler );

@ -578,12 +578,13 @@ static Status KSMNewClientProc ( SmsConn conn, SmPointer manager_data,
extern "C" int _IceTransNoListen(const char * protocol);
#endif
KSMServer::KSMServer( const TQString& windowManager, bool _only_local )
KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManagerAddArgs, bool _only_local )
: DCOPObject("ksmserver"), sessionGroup( "" ), startupNotifierIPDlg(0), shutdownNotifierIPDlg(0)
{
the_server = this;
clean = false;
wm = windowManager;
wmAddArgs = windowManagerAddArgs;
shutdownType = KApplication::ShutdownTypeNone;

@ -58,7 +58,7 @@ k_dcop:
void kcmPhase1Done();
void kcmPhase2Done();
public:
KSMServer( const TQString& windowManager, bool only_local );
KSMServer( const TQString& windowManager, const TQString& windowManagerAddArgs, bool only_local );
~KSMServer();
static KSMServer* self();
@ -203,6 +203,7 @@ private:
bool clean;
KSMClient* clientInteracting;
TQString wm;
TQString wmAddArgs;
TQString sessionGroup;
TQString sessionName;
TQCString launcher;

@ -180,7 +180,15 @@ void KSMServer::startDefaultSession()
"autoStart1Done()", true);
connectDCOPSignal( launcher, launcher, "autoStart2Done()",
"autoStart2Done()", true);
startApplication( wm );
if (!wmAddArgs.isEmpty()) {
TQStringList wmstartupcommand;
wmstartupcommand.split(" ", wmAddArgs);
wmstartupcommand.prepend(wm);
startApplication( wmstartupcommand );
}
else {
startApplication( wm );
}
if ((showFancyLogin) && (!startupNotifierIPDlg)) {
startupNotifierIPDlg = KSMStartupIPDlg::showStartupIP();
}

@ -575,8 +575,7 @@ fi
# We only check for 255 which means that the ksmserver process could not be
# started, any problems thereafter, e.g. ksmserver failing to initialize,
# will remain undetected.
test -n "$TDEWM" && TDEWM="--windowmanager $TDEWM"
kwrapper ksmserver $TDEWM
tdeinit_phase1
if test $? -eq 255; then
# Startup error
echo '[starttde] Could not start ksmserver. Check your installation.' 1>&2

@ -0,0 +1,28 @@
#################################################
#
# (C) 2010-2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
include_directories(
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
)
##### tdeinit_phase1 (executable) #######################
tde_add_executable( tdeinit_phase1
SOURCES phase1.cpp
LINK udev
DESTINATION ${BIN_INSTALL_DIR}
)

@ -0,0 +1,82 @@
/***************************************************************************
* Copyright (C) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
#include <pwd.h>
#include <signal.h>
static const char description[] = I18N_NOOP("TDE Initialization Phase 1");
static const char version[] = "0.1";
static KCmdLineOptions options[] =
{
KCmdLineLastOption
};
int main(int argc, char **argv)
{
int return_code = -1;
KAboutData about("tdeinit_phase1", I18N_NOOP("tdeinit_phase1"), version, description,
KAboutData::License_GPL, "(C) 2012 Timothy Pearson", 0, 0, "kb9vqf@pearsoncomputing.net");
about.addAuthor( "Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net" );
KCmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
KConfig config("twinrc", true);
config.setGroup( "ThirdPartyWM" );
TQString wmToLaunch = config.readEntry("WMExecutable", "");
TQString wmArguments = config.readEntry("WMAdditionalArguments", "");
// Check for TWIN override environment variable
const char * twin_env = getenv("TWIN");
if (twin_env) {
wmToLaunch = twin_env;
}
// Make sure the specified WM exists
if (KStandardDirs::findExe(wmToLaunch) == TQString::null) {
wmToLaunch = "";
}
// Launch the WM!
if (wmToLaunch == "") {
return_code = system("kwrapper ksmserver");
}
else {
return_code = system((TQString("kwrapper ksmserver --windowmanager %1 --windowmanageraddargs %2").arg(wmToLaunch).arg(wmArguments)).ascii());
}
return return_code;
}
Loading…
Cancel
Save