SUMMARY Main window does not remember its position. STEPS TO REPRODUCE 1. Change windows size and position 2. Close app 3. Run app OBSERVED RESULT Size is restored but window position not. It seems that top-left corner is set to the same position regardless of position set by user. EXPECTED RESULT Window position should be restored to last set. SOFTWARE/OS VERSIONS Windows: 10 macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
*** Bug 326064 has been marked as a duplicate of this bug. ***
Sizes are restored, windows positions not, I can confirm that even on Linux ;=)
But this is not critical, actually it is like this since years. I am not even sure we want to try to restore the position, as this will mess around with what the window manager or Windows itself does.
It is critical, because if i change windows size and then position window to be centered with new size, after new Kate start its window is positioned with new size half-outside of the screen. Startup window size is too small so that resizing is needed to make working reasonable. But user must reposition window all the time Kate is started. Very annoying and non user friendly.
Also I don't understand what is problem to remember window position in cfg file or registry. It has nothing to do with Windows window manager. Any windows application which needs to remember its window position does so. The you do with size, so explain me why Windows window manager can be messed with position restoring?
If you e.g. change your resolution between saving/restoring Kate, you might have issues. The current window size restore has some checks for that, to not create window that span outside of your screen sizes. I assume the same will be needed for the position. In any case: If somebody wants to work on it and provides some patch, I would have no issues to accept it, if it handles screen geometry changes like the size restoring stuff well.
Windows size and position must be saved, of course, for any used resolution and number of monitors, but it is nothing impossible. Let us consider e.g. ini file to store this configuration. Kate starts for the first time, user changes size and position and Kate saves such record [MainWindow] Size(1366x1080x96)=500,1000 Pos(1366x1080x96)=10,10 Then user changes resolution to e.g. 1920x1080x120 (or connect another monitor,changes only dpi etc). If Kate is running, no problem, user will probably change size and position to reflect new screen size and dpi. Kate simply saves new values and ini file now looks like this [MainWindow] Size(1366x768x96)=500,600 Pos(1366x768x96)=10,10 Size(1920x1080x120)=1000,800 Pos(1920x1080x120)=20,20 If user dos not change position manually, Kate either catches WMDPICHANGED and WMDISPLAYCHANGE messages and saves its size and pos itself or saves these values on its exit. if Kate is started then it detects desktop size and dpi and looks for appropriate record in ini file and restores its size and position. If record is not found then Kate starts with default size and pos. What do you think?
To store the stuff indexed with screen geometry would make sense, yes. If you can provide a patch, this would be welcome. You can search for KWindowConfig::saveWindowSize and KWindowConfig::saveWindowSize to see where this would need to be done in the code.
I'm afraid I have no experience with programming/building apps under Linux so I must frankly say I don't dare to make any changes in Kate's sources :(
:=) You could try to do the change on Windows, but I must confess that takes some time to either setup all things manually or use e.g. craft. https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows Thought we really would welcome some "real" Windows developer to get Kate running well on that OS.
I found Kate very promising editor (being disgusted with native windows editors on the market) so I would like to help you but C is not my native language, i'm experienced Delphi developer, I can read C but code writing is another challenge. I don't know Kate architecture and also have no experience with multi-platform coding yet (Windows native apps take my all time :)) So it would be long-term run to make me capable of writing confident code for Kate. I can advise or point you to solutions but but direct coding is, i'm afraid, out of my scope and capabilities now.
;=) I you dare to try to setup some dev environment, we could try how far you get with some small patches.
Well, get me some time :), I will notify you when i'm ready. Here?
Sure, or ping us on kwrite-devel@kde.org, if nobody reacts ;=)
Well, Craft installed, Kate sources repository cloned. i'm using Visual Studio 2019 CE. How to make vs solution to set Kate project correctly?
If you compiled the stuff with Craft, would VisualStudio be able to import the CMake project?
;=) CCing the Craft maintainer. Before I explain complete trash here. Is there any prefered way how to work with Craft + VisualStudio?
I tried to open CMakeLists.txt, compilation started but this error appeared: CMake Error at C:\Repository\Kate\CMakeLists.txt:17 (find_package): Could not find a package configuration file provided by "ECM" (requested version 5.40.0) with any of the following names: ECMConfig.cmake ecm-config.cmake Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR" to a directory containing one of the above files. If "ECM" provides a separate development package or SDK, be sure it has been installed. C:\Repository\Kate\CMakeLists.txt line 17
That means the ECM stuff is missing or the configuration wasn't taken properly. Did you compile the stuff with craft before that?
I called "craft kate" from craftenv and it succeeded after 30mins and took 4 GB. when I called "craft --compile kate" it failed because it did not find kate repository. where can I set it?
Adding more Windows man power to the bug ;=)
I think it should do this on Linux too. :)
Found out that KXMLGui is supposed to be doing this. *** This bug has been marked as a duplicate of bug 415150 ***