Module: wine
Branch: master
Commit: 4311a993ddddbafab475e2c523d51722d7ce9810
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4311a993ddddbafab475e2c5…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com>
Date: Tue Jan 25 16:00:17 2022 +0800
uxtheme: Search TMT_IMAGEFILE1~7 first when drawing background for parts without glyph images.
Try TMT_IMAGEFILE first when drawing part background and the part contains glyph images.
Otherwise, search TMT_IMAGEFILE1~7 and then TMT_IMAGEFILE or TMT_GLYPHIMAGEFILE. This behavior can
be verified by drawing scroll bar arrow buttons, where TMT_IMAGEFILE is used for background despite
TMT_IMAGEFILE1 being present and TMT_IMAGEFILE1 is used for glyphs despite TMT_IMAGEFILE is present.
For parts without glyph images, TMT_IMAGEFILE1~7 are always searched first, then try TMT_IMAGEFILE
or TMT_GLYPHIMAGEFILE.
Fix the size grip on status control not being painted when using builtin Light theme. The status
gripper part uses TMT_IMAGEFILE1~7 and doesn't have TMT_IMAGEFILE. So when UXTHEME_SelectImage()
tries to query TMT_IMAGEFILE for status gripper, it falls back to using status class TMT_IMAGEFILE.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/uxtheme/draw.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index 4aac46f3fed..709cf522d00 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -185,20 +185,23 @@ static int imagefile_index_to_property(int index)
static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, int iPartId, int iStateId,
const RECT *pRect, BOOL glyph, int *imageDpi)
{
- PTHEME_PROPERTY tp;
- int imageselecttype = IST_NONE;
+ int imageselecttype = IST_NONE, glyphtype = GT_NONE;
+ PTHEME_PROPERTY tp = NULL;
int i;
- int image;
- if(glyph)
- image = TMT_GLYPHIMAGEFILE;
- else
- image = TMT_IMAGEFILE;
if (imageDpi)
*imageDpi = 96;
- if((tp=MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, image)))
- return tp;
+ /* Try TMT_IMAGEFILE first when drawing part background and the part contains glyph images.
+ * Otherwise, search TMT_IMAGEFILE1~7 and then TMT_IMAGEFILE or TMT_GLYPHIMAGEFILE */
+ if (!glyph)
+ {
+ GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_GLYPHTYPE, &glyphtype);
+ if (glyphtype == GT_IMAGEGLYPH &&
+ (tp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE)))
+ return tp;
+ }
+
GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_IMAGESELECTTYPE, &imageselecttype);
if(imageselecttype == IST_DPI) {
@@ -223,7 +226,7 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, int iPartId, int iStat
}
}
/* If an image couldn't be selected, choose the first one */
- return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE1);
+ tp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE1);
}
else if(imageselecttype == IST_SIZE) {
POINT size = {pRect->right-pRect->left, pRect->bottom-pRect->top};
@@ -270,9 +273,13 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, int iPartId, int iStat
}
}
/* If an image couldn't be selected, choose the smallest one */
- return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE1);
+ tp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE1);
}
- return NULL;
+
+ if (!tp)
+ tp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME,
+ glyph ? TMT_GLYPHIMAGEFILE : TMT_IMAGEFILE);
+ return tp;
}
/***********************************************************************
Module: tools
Branch: master
Commit: 1f35a8d3ba4d9f2497357fae156b0db037a2f54f
URL: https://source.winehq.org/git/tools.git/?a=commit;h=1f35a8d3ba4d9f2497357fa…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Jan 25 16:48:49 2022 +0100
testbot/SetWinLocale: Add more information to the usage message.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/SetWinLocale | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index 0b034b7..42a106b 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -452,12 +452,16 @@ if (defined $Usage)
print " . APIs: GetUserGeoID().\n";
print " . Powershell: Set-WinHomeLocation -GeoId CTY-ID\n";
print " --system SYS Specifies the system locale (see --defaults).\n";
+ print " . This requires elevated privileges.\n";
print " . Only takes effect after a reboot.\n";
print " . Windows 10 GUI: Time & language -> Language ->\n";
print " Administrative Language Settings -> Change system locale.\n";
print " . APIs: GetSystemDefaultLCID(), GetThreadLocale().\n";
print " . Powershell: Set-WinSystemLocale -SystemLocale SYS\n";
print " --utf8 Set the code pages (ACP, MACCP and OEMCP) to UTF-8.\n";
+ print " . This requires elevated privileges.\n";
+ print " . Only supported on Windows 10+. This will render older Windows\n";
+ print " versions unbootable.\n";
print " . Windows 10 GUI: Time & language -> Language ->\n";
print " Administrative Language Settings -> Change system locale ->\n";
print " Beta: Use Unicode UTF-8 for worldwide language support.\n";
@@ -475,8 +479,9 @@ if (defined $Usage)
print " . Windows 10 GUI: Time & language -> Language -> Keyboard ->\n";
print " Override for default input method.\n";
print " . Powershell: Set-WinDefaultInputMethodOverride -InputTip KBD-ID\n";
- print " --no-reboot Do not reboot Windows. Some locale changes will only take\n";
- print " effect after the next reboot.\n";
+ print " --no-reboot Do not reboot Windows. Some locale changes only take effect\n";
+ print " after a reboot so this option should only be used for\n";
+ print " debugging.\n";
print " --debug Show more detailed information about progress.\n";
print " --help Shows this usage message.\n";
exit 0;