Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running both Chrome and Chromium on my Mac. I never notice a problem with Chrome but with Chromium it always seems to start off in a very odd and much too small size and position on the screen.

I know there are some good utilities for window management , but what controls the default size / position of windows in OS X?

Update @slhck: Picture.png

share|improve this question
    
FYI - Chrome has command line switches you can use to set the window size and position: --window-position=x,y and --window-size=w,h –  cwd Jun 22 '12 at 23:01

1 Answer 1

up vote 2 down vote accepted

It depends on the program. Most of these "main" window settings (or, more precisely, "document" window settings) are sort of hardcoded. I believe they use what Apple provides in their window management frameworks, like for example Preview.app.

For most apps, only the NSWindow properties of auxiliary windows are stored in the program's Property Lists, while the document window settings may be stored somewhere else. This is what Chrome does, since it is cross-platform and uses a shared preferences format across multiple computers.


For example, com.macromates.textmate.plist has the following entry:

NSWindow Frame New File Sheet
568 932 386 209 0 0 1920 1178

You can change these, and I believe they use rectangle coordinates and origins for representation, the first four values being the NSRect:

  • top left X coordinate
  • top left Y coordinate
  • width
  • height

TextMate does store its main window position under OakDocumentWindowFrame, but as I already mentioned, this is not the case for all document-based applications.


Google Chrome uses its own way of dealing with this, namely in a JSON file. It has a window_placement setting, and you can find it in:

~/Library/Application Support/Google/Chrome/Default/Preferences

Here's what it looks like:

"window_placement": {
         "always_on_top": false,
         "bottom": 1046,
         "left": 0,
         "maximized": false,
         "right": 1680,
         "top": 22,
         "work_area_bottom": 1046,
         "work_area_left": 0,
         "work_area_right": 1680,
         "work_area_top": 22
      },
share|improve this answer
    
Looking at ~/Library/Preferences/com.google.Chrome.plist and I don't see too much helpful info. Post updated with screenshot... –  cwd Feb 23 '12 at 17:02
    
@cwd Read this answer again, it only mentions auxiliary windows, like inspectors. –  Daniel Beck Feb 23 '12 at 17:25
    
@DanielBeck So am I right that most applications will not use Preference Lists for storing document window properties, but resort to their own settings (like Chrome does)? Couldn't find a reference for this. –  slhck Feb 23 '12 at 17:31
1  
@slhck You're mostly right, from what I can tell. Here's what I think: Inspectors (like fonts dialog, open/save dialogs, etc.) are handled by the system frameworks and just add their preferences to the application's .plist. Application authors are free to store this somewhere else (like the cross-platform Chrome does with the JSON file you found), or also in the .plist, like e.g. Safari (grep for NSWindow Frame BrowserWindowFrame) or Terminal (grep for NSWindow Frame $ProfileName, e.g. NSWindow Frame TTWindow Basic) do. Programs without defaults (e.g. Preview) can just skip this. –  Daniel Beck Feb 23 '12 at 17:39
1  
AFAIK, no window size/positions used to be saved at all by default. The developer has to add a unique autosaveName value for the NSWindow (or NSPanel) in the nib file, or programmatically at runtime. This string value is what's used after the NSWindow Frame part: like BrowserWindowFrame. If no autosaveName is set, no information is saved for that window. Not exactly sure how NSDocument-based windows are handled WRT autosaveName. Note that the new Lion restore feature may potentially allow windows to be saved even if theres no autosaveNames set for the windows in question (not sure). –  NSGod Feb 24 '12 at 22:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.