Weird stuff with Eclipse…

Or: How to get your users pissed unhappy.

Simple: Hack to span an Eclipse RCP screen accross more than one monitor. Don’t ask me why, it wasn’t my idea. I’ve just seen this in code somewhere.

Here’s how it works:

Mess up the Window.getInitialSize() so it takes all your screen real estate into acount, you’ve got two displays 1200 pixels wide? Ok, then we make the initial size’s width 2400. Don’t forget to mutilate alter the Window.constrainShellSize() method accordingly, else Eclipse will act up a bit. (How naughty.)

Now comes the best part. make sure you filter any occurences of SWT.RESIZE when Window.setShellStyle(int newShellStyle) gets called. Yes I said filter. Imagine some gullable developer passing by who thinks restricting window resizing is an excelent end-user screw.

Did I mention that all this was achieved by some aspectj crosscutting??

In the end, it works, sort of. Maximizing is disabled and resizing is disabled. So you end up with a huge piece of crap window plastered all over your screen real estate. You see, users are just dumb people. Letting them decide how to set their window sizes can only result in trouble. Well, atleast that seems to be the idea.

I hope you all got the point that I think the above is an “excellent” idea. (No, ofcourse I don’t think the above is a good idea.)

2 Replies to “Weird stuff with Eclipse…”

  1. Sounds like the easy way out for supporting a multi-monitor application. But what if one monitor breaks, or one more is added? What if monitors are upgraded with a higher/lower resolution?

    A more elegant solution to provide default multi-monitor full-screen behavior would be to add a button (or do it by default) that:
    * Checks the number of monitors using Display.getMonitors()
    * opens multiple Workbench Windows using the PlatformUI.getWorkbench.openWorkbenchWindow() using different perspectives for ordening views and editors.
    * Position and maximize the workbench windows using the methods on the window Shell.

    The only thing that you’d miss is that editors/views are not spanned across monitors. But users get confused by this anyway so it is normally desired to keep windows on one monitor. If users really need a widescreen view, why not buy a single widescreen monitor instead?

    Another option would be to just install/buy a desktop manager tool that adds a “span window across monitor” option to the title bar. Saves a lot of hacking with AspectJ. 😉

  2. Indeed, one of the requirements of this applications is that all screens should preferably be of the same size. And they must run the exact same resolution.

    The reason for this widescreen behaviour is because certain grafical representations should span as much as possible.

    Oh, did I mention that a system configuration can range from 1 all the way up including 4 monitors. Yes, that’s 4 monitors.

Comments are closed.