Created attachment 2373 session support for mousepad X11 session support for mousepad. However, patch 2369 from libxfcegui4 bug 5377 is required, and xfce session bug 5379 should be fixed for 2+ mousepads.
Created attachment 2633 minimal session support for mousepad X11 session: save settings and file name. 4.6.1 compatible.
If think xfce4-session handles this stuff by now. However after restoring a saved session, Mousepad is opened with a empty file. Is this a xfce4-session bug or we should keep this bug open in order to investigate this misbehavior?
(In reply to André Miranda from comment #2) > If think xfce4-session handles this stuff by now. > However after restoring a saved session, Mousepad is opened with a empty > file. > Is this a xfce4-session bug or we should keep this bug open in order to > investigate this misbehavior? xfce-base/xfce4-session-4.12.1 handles this incompletely: mousepad is started at session's restore, but user expects it not only to be started, but to be started with the same files opened. I'm not familiar with session's theory, could you describe how I can verify is it xfce4-session bug or not? As for me, it at least is not only xfce4-session bug. P.S. About completeness of session support see my last FR (bug #12300).
xfce-session now (since 4.8 IIRC) properly handles interactivity, including 2+ programs interacting while logging out. That is not the point. To restore the file(s) it was opened with, a program must register a "save-yourself" handler, and this handler must place the file name(s) in the session data - you can see that in the example attachment. xfce-session, by itself, only saves the program name. It has no access to the internals of mousepad, or any other program - and rightly so. The handler may also save any program settings which are normally saved on exit, since "save-yourself" means that normal exit (like File -> Quit) will not happen. Last, it may also ask whether to save a file which was modified but not saved. Here, Xfce 4.6 and earlier had some problems, which were fixed. (A more complex alternative will be to save the file content in a temporary file, and on restore (a) read that file, (b) place the proper file name, and (c) re-light the "modified" flag. But that's not good for large files.) Now, to check whether MP handles sessions properly, simply get the source, and try to find something that looks like a save-yourself handler. It may be different than the attachment, using some new xfce-session library API-s or something, but the source is not big, and you should be able to spot it.
-- GitLab Migration Automatic Message -- This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/mousepad/-/issues/3. Please create an account or use an existing account on one of our supported OAuth providers. If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev