| Summary: | No aero style with JDK 7 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Stefan Krause <Stefan.Krause> | ||||
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | artem.ananiev, daniel_megert, eclipse.felipe, fyaoxy, lshanmug, M8R-sgiphk, markus.kell.r, Mike_Wilson, prakash, remy.suen, Silenio_Quarti, yymadrian | ||||
| Version: | 3.6.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Stefan Krause
Sounds like what someone mentioned on the mailing list. http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07140.html I ran eclipse with jdk7 on windows XP, I too get windows classic look. Although Java 7 is in beta, it would be good to investigate what has changed here. If it seems like something that is likely to remain broken when the real Java 7 release happens then a fix for 3.6.2 should be investigated. This is the same problem we had when JDK 6 was about to be released, see bug 247046. The workaround in bug 247046 comment 25 worked for me with JDK7. I post message at <a href="http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07163.html">http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07163.html</a>. No way too lazy:) I log it here myself:) <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=247046#c25">bug 247046 comment 25</a> must be one of ways. After PE resource hacker check, java exe DO not contains the theme manifest. I dep into the swt.internal.OS class, and found just pass the module self to CreateActCtx, it's works fine. Of cause I not rebuild my swt dll. To test, just copy the code to one snippet startup. Now running swt with jdk7, who is theme backs. The result is,even if JDK not provide the theme manifest, no matter. int /* long */hModule = OS.GetLibraryHandle(); ACTCTX pActCtx = new ACTCTX(); pActCtx.cbSize = ACTCTX.sizeof; //ACTCTX_FLAG_HMODULE_VALID 128 0x080 pActCtx.dwFlags = OS.ACTCTX_FLAG_RESOURCE_NAME_VALID | 0x80; pActCtx.lpResourceName = OS.MANIFEST_RESOURCE_ID; pActCtx.hModule = hModule; int /* long */hActCtx = OS.CreateActCtx(pActCtx); //if (hActCtx == -1) { // System.out.println("Failed: " + OS.GetLastError()); // At here if module should not error //} int /* long */[] lpCookie = new int /* long */[1]; OS.ActivateActCtx(hActCtx, lpCookie); Maybe swt.internal.OS could use this code as default. (In reply to comment #5) Ha:) maybe I should do some homework for bugzzzzzla:-) more clean text: I post message at http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07163.html. No way too lazy:) I log it here myself:) https://bugs.eclipse.org/bugs/show_bug.cgi?id=247046#c25 must be one of ways. After PE resource hacker check, java exe DO not contains the theme manifest. I dep into the swt.internal.OS class, and found just pass the module self to CreateActCtx, it's works fine. Of cause I not rebuild my swt dll. To test, just copy the code to one snippet startup. Now running swt with jdk7, who is theme backs. The result is,even if JDK not provide the theme manifest, no matter. int /* long */hModule = OS.GetLibraryHandle(); ACTCTX pActCtx = new ACTCTX(); pActCtx.cbSize = ACTCTX.sizeof; //ACTCTX_FLAG_HMODULE_VALID 128 0x080 pActCtx.dwFlags = OS.ACTCTX_FLAG_RESOURCE_NAME_VALID | 0x80; pActCtx.lpResourceName = OS.MANIFEST_RESOURCE_ID; pActCtx.hModule = hModule; int /* long */hActCtx = OS.CreateActCtx(pActCtx); //if (hActCtx == -1) { // System.out.println("Failed: " + OS.GetLastError()); // At here if module should not error //} int /* long */[] lpCookie = new int /* long */[1]; OS.ActivateActCtx(hActCtx, lpCookie); Maybe swt.internal.OS could use this code as default. Thank you for your help. But if you remove the ACTCTX_FLAG_SET_PROCESS_DEFAULT flag you will re-introduce this crash bug 150782. (In reply to comment #7) > Thank you for your help. > But if you remove the ACTCTX_FLAG_SET_PROCESS_DEFAULT flag you will > re-introduce this crash bug 150782. We are welcome:) Ooops, bug 150782, I really not know about it. This point, can take back my word about replace. Origin, I mean, just add the code after OS.createActCtx invocation, If the result==-1 then use module self create again. looks the origin should better:) BTW my test base on the swt.internal.OS.createActCxt code execution, then it go ahead. so addition:) should work fine. Created attachment 183897 [details]
Test for addition to manifest creation
I check out 150782, just run the cash case with addition code.
Seems it works fine with right theme.
In the code,
1) added a button to check out running effect.
2) addition creation manifest context in main.
Seems to be fixed with recent versions of Java 7 (e.g. 1.7.0-ea-b128, 32-bit). Tested HEAD and 3.6.1, and both are looking good now. *** Bug 346531 has been marked as a duplicate of this bug. *** |