- guint i;
-
- /* try all monitors in order of preference */
- for (i = 0; i < screen_num_monitors && !ret; ++i) {
+ /* try all monitors in order of preference, but only the first one
+ if config_place_monitor is MOUSE or ACTIVE */
+ for (i = 0; (i < (config_place_monitor != OB_PLACE_MONITOR_ANY ?
+ 1 : screen_num_monitors) && !ret); ++i)
+ {