summaryrefslogtreecommitdiffstats
path: root/kdesktop/main.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-06-21 21:49:09 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-06-30 21:44:39 +0900
commitd4b3598f25774c1f1c33e000d421e740970fb369 (patch)
tree43b4b56c18dfc3febc193f735075e113bed84ac9 /kdesktop/main.cpp
parenta16753500bb5ca90db10bd98d59c6b5ab662e29b (diff)
downloadtdebase-d4b3598f.tar.gz
tdebase-d4b3598f.zip
kdesktop: fix deadlock condition between kdesktop and kdesktop lock.
The logic to handle communication with kdesktop_lock is now running completely in a separate thread and event loop, meaning the main GUI thread remains responsive all the time and can handle interaction with X11, DCOP and DBUS calls. This resolves issue #589. The commit also solves the first problem reported in issue #640 and loosely related to PR #526. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 409442c1ea8f167485642fbdb3494ff58900966f)
Diffstat (limited to 'kdesktop/main.cpp')
-rw-r--r--kdesktop/main.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/kdesktop/main.cpp b/kdesktop/main.cpp
index 5a04c9bed..33726cb41 100644
--- a/kdesktop/main.cpp
+++ b/kdesktop/main.cpp
@@ -71,7 +71,7 @@ static TDECmdLineOptions options[] =
};
bool argb_visual = false;
-KDesktopApp *myApp = NULL;
+KDesktopApp *myApp = nullptr;
// -----------------------------------------------------------------------------
@@ -251,7 +251,7 @@ extern "C" TDE_EXPORT int kdemain( int argc, char **argv )
else
XCloseDisplay( dpy );
}
- if( myApp == NULL )
+ if (!myApp)
myApp = new KDesktopApp;
#else
myApp = new KDesktopApp;
@@ -260,9 +260,6 @@ extern "C" TDE_EXPORT int kdemain( int argc, char **argv )
KDesktopSettings::instance(kdesktop_name + "rc");
- bool x_root_hack = args->isSet("x-root");
- bool wait_for_kded = args->isSet("waitforkded");
-
// This MUST be created before any widgets are created
SaverEngine saver;
@@ -279,16 +276,15 @@ extern "C" TDE_EXPORT int kdemain( int argc, char **argv )
myApp->config()->reparseConfiguration();
}
- // for the KDE-already-running check in starttde
- TDESelectionOwner kde_running( "_KDE_RUNNING", 0 );
- kde_running.claim( false );
+ // for the TDE-already-running check in starttde
+ TDESelectionOwner tde_running( "_KDE_RUNNING", 0 );
+ tde_running.claim( false );
+ bool x_root_hack = args->isSet("x-root");
+ bool wait_for_kded = args->isSet("waitforkded");
KDesktop desktop( &saver, x_root_hack, wait_for_kded );
args->clear();
-
myApp->dcopClient()->setDefaultObject( "KDesktopIface" );
-
-
return myApp->exec();
}