How can I prevent programs from switching workspaces?

I want to prevent programs from switching workspaces. If I'm working in one workspace and a program in another workspace has a dialog box come up, it interrupts whatever I'm doing. Similarly, if I switch to a workspace, click to open a program, then switch back to the first workspace, the program will open in the workspace I'm currently on, rather than the workspace I opened it in.

Basically, I want a program to be locked to a workspace and unable to switch.

Any suggestions are appreciated!


Solution 1:

To fix an application to a specific viewport (you can manually move it after it has opened), use Compiz.

  1. Install CompizConfig Settings Manager using Ubuntu Software Manager. Warning: you can mess up your interface if you fiddle with bits you don't know, so follow the instructions here carefully.
  2. Open CompizConfig Settings Manager (also known as CCSM).
  3. Choose Window Management from the left-hand menu.
  4. Choose Place Windows from the right-hand side.
    CCSM Place Windows
  5. Select the tab Fixed Window Placement.

Now, for each application whose window you want to place in a fixed viewport:

  1. Open the application.
  2. In CCSM, under Windows with fixed viewport, select New.
  3. Press the big green + and then Grab. The cursor changes to a cross; click on the application window you want to fix (e.g. Firefox). The Value will be automatically filled in.
  4. Press Add.
    Getting to the Grab button
  5. Fill the X Viewport Positions (should be singular); this refers to the workspace number counting from the left.
  6. Fill the Y Viewport Positions (should be singular); this refers to the workspace number counting from the top.
    In my example, I have chosen Firefox to always start in the third column, second row of the available workspaces.
    Firefox example
  7. Press Close.

Thereafter, that application will always open in that specific viewport.