Summary: | kate: windows are on wrong desktops in restored session | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | missive |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | adrian.dziubek, g4mba5, gsasha, kde, l.lunak, mail, meyerm |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
missive
2005-12-03 20:57:36 UTC
This is even stranger than I thought... I just restarted my session again to test. First, I arranged everything the way I want it, then I clicked the "Save Session" button. Then I logged out and back in. I have desktops set up with the Taskbar set to show only windows that are on the current desktop. I have one Kate window that was restored to the correct desktop, but when I am on that desktop, the window does not show up in the taskbar. It does show up in the taskbar of another desktop (the one immediately to the right). When I switch to that other desktop, and click on the errant Kate entry in the taskbar, I am switched back to the desktop where the window is. Same happens to me (i.e., the trouble with restoring the different Kate windows on appropriate desktops). My system is detected as: 2.5.0 (KDE 3.5.0, Kubuntu Package 4:3.5.0-0ubuntu0breezy1 breezy) Actually I get this with kate 2.5.0, but also with kpdf 0.5 on kde 3.5.0, so maybe this is a kicker issue. Same here with KDE 3.5.1 on Kubuntu. I believe this is related to the problem that Kate windows are not minimized when restored by the session manager, even if they were when the session was saved. I think something goes wrong so that the the window manager can't match the windows correctly. I haven't been able to spot why this is so, but kate mainwindows does do things different from other mainwindows. Same problem with KDE 3.5.1 on SuSE 10. Kate's minimized windows are restored on the desktop instead of only in the taskbar. Besides, all Kate's windows always re-appear on the active desktop with no respect for the desktop on which they were at KDE shutdown. Same on Slackware-10.2, kate-2.5.1, kde-3.5.1 contrib binaries from kde.org: all kate windows are restored on the current desktop, any minimized windows are de-minimized. on kde 3.5.2 kate windows still pop up on wrong desktops. The same on Debian 2.6.16-1-k7 4:3.5.2-2+b1 Problem still there on KDE 3.5.4. Aargh. Yeah and 3.5.5 too. Same with KDE 3.5.5, Gentoo. Still there in 3.5.6 same with me (SuSe 9.3, 3.5.6 "release 31.4"). Kate and KMail and Skype are messed up practically all the time: I have 8 desktops at #1 kate should be, at #8 kmail and skype. But add. I register that now even the after right mouse click on the kate window for moving to a different desktop shows a wrong desktop no. Carl Debian Etch, KDE 3.5.5, Kate 2.5.5. Kernel 2.4.27-3-686 and 2.6.18-4-686. Same for me. On KDE startup I have Kate restore the session for desktop 3 but instead Kate appears on the current desktop instead (the last one on show from previous logout). If I click on a new desktop while Kate is still restoring files Kate will appear on the desktop. Previous Kate 2.3.2 worked great. Not sure if related, but also seems slow to restore the session (24 files) compared to the previously used Kate. Still there in KDE 3.5.7 I think this could be a helpful remark. There are basically two kinds of applications: 1) that checks the desktop on the very beginning and then the instance lands on that desktop. Most applications do it this way. 2) that checks the desktop just before instantiating (hard word for a foreigner) and this is Kate's kind... The second one seems to fail on desktop restoring... The thing is You can test it without restarting. Simply run the app and the switch immediately. Say Firefox, will stay on the desktop You ignited it on. Kate will follow You. That's not very clever remark... but anyway... *** Bug 131046 has been marked as a duplicate of this bug. *** Still valid for KDE 3.5.9 and Kate 2.5.9 :-( Kate still behaves incorrectly in opensuse 11.0 (KDE 4.04). I also have 10 desktops. Kate works with some dozen files in desktop 2, and if I turn it off in some other desktop, bingo... next time kate will be in the wrong one. Kate shows this odd behavior for some years now. I really hoped that, with kde 4.x, this bug would vanish, and this was the very first thing I tested in this new opensuse install on my new notebook, bougth today. Perhaps in version 5? :-) I encounter this issue with konsole 1.6.6 on kde 3.5.9 any help appreciated!! kubuntu 1.75 on hardy Being really bored by this bug, I finally decided to download the KDE 3.5.9 source archives, hold my breath and dive into Kate's source code. Many hours of Kate and KWin recompilations later, I think I can fix that bug. :-) The problem seems to come from the KateApp::restoreKate() method, located in the kateapp.cpp source file. At line 161, you see that: KStartupInfo::setNewStartupId(activeMainWindow(), startupId()); This call seems to make kicker crazy. If you remove it, Kate behaves correctly. I look in other KDE programs, and apparently none of them use this method during session restore. So I think it is safe to remove it. When Kate reopens its documents, it displays a progress bar. The code is located in the KateDocManager::restoreDocumentList() method, in the katedocmanager.cpp source file. With the previous change, you won't see it anymore unless the current virtual desktop is the one Kate is located on. Adding two lines in katedocmanager.cpp fixes the problem: #include <kencodingfiledialog.h> #include <kio/job.h> + #include <kwin.h> ... QProgressDialog *pd=new QProgressDialog( i18n("Reopening files from the last session..."), QString::null, count, 0, "openprog"); + KWin::setOnDesktop(pd->winId(), KWin::currentDesktop()); pd->setCaption (KateApp::self()->makeStdCaption(i18n("Starting Up"))); IMHO, this progress bar is not really useful when restoring the session at login. But removing it in that specific case will need more changes. Well, it seems that it works for me, and I'm really happy. :-). Now what should I do to merge these changes? this fix cant be transferred to konsole somehow, can it?? I have no problem with konsole: I have three or four instances of konsoles with many tabs on many different virtual desktops, and they all go where they should be at login. Fixed in KDE 3.5.10 SVN commit 846328 by bminisini: BUG: 117618 Kate is finally restored on the correct desktop. The opened files progress window displayed at session restore is now put on the \ current desktop now, so that the user can see it. M +2 -2 kateapp.cpp M +4 -2 katedocmanager.cpp |