From 409442c1ea8f167485642fbdb3494ff58900966f Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 21 Jun 2025 21:49:09 +0900 Subject: 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 --- kdesktop/main.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'kdesktop/main.cpp') diff --git a/kdesktop/main.cpp b/kdesktop/main.cpp index f3e61e2f2..0465068b6 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(); } -- cgit v1.2.3