Does Qt Creator save its window state when it closes?
-
Ubuntu 24.04 running in GNOME on Xorg (not Wayland):
I use it mostly maximized. If it opens in a smaller window, I always maximize it manually. Sometimes it opens maximized, but after a certain time (estimated 1 week) it reverts to opening non-maximized.Is there a setting I can use to make it ALWAYS open the same way as it was when it was closed?
-
@Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.
Does that ring a bell?
Regards
-
@Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.
Does that ring a bell?
Regards
@aha_1980 said in Does Qt Creator save its window state when it closes?:
@Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.
Does that ring a bell?
Not in the case of Qt Creator ... internally, it uses
QtSingleApplication(link is here) which prohibits opening more than one instance at the same time. -
@aha_1980 said in Does Qt Creator save its window state when it closes?:
@Robert-Hairgrove I think it does remember the last state, but (and this is a problem with all settings): If you have multiple instances open, the settings are finally written by the last instance that is closed.
Does that ring a bell?
Not in the case of Qt Creator ... internally, it uses
QtSingleApplication(link is here) which prohibits opening more than one instance at the same time.@Robert-Hairgrove
Umm, I use Creator under 24.04 as supplied (and as it happens GNOME Xorg not Wayland!), and I can open another instance.... I can verify tomorrow, but I don't think I'm going mad. -
@Robert-Hairgrove and @JonB: Of course there can be multiple instances open. I always work like that in both Linux as well as Windows.
And as said: the last closed instance writes the final settings.
I just verified that and if I close the maximized window last, then it opens again maximized.
Thats why I asked if you (maybe sometimes) have multiple instances open?
Regards
-
@Robert-Hairgrove and @JonB: Of course there can be multiple instances open. I always work like that in both Linux as well as Windows.
And as said: the last closed instance writes the final settings.
I just verified that and if I close the maximized window last, then it opens again maximized.
Thats why I asked if you (maybe sometimes) have multiple instances open?
Regards
@aha_1980
Agreed: I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it usesQtSingleApplicationto prevent it? You can open another instance by just right-clicking on the icon and picking New Window.@Robert-Hairgrove
As I say, I use same environment as you but I never make it maximized so I do not know if that makes any difference. It does save & restore my non-maximized state, and I don't believe it ever loses that. Doing so "after a week" sounds like either something else on your system happening or you being mistaken and doing something yourself which alters it.UPDATE
Hmmm, there is actually something odd about maximization state. If I resize Creator window it does save/remember that for next open. But if I maximize it does not: when I next open it stays at previous size, it does not restore to maximized. But it seems to be in a funny state: if I then start to drag to resize from the maximized-saved but non-maximized-restored state it immediately "jumps" to maximized. If I then unmaximize it reverts to normal resizing. So there is something odd going on when restoring to maximized. It might be related to my finding years ago (posted somewhere in this forum and/or on stack... something) that, under GNOME/Xorg, windows whose size is greater than something like 75% of total area count as/are made to behave as maximized. I had to change some default mutter value to alter this behaviour (I did not like it), let me know if you want me to dig that out. -
@aha_1980
Agreed: I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it usesQtSingleApplicationto prevent it? You can open another instance by just right-clicking on the icon and picking New Window.@Robert-Hairgrove
As I say, I use same environment as you but I never make it maximized so I do not know if that makes any difference. It does save & restore my non-maximized state, and I don't believe it ever loses that. Doing so "after a week" sounds like either something else on your system happening or you being mistaken and doing something yourself which alters it.UPDATE
Hmmm, there is actually something odd about maximization state. If I resize Creator window it does save/remember that for next open. But if I maximize it does not: when I next open it stays at previous size, it does not restore to maximized. But it seems to be in a funny state: if I then start to drag to resize from the maximized-saved but non-maximized-restored state it immediately "jumps" to maximized. If I then unmaximize it reverts to normal resizing. So there is something odd going on when restoring to maximized. It might be related to my finding years ago (posted somewhere in this forum and/or on stack... something) that, under GNOME/Xorg, windows whose size is greater than something like 75% of total area count as/are made to behave as maximized. I had to change some default mutter value to alter this behaviour (I did not like it), let me know if you want me to dig that out.@JonB said in Does Qt Creator save its window state when it closes?:
I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it uses QtSingleApplication to prevent it? You can open another instance by just right-clicking on the icon and picking New Window.
Well, I learned something new today! I never knew that it was possible to open a new instance like that.
However, I never work with more than one instance, so it must have been something else. I noticed that when I have the window maximized, then open a dialog such as the "Sessions" dialog, then drag that dialog over the Qt Creator window, that the window becomes unmaximized (restored). Perhaps this has to do with the Qt Maintenance tool asking to close Qt Creator? Maybe I dragged that window and unmaximized the window without noticing it?
Thanks for taking time to look into this!
-
@JonB Yeah, probably the window manager, desktop environment, moon phase etc. might also be relevant. On the other hand, when I need the window maximized, thats just one click. I don't care that much... But maybe thats just me.
-
@JonB said in Does Qt Creator save its window state when it closes?:
I don't know why OP thinks or finds you cannot run multiple instances of Creator or why he thinks it uses QtSingleApplication to prevent it? You can open another instance by just right-clicking on the icon and picking New Window.
Well, I learned something new today! I never knew that it was possible to open a new instance like that.
However, I never work with more than one instance, so it must have been something else. I noticed that when I have the window maximized, then open a dialog such as the "Sessions" dialog, then drag that dialog over the Qt Creator window, that the window becomes unmaximized (restored). Perhaps this has to do with the Qt Maintenance tool asking to close Qt Creator? Maybe I dragged that window and unmaximized the window without noticing it?
Thanks for taking time to look into this!
-
Having Creator maximized, opening any modal dialog (doesn't have to be Sessions) on it and then dragging that dialog makes Creator main window go non-maximized. That would indeed count as though you had chosen to do that, so it will now save itself non-maximized for next restore. I don't know why it does this, but I would imagine it is a GNOME/Mutter thing, not a Creator one.
-
I don't know anything about Qt Maintenance tool or what that might do to Creator as I have never used it. I only take the Qt + Creator which comes with the current Ubuntu release.
-
-
R Robert Hairgrove has marked this topic as solved