Post Reply

Forums -> UltraMon™ -> Application opens subsidiary windows on the other monitor
Elaine   2007-01-18 00:29
I have several applications opening on monitor 2, however they have secondary windows that open up within that program. These windows open up on monitor 1. I move them to monitor 2 and close them but the next time they go back to monitor one. Is there any way to make all windows from within the same application open on the same monitor?

I am using version 2.7.1

Elaine Younger
Insurance Planning, Inc.
younel@insurance-planning.com
785-625-0846
Scott   2007-01-18 06:02
This happens to me while running aim on my 2nd screen. I open and close the program in the 2nd screen, but when I start a new IM or view someones profile, it opens up on the first screen no matter what.
Christian Studer   2007-01-18 08:17
Currently that's not supported, will be considered for UltraMon 3.

ZMover might help with this.

Christian Studer - www.realtimesoft.com
Matthew Sawyer   2007-01-19 00:28
I am not sure I would necessarily regard this issue as a shortcoming of UltraMon. As an application developer, I recall developing an XMPP (Jabber) instant messaging client in Microsoft C# (.NET 2.0).

Before I jump into what's about to be a long story, let me give you the summary:

The application in question should be "smart enough" to determine the positioning of windows. Windows exposes through APIs (this is really easy in .NET) the "desktop bounds" so you can determine the entire size of the desktop, making it easy to get the position and sizes of each of your windows and therefore opening and sizing new ones appropriately.

If you want the full story, keep reading...

In the case of my application (USCSS Nostromo A7X - https://www.dojonorthsoftware.net/jmLambert), it opens a variety of windows:

--> Main window
--> One chat window for each active chat
--> Profile windows
--> Message history windows
--> Others

In .NET, you have complete control over where windows open...positioning, size, etc. You can accept the default, which I don't like at all. The default could cause the window to open theoretically anywhere. I've found that, in this case, it's always in the "main" monitor but there's no guarantee of its position.

You also get the option of "CenterScreen," which typically will open in the center of the monitor that has the mouse pointer in it. There's also "CenterParent," which typically causes the child window to be displayed in the center relative to its parent (calling) window.

The way I handle it is to keep track of the various windows. For each window that the user is likely to use most often (main, chat, history and profile), I keep track of this information in an internal array. The array keeps a record of what type of window it is, the X-Y coordinates of the upper left corner of the window and the X-Y size of the window. When Nostromo is closed, this information is written to an XML file. The XML is reread the next time Nostromo is run.

The result? Nostromo remembers EXACTLY where each of your windows belong. Thus, they will display in exactly the same position and the same size when you last used them. If you resize or move them, they will "remember" the new positioning.

But what if your desktop configuration changes? Maybe you were using your laptop with an external monitor but now are just using the laptop?

Remember the part I spoke of about desktop bounds? Nostromo always checks the desktop bounds when starting as well as when new windows are opened. If it detects that the window will open in a location that is no longer available, it will automatically move--and resize if needed--the window to the main monitor, allowing you to resize and/or move it to a new location. In this manner, Nostromo's windows are never "lost" in nonexistent monitors.

That's probably much, much more than you were looking for, but I just wanted to emphasize that it's not UltraMon's responsibility to position windows. It should be the job of the application to be multiple-monitor aware and function accordingly.

Best regards,
Matt
Forums -> UltraMon™ -> Application opens subsidiary windows on the other monitor

Post Reply