-
Notifications
You must be signed in to change notification settings - Fork 164
[win32][arm64] Support Dark Theme on newer Windows builds #1172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[win32][arm64] Support Dark Theme on newer Windows builds #1172
Conversation
Thanks for your quick work! I now have the dark scrollbars again in my Arm64 box. Here are how I test it:
The above
and the
and the test program shows correct dark scrollbars in its window: For comparison, here's the same window (with lighted scrollbars) before this fix: |
Further more, I've built the complete Eclipse SDK with this fix, from my aggregator fork, and here's its main window showing nicely dark scrollbars on my Arm64 box: In previous builds before this fix, it was showing lighted scrollbars, which alerted me to the changed |
3b8abbf
to
5c7ff48
Compare
@niraj-modi or @SyntevoAlex could you please review this? I have no clue about the native code and no way to test it. |
The new test looks quite weak to me, because I suggest that instead both offsets |
@SyntevoAlex ah good idea. I'll work on that tomorrow :) |
5c7ff48
to
f48138b
Compare
@chirontt can you try with the latest changes? I changed the title of the PR too |
It would be nice to also have code comments with Windows versions, like here: eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c Lines 124 to 138 in 1a35d6e
|
^ this is just a suggestion, I will still approve without it. |
I don't have the old versions. @chirontt Can you find me the Windows builds before and after the original PR stopped working? |
I'm not quite sure I follow you here. It's not the Eclipse build that stops working; it's the recent (last month's) Windows Arm64 update that causes the problem due to changes in the You can grab the latest build of the Eclipse SDK here especially the WoA zip package. Just unzip it and run the Eclipse IDE, put it in dark mode and you'll see the lighted scrollbars in the IDE. This latest build contains your original commit for the To see if/how it works before, you need to restore your WoA box to before the current (last month's) Windows update, and test it with the same Eclipse SDK mentioned above. You'd see the dark scrollbars as intended. |
I've tried the same steps as in my previous comment, and the scrollbars are still properly in dark mode, with your latest fix. Here's the screenshot of the |
@chirontt Just to clarify:
If yes, please run |
Yes.
Yes.
|
@hmartinez82 to clarify, I'm waiting for you. @chirontt already got the version numbers, see above. |
Please squash commits (because separating them does not convey any additional value here), you can use PR title as commit message. Then it can be merged. |
d2baf6d
to
18bafe0
Compare
@SyntevoAlex , @hmartinez82 Sorry to sound like a broken record again, but the new Windows update this week (last Tuesday, to be precise) breaks this
and running the I've checked the file date of
|
The argument changed again, it's
I think that chasing this value is not a good idea. It keeps changing, it seems very unstable across builds of uxtheme.dll. The line above, which deals with the global value has been stable across all the changes we've seen so far. The code detection for Intel is doing exactly that. See eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c Line 233 in a39c321
What if I do what I did originally ? And also add a test for the location of the |
18bafe0
to
3eddacb
Compare
@chirontt Try with the change from 1 min ago. |
Yes, it works now, i.e. the scrollbars are now dark: |
3eddacb
to
8f418fe
Compare
This is not right, it checks a lot more: it checks that two instructions mention the SAME global variable. eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c Lines 227 to 230 in a39c321
|
Given the three disassembles we've seen so far, what do you recommend?
|
Here's the diff
|
It can be seen that only a few bytes in the function change. The rest can be verified. |
Ok. I'll add a check for the location of the |
Not sure what you mean. To me, it makes sense to validate this part
Where also |
8f418fe
to
373e5a9
Compare
@chirontt Can you give it a try with this latest change? |
373e5a9
to
9255e89
Compare
9255e89
to
a0c4d79
Compare
It's still working good, i.e. the scrollbars in WoA are still dark: |
In master now, thanks for your contribution. |
Thanks @SyntevoAlex , @hmartinez82 for this update. I hope this will keep things smooth for now, until MS decides to spoil the party again. But I notice that tonight's I-build doesn't contain a recompile of the SWT natives due to this merge. @HannesWell does the automated recompile process require a version increment in order to trigger it? |
Thank you @SyntevoAlex for your help.
No that's not necessary, the build just timed-out/failed. Probably due to heavy load on the build servers due to I-build tests. |
Actually the problem is that the rie8t-win11-arm64 node is offline in the RelEng Jenkins instance and that node is used to compile the binaries for win32.aarch64. Created an help-desk issue: |
The node is back online and the master build passed before this noon's I-build so it should contain the recompiled binaries: |
Continues #1048 #1045
Here's the disassembly:
The
add x0,x8,
instruction changed its parameter. So now theadrp x8,...
instruction looks more stable because it uses a global variable (Using a global variable is also what is done when validating for the Intel x64 uxtheme.dll)See https://developer.arm.com/documentation/ddi0602/2024-03/Base-Instructions/ADRP--Form-PC-relative-address-to-4KB-page-
functionPtr[0x10] & 0x1F) == 0x08
checks that the destination register isx8
(functionPtr[0x13] & 0x90) == 0x90
checks that the opcode is ADRP