RCP opening monitor

时光怂恿深爱的人放手 提交于 2020-01-05 06:32:21

问题


I just completed the export of my RCP application for Windows and I noticed some strange behavior when testing the app on computer with 2 monitors.

The first time the application is launched, the splash screen and the main apllication windows are displayed on the primary monitor => it's ok !!!

Then I move my application on the second monitor and close it. Relaunch the app displays the splash screen on the second monitor, it's perfect, but it then brings the application window on the first monitor => it's boring and not the expected behavior ...

My Eclipse SDK doesn't have this problem, it simply opens at the last location. I guess I am missing something in my RCP in order to have the same behavior.

Any idea on the subject will be really helpful for me because after many "googling" I was not able to solve my issue.

Thanks in advance for your help

Manu


回答1:


Did you try some kind of workbench customization, using the IWorkbenchConfigurer like in this example?

// in preWindowOpen(IWorkbenchWindowConfigurer configurer)

Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
configurer.setInitialSize(new Point((int)dim.getWidth(),
(int)dim.getHeight()));

Or:

if you use configurer.setSaveAndRestore(true); in your initialize() then the rcp re-opens in the last used size.

Since it only set the size, it may not be enough in your (double-screen) case though.



来源:https://stackoverflow.com/questions/3184999/rcp-opening-monitor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!