Closed Bug 719983 Opened 13 years ago Closed 13 years ago

Replace uses of nsUXThemeData::sIsVistaOrLater with WinUtils version routines

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: jimm, Assigned: jimm)

References

Details

Attachments

(1 file, 6 obsolete files)

We could add a new method to WinUtils to support checking for great than (WinVersion) to do this.

http://mxr.mozilla.org/mozilla-central/search?string=sIsVistaOrLater
Assignee: nobody → jmathies
Blocks: 373266
Attached patch winutils v.1 (obsolete) — Splinter Review
Attached patch winutils v.1 (obsolete) — Splinter Review
I like the idea of centralizing this. The calls feel a little overly verbose though.
Attachment #590353 - Attachment is obsolete: true
Attachment #590760 - Flags: feedback?(neil)
I don't see much point in these when you can just write
if (GetWindowsVersion() >= VISTA_VERSION)

The only other idea I had was to provide NO_MINIMUM and NO_MAXIMUM enumeration constants for use with WindowsVersionWithinRange() i.e.
if (WindowsVersionWithinRange(VISTA_VERSION, NO_MAXIMUM))
Comment on attachment 590760 [details] [diff] [review]
winutils v.1

(In reply to neil@parkwaycc.co.uk from comment #3)
> I don't see much point in these when you can just write
> if (GetWindowsVersion() >= VISTA_VERSION)
> 
> The only other idea I had was to provide NO_MINIMUM and NO_MAXIMUM
> enumeration constants for use with WindowsVersionWithinRange() i.e.
> if (WindowsVersionWithinRange(VISTA_VERSION, NO_MAXIMUM))

Yeah, I started implementing the sIsVistaOrLater removal code with these and decided they were overkill.
Attachment #590760 - Attachment is obsolete: true
Attachment #590760 - Flags: feedback?(neil)
Attached patch patch (obsolete) — Splinter Review
1. My understanding is that we will shortly be dropping W2K support, so maybe you should hold off until that is done or just incorporate those changes.
2. It looks confusing to have the negation of version >= VISTA be version <= XP but with the dropping of W2K perhaps you should go with != XP or == XP?
(In reply to neil@parkwaycc.co.uk from comment #6)
> 1. My understanding is that we will shortly be dropping W2K support, so
> maybe you should hold off until that is done or just incorporate those
> changes.
> 2. It looks confusing to have the negation of version >= VISTA be version <=
> XP but with the dropping of W2K perhaps you should go with != XP or == XP?

Is there a bug on stripping out 2K specific code? I think something like that recently passed through my inbox, but now can't find it.
Found it - bug 699247
Depends on: 699247
Attached patch patch (obsolete) — Splinter Review
Updated to the latest in bug 699247, and I changed <=/>= vista checks to xp checks.
Attachment #591114 - Attachment is obsolete: true
Attachment #595282 - Attachment is patch: true
Attached patch patch (obsolete) — Splinter Review
Missed a few.
Attachment #595282 - Attachment is obsolete: true
<= XP and > XP (or < VISTA and >= VISTA) would be better than == XP and != XP unless we ensure that Firefox will never run under Compatibility Mode somehow.
<= XP and > XP was obviously wrong because Win2k3 would be identified as "Vista or later". It must be < VISTA and >= VISTA.
(In reply to Masatoshi Kimura [:emk] from comment #11)
> <= XP and > XP (or < VISTA and >= VISTA) would be better than == XP and !=
> XP unless we ensure that Firefox will never run under Compatibility Mode
> somehow.

Ive never understood why people would do this, is there some reasonable utilitarian reason to turn this on for fx?
(In reply to Masatoshi Kimura [:emk] from comment #12)
> <= XP and > XP was obviously wrong because Win2k3 would be identified as
> "Vista or later". It must be < VISTA and >= VISTA.

Hmm, good catch, sVistaOrLater was: |version >= WinUtils::VISTA_VERSION| so I guess I will have to change these back.
Attached patch patch (obsolete) — Splinter Review
Attachment #595283 - Attachment is obsolete: true
Attached patch patchSplinter Review
Fix incorrect test in nsWindow::InitMouseWheelScrollData(). This should do it.
Attachment #595372 - Attachment is obsolete: true
Attachment #595374 - Flags: review?(neil)
Comment on attachment 595374 [details] [diff] [review]
patch

>     case NS_THEME_TOOLTIP:
>-      // BUG #161600: XP/2K3 should force a classic treatment of tooltips
>-      return nsUXThemeData::sIsVistaOrLater ? nsUXThemeData::GetTheme(eUXTooltip) : NULL;
>+      // XP should force a classic treatment of tooltips
>+      return WinUtils::GetWindowsVersion() <  WinUtils::VISTA_VERSION ?
>+        NULL : nsUXThemeData::GetTheme(eUXTooltip);
Why the comment change? Also, a double space crept in after the <, and the indentation on the various wrapped ?:s looks wrong but I don't know what correct style would be.
Attachment #595374 - Flags: review?(neil) → review+
(In reply to neil@parkwaycc.co.uk from comment #17)
> Comment on attachment 595374 [details] [diff] [review]
> patch
> 
> >     case NS_THEME_TOOLTIP:
> >-      // BUG #161600: XP/2K3 should force a classic treatment of tooltips
> >-      return nsUXThemeData::sIsVistaOrLater ? nsUXThemeData::GetTheme(eUXTooltip) : NULL;
> >+      // XP should force a classic treatment of tooltips
> >+      return WinUtils::GetWindowsVersion() <  WinUtils::VISTA_VERSION ?
> >+        NULL : nsUXThemeData::GetTheme(eUXTooltip);
> Why the comment change? Also, a double space crept in after the <, and the
> indentation on the various wrapped ?:s looks wrong but I don't know what
> correct style would be.

I put the 2K3 back in, but left the bug number out, we have blame for that.

Not sure about the wrapping - looks ok to me.
Backed out of inbound along with bug 699247 at Jim's request, until the cause of a 30% WinXP Ts regression (https://groups.google.com/d/topic/mozilla.dev.tree-management/_yUe9mobQHA) is known.

https://hg.mozilla.org/integration/mozilla-inbound/rev/07da69ba7e52
Try run for e63463016916 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=e63463016916
Results (out of 17 total builds):
    success: 17
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/jmathies@mozilla.com-e63463016916
This will reland after the perf issues with bug 699247 get fixed.
https://hg.mozilla.org/integration/mozilla-inbound/rev/ffd20a1557e0

Went ahead and cleaned this up for landing.
https://hg.mozilla.org/mozilla-central/rev/ffd20a1557e0
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: