Previous: Moving Windows, Up: Multiple Document Interface

### 4.6 Perspectives

GPS supports the concept of perspectives. These are activity-specific desktops, each with their own set of windows, but sharing some common windows like the editors.

Depending on the activity you want to perform (debugging, version control,...) you could switch to another perspective. For instance, in the context of the debugger, the new perspective would by default contain the call stack window, the data window, the debugger consoles,... each at your favorite location. Whenever the debug starts, you therefore do not have to open these windows again.

The perspectives have names, and you switch perspectives by selecting the menu /Window/Perspectives/. You can also create a new perspective by selecting the menu /Window/Perspectives/Create New.

GPS will sometimes automatically change perspectives. For instance, if you start a debugger, it will switch to the perspective called "Debug" (if it exists). When the debugger terminates, you are switched back to the "Default" perspective (again, if it exists).

When you leave a perspective, GPS automatically saves its contents (which windows are opened, their location,...), so that when you are going back to the same perspective you find the same layout.

Likewise, when GPS exits, it will save the layout of all perspectives into a file called `perspectives.xml`, so that it can restore them when you restart GPS. This behavior is controlled by the "Save desktop on exit" preference, and can be disabled.

One of the difficulties in working with perspectives is knowing which windows will be preserved when you switch to another perspective, and which windows will be hidden. There is a central area where all preserved windows are found. Typically, it only contains editors (including if you have split them side by side for instance). If you drag and drop another window on top or to the sides of an editor, that window will be preserved when changing perspectives, unless it was already found elsewhere in the new perspective. The small tooltip that appears on the screen while you drag and drop will tell you whether the window (if dropped at the current location) will be visible in other perspectives or not.