Bug - Fixed Mafia no longer remembers Main Interface and gCLI window positions when changed

Ethelred

Member
I don't know when this started happening, but mafia no longer seems to remember the position of the Main Interface and gCLI windows from one session to the next. I always open the gCLI as a separate window. I usually interleave two mafia sessions, so the first times it happened I chalked it up to my preferences being overwritten by the other session. I have some windows that open in one spot and some that open in another spot, so I'm pretty sure I used to be able to control this. So today I opened a session that I wanted to change the window locations. I moved the windows to the new preferred locations and logged out. That was the only mafia instance running. Then I logged back in and the windows were back in their prevous position. I looked through the mafia preferences for one that might contol this behavour, but came up empty handed. So is this functionality that got lost somewhere along the way? A preference I'm missing somehow (certainly a possiblity)? Or some other operator error that will make me look like an idiot once revealed?

Environment:

MacOS X 10.6.8
Mafia r10552
Java version "1.6.0_26"
 

fronobulax

Developer
Staff member
Mafia remembers positions but saves them on logout. Since there is something going on with shutting down (see this for example), this may be related or a side effect. In the meantime consider looking in username_prefs.txt for KoLDesktop and LoginFrame or anything else with Frame in the name. Check them, log in, move windows and log out and see if they have changed.
 

lostcalpolydude

Developer
Staff member
You can check Preferences -> General -> "Save options to disk whenever they change" so that they are saved immediately, if that's the problem. That's the default, actually.
 

fronobulax

Developer
Staff member
You can check Preferences -> General -> "Save options to disk whenever they change" so that they are saved immediately, if that's the problem. That's the default, actually.

Curious. When I was implementing the option to remember size I see to recall that the positions were NOT updated (in the sense that mafia was managing them in a preference) during a session and only when the session exited. I should go back and look.
 

lostcalpolydude

Developer
Staff member
Apparently those settings are handled separately from other settings (just checked that "get ItemManageFrame" doesn't update when the Item Manager is moved).
 

slyz

Developer
I can see the "rememberDesktopSize", "desktopHeight" and "desktopWidth" preferences being used in KoLDesktop.java to decide if and how the main GUI window should be resized. Apparently the last two are updated when the frame is disposed.

However, I have a slew of preferences in slyz_prefs.txt which seem to control the position and size of separate windows:
Code:
BuffBotFrame=291,101,0
BuffRequestFrame=572,105
CakeArenaFrame=197,227
CalendarFrame=279,178,0
ClanManageFrame=102,149,4
CoinmastersFrame=109,234,-1
ContactListFrame=527,175
CouncilFrame=436,195,-1
DatabaseFrame=346,285,0
DescriptionFrame=436,195,-1
FamiliarTrainingFrame=82,202
FaxRequestFrame=61,303,-1
FlowerHunterFrame=671,64,1
KoLDesktop=92,-18,-1
LoginFrame=411,150,0
MailboxFrame=60,291,0
MeatManageFrame=315,145
MuseumFrame=354,145,1
MushroomFrame=305,196,0
OptionsFrame=354,145,-1
ProfileFrame=436,195,-1
RecentEventsFrame=248,260
RequestFrame=34,104,-1
RequestSynchFrame=470,92,-1
SendMessageFrame=107,358,-1
StoreManageFrame=452,130,0
TabbedChatFrame=-5,-8,1
TrophyFrame=290,-6,-1
Apparently Lost has them too, but they don't appear in defaults.txt, and I couldn't find any reference to them in the source, by searching with grep for something like : Preferences.get[^\(]+\(.*Frame"[^\)]\)

I always have to resize my tabbed chat window when I start Mafia, and always had. Was mafia supposed to track the size of those extra windows?
 

fronobulax

Developer
Staff member
r10528 may correct this.

"rememberDesktopSize", "desktopHeight" and "desktopWidth" are things I added and I treated them as normal preferences. However they are only updated, and hence written at the end of a session.

As for the other values, what you are looking for is line 708 in GenericFrame where they are saved by Preferences.setString( this.frameName, (int) p.getX() + "," + (int) p.getY() ). Note that the class name is used to make the string and so grep wasn't going to find it.
 

Ethelred

Member
r10528 has some other problem that prevents me from seeing if it fixed it or not. Can't quit from r10528 without using MacOS X force quit utility (probably kill -9 at its heart) which prevents the normal settings update. Posted this bug to another thread.
 
Top