The operating system (OS) and the window manager settings you have set on your computer can influence how an interactive program performs. This is particularly relevant for cross-platform programs like IDL, Matlab, and Python. This discussion uses the IDL program Spamalize as an example, but the general discussion is applicable to most similar programs.
The relationship between IDL, Spamalize, your computer OS, and the window manager is complex and somewhat unpredictable. The window manager is the program which you interact with the most, usually without thinking (or knowing) about it. Upgrades can cause unforseen changes, usually for the worse. You may have to experiment to get the behavior you want, and in fact you may not be able to get the behavior you want but rather you will have to settle for "close enough".
In my lab, we use primarily linux, with some Windows XP machines, and we are starting (summer 2008) to move to Macs. I'll add information on other OS/window managers as I encounter them (contributions welcome!). Following are some of the settings you might want to play with for Scientific Linux / KDE.
For example, my linux OS is "Scientific Linux", with the KDE window manager, KWin.
There are 4 options for the mouse focus:
- Click to Focus
- Focus Follows Mouse
- Focus Under Mouse
- Focus Strictly Under Mouse
The latter 2 settings make it easier for programs to pop a hidden window to the top layer. In Spamalize's BrainMaker, clicking the Active View or Refresh buttons should cause the display windows to pop to the foreground (the desired behavior); this is one thing to try if your windows don't pop to the front as desired. However, there is a downside- if the focus follows the mouse, windows can pop to the fore unexpectedly as you navigate around the desktop. I usually leave my setting on "Click to Focus", since then I can have one of the draw-windows remain active while I select an item from another menu.
It is recommended that you initially turn off "Auto raise", especially if you have a small monitor screen. If turned on, when one of the "focus follows/under mouse" options are selected, the menu under the mouse gets raised to the top. This causes your draw windows to be hidden most of the time as you move the mouse around to various menus. On the other hand, if you have a very large screen or multiple screens, turning this feature on can be handy.
Window Behavior Actions
Another influential setting dictates what happens when you click on a window. In linux/KDE, this is in Control Center->Window Behavior->Actions. There are numerous options, but I recommend at least the following for the LEFT MOUSE actions:
- Active: Raise
- Inactive: Activate & Raise
- Inactive Inner Window
- Left Button: Activate, Raise, & Pass Click
- Inner Window, Titlebar & Frame
The setting for the "Inactive Inner Window" = "Activate, Raise & Click" is important- if a click is not passed, you will have to click twise to begin drawing- once to activate the window, and a second time to start drawing.
Disable Focus Stealing Prevention
One other setting available in only a few window managers, including KDE/KWin, is "disable focus stealing prevention". This sounds like a double negative so it is hard to grasp the meaning, but you still need to work with it. If you set up your window manager to enable this behavior, then you can have your mouse set on "Click to focus" and still get the windows to pop to the foreground when they should. It is slightly complicated to set this up. Here is what I did:
- Open the Control Center, select Desktop->Window-Specific Settings->New
- From the "Window" menu, click on "Detect", then click on an idl window. Try different mouse buttons if the left one doesn't work.
- Click the "window class" box, click OK
- in Description, type "Disable focus stealing prevention for IDL"
- in "Window class", type "idl" (without the quotes). Check the "Match whole window class" box.
- In the pulldown menu under "Window class", select "substring match".
- In the pulldown menu under "Window role", select "unimportant".
- Go to the Workarounds tab menu.
- select "Focus stealing prevention", select "Force" from the pulldown menu to the right, and "None" from the last pulldown menu.
- Click "OK".
- Click "Apply" from the Control Center menu, and quit from the Control Center menu.
Questions or comments? Contact Terry Oakes: troakes - at - wisc.edu