Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327476 - No aero style with JDK 7
Summary: No aero style with JDK 7
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 346531 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-11 13:28 EDT by Stefan Krause CLA
Modified: 2011-05-20 07:02 EDT (History)
12 users (show)

See Also:


Attachments
Test for addition to manifest creation (2.12 KB, application/octet-stream)
2010-11-25 19:06 EST, Xiang Qinxian CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Krause CLA 2010-10-11 13:28:15 EDT
When I run eclipse (eclipse-java-helios-SR1-win32-x86_64) with jdk 6 on my windows 7 all widgets render in the expected aero style. If I use jdk 7 (e.g. b113) all widgets show up in the old fashioned windows 2000 look.

I tried adding a javaw.exe.manifest to java\bin and jre\bin, but unless I've done wrong it had no effect.

All this has been tested with the 64 bit versions of windows, eclipse and jdk 6/7.
Comment 1 Remy Suen CLA 2010-10-11 14:12:26 EDT
Sounds like what someone mentioned on the mailing list.
http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07140.html
Comment 2 Lakshmi P Shanmugam CLA 2010-10-12 01:00:59 EDT
I ran eclipse with jdk7 on windows XP, I too get windows classic look.
Comment 3 Grant Gayed CLA 2010-10-12 10:49:49 EDT
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.
Comment 4 Felipe Heidrich CLA 2010-10-19 10:36:21 EDT
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.
Comment 5 Xiang Qinxian CLA 2010-11-24 22:06:26 EST
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.
Comment 6 Xiang Qinxian CLA 2010-11-24 22:10:36 EST
(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.
Comment 7 Felipe Heidrich CLA 2010-11-25 11:01:14 EST
Thank you for your help. 
But if you remove the ACTCTX_FLAG_SET_PROCESS_DEFAULT flag you will re-introduce this crash bug 150782.
Comment 8 Xiang Qinxian CLA 2010-11-25 18:50:22 EST
(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.
Comment 9 Xiang Qinxian CLA 2010-11-25 19:06:22 EST
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.
Comment 10 Markus Keller CLA 2011-02-16 13:01:49 EST
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.
Comment 11 Markus Keller CLA 2011-05-20 07:02:48 EDT
*** Bug 346531 has been marked as a duplicate of this bug. ***