winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2024
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
613 discussions
Start a n
N
ew thread
Rémi Bernon : winemac: Merge RESET_DEVICE_METRICS and DISPLAYCHANGE internal messages.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: d49cf1021b88278fd4c37e53474f284027594724 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d49cf1021b88278fd4c37e53474f28…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 10:41:19 2024 +0200 winemac: Merge RESET_DEVICE_METRICS and DISPLAYCHANGE internal messages. --- dlls/winemac.drv/macdrv.h | 1 - dlls/winemac.drv/window.c | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index a7905050f16..ab5b9a2667b 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -95,7 +95,6 @@ extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp); enum macdrv_window_messages { WM_MACDRV_SET_WIN_REGION = WM_WINE_FIRST_DRIVER_MSG, - WM_MACDRV_RESET_DEVICE_METRICS, WM_MACDRV_DISPLAYCHANGE, WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS, }; diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 84668b44c51..35cf9255279 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1586,8 +1586,6 @@ void macdrv_resize_desktop(void) if (!NtUserGetWindowRect(hwnd, ¤t_desktop_rect) || !CGRectEqualToRect(cgrect_from_rect(current_desktop_rect), new_desktop_rect)) { - send_message_timeout(HWND_BROADCAST, WM_MACDRV_RESET_DEVICE_METRICS, 0, 0, - SMTO_ABORTIFHUNG, 2000, NULL); NtUserSetWindowPos(hwnd, 0, CGRectGetMinX(new_desktop_rect), CGRectGetMinY(new_desktop_rect), CGRectGetWidth(new_desktop_rect), CGRectGetHeight(new_desktop_rect), SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE); @@ -2020,10 +2018,8 @@ LRESULT macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) release_win_data(data); } return 0; - case WM_MACDRV_RESET_DEVICE_METRICS: - macdrv_reset_device_metrics(); - return 0; case WM_MACDRV_DISPLAYCHANGE: + macdrv_reset_device_metrics(); macdrv_reassert_window_position(hwnd); return 0; case WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS:
1
0
0
0
Jacek Caban : mshtml: Use DispatchEx for exposing document node IDispatchEx interface.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: 7cb0b66eb759210595f9071716a5dc3c536cd1b2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7cb0b66eb759210595f9071716a5dc…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 30 03:14:41 2024 +0200 mshtml: Use DispatchEx for exposing document node IDispatchEx interface. --- dlls/mshtml/htmldoc.c | 86 -------------------------------------------- dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/oleobj.c | 64 ++++++++++++++++++++++++--------- 3 files changed, 48 insertions(+), 103 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 9666f7821af..9aa0cefc21d 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -4537,11 +4537,6 @@ static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = { SupportErrorInfo_InterfaceSupportsErrorInfo }; -static inline HTMLDocumentNode *impl_from_IDispatchEx(IDispatchEx *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocumentNode, IDispatchEx_iface); -} - static HRESULT has_elem_name(nsIDOMHTMLDocument *html_document, const WCHAR *name) { static const WCHAR fmt[] = L":-moz-any(applet,embed,form,iframe,img,object)[name=\"%s\"]"; @@ -4642,84 +4637,6 @@ static HRESULT dispid_from_elem_name(HTMLDocumentNode *This, const WCHAR *name, return S_OK; } -DISPEX_IDISPATCH_IMPL(DocDispatchEx, IDispatchEx, - impl_from_IDispatchEx(iface)->node.event_target.dispex) - -static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex, pid); -} - -static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, - VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_InvokeEx(&This->node.event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); -} - -static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_DeleteMemberByName(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex); -} - -static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_DeleteMemberByDispID(&This->node.event_target.dispex.IDispatchEx_iface, id); -} - -static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetMemberProperties(&This->node.event_target.dispex.IDispatchEx_iface, id, grfdexFetch, pgrfdex); -} - -static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetMemberName(&This->node.event_target.dispex.IDispatchEx_iface, id, pbstrName); -} - -static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetNextDispID(&This->node.event_target.dispex.IDispatchEx_iface, grfdex, id, pid); -} - -static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetNameSpaceParent(&This->node.event_target.dispex.IDispatchEx_iface, ppunk); -} - -static const IDispatchExVtbl DocDispatchExVtbl = { - DocDispatchEx_QueryInterface, - DocDispatchEx_AddRef, - DocDispatchEx_Release, - DocDispatchEx_GetTypeInfoCount, - DocDispatchEx_GetTypeInfo, - DocDispatchEx_GetIDsOfNames, - DocDispatchEx_Invoke, - DocDispatchEx_GetDispID, - DocDispatchEx_InvokeEx, - DocDispatchEx_DeleteMemberByName, - DocDispatchEx_DeleteMemberByDispID, - DocDispatchEx_GetMemberProperties, - DocDispatchEx_GetMemberName, - DocDispatchEx_GetNextDispID, - DocDispatchEx_GetNameSpaceParent -}; - static inline HTMLDocumentNode *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) { return CONTAINING_RECORD(iface, HTMLDocumentNode, IProvideMultipleClassInfo_iface); @@ -5255,8 +5172,6 @@ static void *HTMLDocumentNode_query_interface(DispatchEx *dispex, REFIID riid) { HTMLDocumentNode *This = impl_from_DispatchEx(dispex); - if(IsEqualGUID(&IID_IDispatch, riid) || IsEqualGUID(&IID_IDispatchEx, riid)) - return &This->IDispatchEx_iface; if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) return &This->IHTMLDocument2_iface; if(IsEqualGUID(&IID_IHTMLDocument3, riid)) @@ -5748,7 +5663,6 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo if(!doc) return NULL; - doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e8e308a81f4..4b2cffd0f54 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -953,7 +953,6 @@ typedef struct nsDocumentEventListener nsDocumentEventListener; struct HTMLDocumentNode { HTMLDOMNode node; - IDispatchEx IDispatchEx_iface; IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 36ff99338e3..cd09117645d 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -3535,35 +3535,67 @@ static inline HTMLDocumentObj *impl_from_IDispatchEx(IDispatchEx *iface) } HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(DispatchEx) -HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, GetTypeInfoCount, UINT*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetTypeInfo, UINT,LCID,ITypeInfo**) -HTMLDOCUMENTOBJ_FWD_TO_NODE_5(DispatchEx, GetIDsOfNames, REFIID,LPOLESTR*,UINT,LCID,DISPID*) +DISPEX_IDISPATCH_NOUNK_IMPL(DocObjDispatchEx, IDispatchEx, + impl_from_IDispatchEx(iface)->doc_node->node.event_target.dispex) -static HRESULT WINAPI DocObjDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, - WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI DocObjDispatchEx_GetDispID(IDispatchEx *iface, BSTR name, DWORD grfdex, DISPID *pid) { HTMLDocumentObj *This = impl_from_IDispatchEx(iface); - return IDispatchEx_InvokeEx(&This->doc_node->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, - pVarResult, pExcepInfo, NULL); + return IDispatchEx_GetDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, name, grfdex, pid); } -HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetDispID, BSTR,DWORD,DISPID*) - static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { HTMLDocumentObj *This = impl_from_IDispatchEx(iface); - return IDispatchEx_InvokeEx(&This->doc_node->IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return IDispatchEx_InvokeEx(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, lcid, + wFlags, pdp, pvarRes, pei, pspCaller); +} + +static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_DeleteMemberByName(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex); +} + +static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_DeleteMemberByDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id); +} + +static HRESULT WINAPI DocObjDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetMemberProperties(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, grfdexFetch, + pgrfdex); +} + +static HRESULT WINAPI DocObjDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *name) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetMemberName(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, name); } -HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DispatchEx, DeleteMemberByName, BSTR,DWORD) -HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, DeleteMemberByDispID, DISPID) -HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetMemberProperties, DISPID,DWORD,DWORD*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DispatchEx, GetMemberName, DISPID,BSTR*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetNextDispID, DWORD,DISPID,DISPID*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, GetNameSpaceParent, IUnknown**) +static HRESULT WINAPI DocObjDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetNextDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, grfdex, id, pid); +} + +static HRESULT WINAPI DocObjDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetNameSpaceParent(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, ppunk); +} static const IDispatchExVtbl DocObjDispatchExVtbl = { DocObjDispatchEx_QueryInterface,
1
0
0
0
Jacek Caban : mshtml: Use DISPEX_IDISPATCH_IMPL macro for document object implementation.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: 085670607146c9a5d82f1c71d02cf9e8213a6db4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/085670607146c9a5d82f1c71d02cf9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 30 02:54:25 2024 +0200 mshtml: Use DISPEX_IDISPATCH_IMPL macro for document object implementation. --- dlls/mshtml/htmldoc.c | 499 ++------------------------------------------------ 1 file changed, 20 insertions(+), 479 deletions(-)
1
0
0
0
Jacek Caban : mshtml: Use DispatchEx for document node InvokeEx implementation.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: 88a06f18b467a31d96ab5b9c816cf3ee3b2bb2f2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/88a06f18b467a31d96ab5b9c816cf3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 30 03:03:11 2024 +0200 mshtml: Use DispatchEx for document node InvokeEx implementation. --- dlls/mshtml/dispex.c | 6 ++++++ dlls/mshtml/htmldoc.c | 41 +++++++++++++++++++++++++---------------- dlls/mshtml/mshtml_private.h | 3 +++ dlls/mshtml/tests/htmldoc.c | 23 +++++++++++++++++++++++ 4 files changed, 57 insertions(+), 16 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 152d2d4cb66..9c0e9a0b9ec 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -1725,6 +1725,12 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc if(wFlags == (DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF)) wFlags = DISPATCH_PROPERTYPUT; + if(This->info->desc->vtbl->disp_invoke) { + hres = This->info->desc->vtbl->disp_invoke(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + if(hres != S_FALSE) + return hres; + } + switch(get_dispid_type(id)) { case DISPEXPROP_CUSTOM: if(!This->info->desc->vtbl->invoke) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 41fdffd55e7..8575ff69dcf 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5066,22 +5066,6 @@ static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID { HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - if(This->window) { - switch(id) { - case DISPID_READYSTATE: - TRACE("DISPID_READYSTATE\n"); - - if(!(wFlags & DISPATCH_PROPERTYGET)) - return E_INVALIDARG; - - V_VT(pvarRes) = VT_I4; - V_I4(pvarRes) = This->window->base.outer_window->readystate; - return S_OK; - default: - break; - } - } - return IDispatchEx_InvokeEx(&This->node.event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); } @@ -5939,6 +5923,30 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid, return S_OK; } +static HRESULT HTMLDocumentNode_disp_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + HTMLDocumentNode *This = impl_from_DispatchEx(dispex); + + if(This->window) { + switch(id) { + case DISPID_READYSTATE: + TRACE("DISPID_READYSTATE\n"); + + if(!(flags & DISPATCH_PROPERTYGET)) + return E_INVALIDARG; + + V_VT(res) = VT_I4; + V_I4(res) = This->window->base.outer_window->readystate; + return S_OK; + default: + break; + } + } + + return S_FALSE; +} + static HRESULT HTMLDocumentNode_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pid) { DWORD idx = (id == DISPID_STARTENUM) ? 0 : id - MSHTML_DISPID_CUSTOM_MIN + 1; @@ -6111,6 +6119,7 @@ static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = { .get_dispid = HTMLDocumentNode_get_dispid, .find_dispid = HTMLDocumentNode_find_dispid, .invoke = HTMLDocumentNode_invoke, + .disp_invoke = HTMLDocumentNode_disp_invoke, .next_dispid = HTMLDocumentNode_next_dispid, .get_compat_mode = HTMLDocumentNode_get_compat_mode, }, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 4653da1fdbb..e8e308a81f4 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -383,6 +383,9 @@ typedef struct { HRESULT (*delete)(DispatchEx*,DISPID); HRESULT (*next_dispid)(DispatchEx*,DISPID,DISPID*); + /* Similar to invoke, but allows overriding all dispids */ + HRESULT (*disp_invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); + /* Used by objects that want to delay their compat mode initialization until actually needed */ compat_mode_t (*get_compat_mode)(DispatchEx*); diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index f41d5749b3b..ad2544f189a 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -5681,6 +5681,29 @@ static void _test_readyState(unsigned line, IUnknown *unk) ok_(__FILE__,line) (V_VT(&out) == VT_I4, "V_VT(out)=%d\n", V_VT(&out)); ok_(__FILE__,line) (V_I4(&out) == load_state%5, "VT_I4(out)=%ld, expected %d\n", V_I4(&out), load_state%5); + /* check on document node too */ + if(load_state == LD_COMPLETE) { + IHTMLDocument2 *doc_node; + IHTMLWindow2 *window; + + hres = IHTMLDocument2_get_parentWindow(htmldoc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + + VariantInit(&out); + hres = IHTMLDocument2_Invoke(doc_node, DISPID_READYSTATE, &IID_NULL, 0, DISPATCH_PROPERTYGET, + &dispparams, &out, NULL, NULL); + ok(hres == S_OK, "Invoke(DISPID_READYSTATE) failed: %08lx\n", hres); + + ok_(__FILE__,line) (V_VT(&out) == VT_I4, "V_VT(out)=%d\n", V_VT(&out)); + ok_(__FILE__,line) (V_I4(&out) == load_state%5, "VT_I4(out)=%ld, expected %d\n", V_I4(&out), load_state%5); + + IHTMLDocument2_Release(doc_node); + IHTMLWindow2_Release(window); + } + test_doscroll((IUnknown*)htmldoc); IHTMLDocument2_Release(htmldoc);
1
0
0
0
Jacek Caban : mshtml: Use DispatchEx vtbl for document node GetDispID implementation.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: af86139fa4d3c58226858d4acdd01c7be9945ad1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/af86139fa4d3c58226858d4acdd01c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 30 02:48:37 2024 +0200 mshtml: Use DispatchEx vtbl for document node GetDispID implementation. --- dlls/mshtml/htmldoc.c | 45 +++++++++++++++++++++++++++------------ dlls/mshtml/tests/documentmode.js | 1 - 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index c24bf6b6b6d..41fdffd55e7 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5057,21 +5057,8 @@ static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMemb static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - HRESULT hres; - - hres = IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex & ~fdexNameEnsure, pid); - if(hres != DISP_E_UNKNOWNNAME) - return hres; - - if(This->html_document) { - hres = get_elem_by_name_or_id(This->html_document, bstrName, NULL); - if(SUCCEEDED(hres)) - hres = dispid_from_elem_name(This, bstrName, pid); - } - if(hres == DISP_E_UNKNOWNNAME && (grfdex & fdexNameEnsure)) - hres = dispex_get_dynid(&This->node.event_target.dispex, bstrName, FALSE, pid); - return hres; + return IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex, pid); } static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, @@ -5891,6 +5878,34 @@ static HRESULT HTMLDocumentNode_get_name(DispatchEx *dispex, DISPID id, BSTR *na return (*name = SysAllocString(This->elem_vars[idx])) ? S_OK : E_OUTOFMEMORY; } +static HRESULT HTMLDocumentNode_get_dispid(DispatchEx *dispex, BSTR name, DWORD grfdex, DISPID *dispid) +{ + HTMLDocumentNode *This = impl_from_DispatchEx(dispex); + HRESULT hres = DISP_E_UNKNOWNNAME; + + if(This->html_document && dispex_compat_mode(&This->node.event_target.dispex) < COMPAT_MODE_IE9) { + hres = get_elem_by_name_or_id(This->html_document, name, NULL); + if(SUCCEEDED(hres)) + hres = dispid_from_elem_name(This, name, dispid); + } + + return hres; +} + +static HRESULT HTMLDocumentNode_find_dispid(DispatchEx *dispex, BSTR name, DWORD grfdex, DISPID *dispid) +{ + HTMLDocumentNode *This = impl_from_DispatchEx(dispex); + HRESULT hres = DISP_E_UNKNOWNNAME; + + if(This->html_document && dispex_compat_mode(&This->node.event_target.dispex) >= COMPAT_MODE_IE9) { + hres = get_elem_by_name_or_id(This->html_document, name, NULL); + if(SUCCEEDED(hres)) + hres = dispid_from_elem_name(This, name, dispid); + } + + return hres; +} + static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -6093,6 +6108,8 @@ static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = { .traverse = HTMLDocumentNode_traverse, .unlink = HTMLDocumentNode_unlink, .get_name = HTMLDocumentNode_get_name, + .get_dispid = HTMLDocumentNode_get_dispid, + .find_dispid = HTMLDocumentNode_find_dispid, .invoke = HTMLDocumentNode_invoke, .next_dispid = HTMLDocumentNode_next_dispid, .get_compat_mode = HTMLDocumentNode_get_compat_mode, diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 2eed3bb1aff..23fd2128e5f 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -955,7 +955,6 @@ sync_test("elem_by_id", function() { document.body.innerHTML = '<form id="testid2" name="testname"></form>'; ok(window.testid2 == 1, "window.testid2 = " + window.testid2); id_elem = document.body.firstChild; - todo_wine_if(v < 9). ok(document.testid2 == (v < 9 ? id_elem : 2), "document.testid2 = " + document.testid2); document.body.innerHTML = ''; ok(window.testid2 == 1, "window.testid2 = " + window.testid2);
1
0
0
0
Elizabeth Figura : wined3d: Update multisample state when the sample count changes.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: fd904eb19c82cccd91f02d2308415d6ffd6e8c39 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fd904eb19c82cccd91f02d2308415d…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Fri May 31 17:02:43 2024 -0500 wined3d: Update multisample state when the sample count changes. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56591
--- dlls/wined3d/context_vk.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index 200dcb57b7f..9147a222b9d 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -3726,11 +3726,11 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c const struct wined3d_d3d_info *d3d_info = context_vk->c.d3d_info; const struct wined3d_vk_info *vk_info = context_vk->vk_info; const struct wined3d_blend_state *b = state->blend_state; + VkSampleCountFlagBits prev_sample_count, sample_count; bool dual_source_blend = b && b->dual_source; struct wined3d_rendertarget_view *dsv; struct wined3d_rendertarget_view *rtv; struct wined3d_buffer_vk *buffer_vk; - VkSampleCountFlagBits sample_count; VkCommandBuffer vk_command_buffer; unsigned int i, invalidate_rt = 0; uint32_t null_buffer_binding; @@ -3752,6 +3752,7 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_DOMAIN))) context_vk->c.shader_update_mask |= (1u << WINED3D_SHADER_TYPE_DOMAIN); + prev_sample_count = context_vk->sample_count; context_vk->sample_count = 0; for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i) { @@ -3796,6 +3797,10 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c if (!context_vk->sample_count) context_vk->sample_count = VK_SAMPLE_COUNT_1_BIT; + + if (context_vk->sample_count != prev_sample_count) + context_vk->c.update_multisample_state = 1; + if (context_vk->c.shader_update_mask & ~(1u << WINED3D_SHADER_TYPE_COMPUTE)) { device_vk->d.shader_backend->shader_apply_draw_state(device_vk->d.shader_priv, &context_vk->c, state);
1
0
0
0
Rémi Bernon : win32u: Get rid of move_window_bits_parent, using move_window_bits.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: d2372d60f0976b2e7a9740491eaebe38b828b690 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d2372d60f0976b2e7a9740491eaebe…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 4 11:29:20 2024 +0200 win32u: Get rid of move_window_bits_parent, using move_window_bits. --- dlls/win32u/dce.c | 47 +++++++++----------------------------------- dlls/win32u/win32u_private.h | 2 -- dlls/win32u/window.c | 2 +- 3 files changed, 10 insertions(+), 41 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 47c624cacc6..57a3ae59eff 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1189,26 +1189,10 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn, return need_erase; } -/*********************************************************************** - * copy_bits_from_surface - * - * Copy bits from a window surface; helper for move_window_bits and move_window_bits_parent. - */ -static void copy_bits_from_surface( HWND hwnd, const RECT *dst, const RECT *src ) -{ - UINT flags = UPDATE_NOCHILDREN | UPDATE_CLIPCHILDREN; - HRGN rgn = get_update_region( hwnd, &flags, NULL ); - HDC hdc = NtUserGetDCEx( hwnd, rgn, DCX_CACHE | DCX_WINDOW | DCX_EXCLUDERGN ); - - NtGdiStretchBlt( hdc, dst->left, dst->top, dst->right - dst->left, dst->bottom - dst->top, - hdc, src->left, src->top, src->right - src->left, src->bottom - src->top, SRCCOPY, 0 ); - NtUserReleaseDC( hwnd, hdc ); -} - /*********************************************************************** * move_window_bits * - * Move the window bits when a window is resized. + * Move the window bits when a window is resized, or moved within a parent window. */ void move_window_bits( HWND hwnd, const RECT *visible_rect, const RECT *old_visible_rect, const RECT *window_rect, const RECT *valid_rects ) @@ -1219,10 +1203,17 @@ void move_window_bits( HWND hwnd, const RECT *visible_rect, const RECT *old_visi if (src.left - old_visible_rect->left != dst.left - visible_rect->left || src.top - old_visible_rect->top != dst.top - visible_rect->top) { + UINT flags = UPDATE_NOCHILDREN | UPDATE_CLIPCHILDREN; + HRGN rgn = get_update_region( hwnd, &flags, NULL ); + HDC hdc = NtUserGetDCEx( hwnd, rgn, DCX_CACHE | DCX_WINDOW | DCX_EXCLUDERGN ); + TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst )); OffsetRect( &src, -window_rect->left, -window_rect->top ); OffsetRect( &dst, -window_rect->left, -window_rect->top ); - copy_bits_from_surface( hwnd, &dst, &src ); + + NtGdiStretchBlt( hdc, dst.left, dst.top, dst.right - dst.left, dst.bottom - dst.top, + hdc, src.left, src.top, src.right - src.left, src.bottom - src.top, SRCCOPY, 0 ); + NtUserReleaseDC( hwnd, hdc ); } } @@ -1260,26 +1251,6 @@ void move_window_bits_surface( HWND hwnd, const RECT *window_rect, struct window } -/*********************************************************************** - * move_window_bits_parent - * - * Move the window bits in the parent surface when a child is moved. - */ -void move_window_bits_parent( HWND hwnd, const RECT *window_rect, const RECT *valid_rects ) -{ - RECT dst = valid_rects[0]; - RECT src = valid_rects[1]; - - if (src.left != dst.left || src.top != dst.top) - { - TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst )); - OffsetRect( &src, -window_rect->left, -window_rect->top ); - OffsetRect( &dst, -window_rect->left, -window_rect->top ); - - copy_bits_from_surface( hwnd, &dst, &src ); - } -} - /*********************************************************************** * NtUserBeginPaint (win32u.@) */ diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 9ec941ca7d4..6539fb0bff1 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -53,8 +53,6 @@ extern void move_window_bits( HWND hwnd, const RECT *visible_rect, const RECT *o const RECT *window_rect, const RECT *valid_rects ); extern void move_window_bits_surface( HWND hwnd, const RECT *window_rect, struct window_surface *old_surface, const RECT *old_visible_rect, const RECT *valid_rects ); -extern void move_window_bits_parent( HWND hwnd, const RECT *window_rect, - const RECT *valid_rects ); extern void register_window_surface( struct window_surface *old, struct window_surface *new ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index b868053796d..0122ac2e4f7 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1959,7 +1959,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, rects[1] = old_visible_rect; valid_rects = rects; } - move_window_bits_parent( hwnd, window_rect, valid_rects ); + move_window_bits( hwnd, &visible_rect, &visible_rect, window_rect, valid_rects ); valid_rects = NULL; /* prevent the driver from trying to also move the bits */ } }
1
0
0
0
Rémi Bernon : win32u: Don't map points to the parent window in move_window_bits_parent.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: fae404669490453e126fd78b6016a6e13ee9bd69 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fae404669490453e126fd78b6016a6…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 4 09:32:48 2024 +0200 win32u: Don't map points to the parent window in move_window_bits_parent. We now use NtGdiStretchBlt, and the valid rects are relative to the window rect, not the parent. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56766
--- dlls/win32u/dce.c | 3 +-- dlls/win32u/win32u_private.h | 2 +- dlls/win32u/window.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 04c0fdfa248..47c624cacc6 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1265,7 +1265,7 @@ void move_window_bits_surface( HWND hwnd, const RECT *window_rect, struct window * * Move the window bits in the parent surface when a child is moved. */ -void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, const RECT *valid_rects ) +void move_window_bits_parent( HWND hwnd, const RECT *window_rect, const RECT *valid_rects ) { RECT dst = valid_rects[0]; RECT src = valid_rects[1]; @@ -1273,7 +1273,6 @@ void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, c if (src.left != dst.left || src.top != dst.top) { TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst )); - map_window_points( NtUserGetAncestor( hwnd, GA_PARENT ), parent, (POINT *)&src, 2, get_thread_dpi() ); OffsetRect( &src, -window_rect->left, -window_rect->top ); OffsetRect( &dst, -window_rect->left, -window_rect->top ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 54b3798d8fb..9ec941ca7d4 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -53,7 +53,7 @@ extern void move_window_bits( HWND hwnd, const RECT *visible_rect, const RECT *o const RECT *window_rect, const RECT *valid_rects ); extern void move_window_bits_surface( HWND hwnd, const RECT *window_rect, struct window_surface *old_surface, const RECT *old_visible_rect, const RECT *valid_rects ); -extern void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, +extern void move_window_bits_parent( HWND hwnd, const RECT *window_rect, const RECT *valid_rects ); extern void register_window_surface( struct window_surface *old, struct window_surface *new ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 22e9e326d6e..b868053796d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1959,7 +1959,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, rects[1] = old_visible_rect; valid_rects = rects; } - move_window_bits_parent( hwnd, surface_win, window_rect, valid_rects ); + move_window_bits_parent( hwnd, window_rect, valid_rects ); valid_rects = NULL; /* prevent the driver from trying to also move the bits */ } }
1
0
0
0
Rémi Bernon : win32u: Use a dedicated helper to move bits from a previous surface.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: feff51071726c1b543ed6cabd997a52b5d93304a URL:
https://gitlab.winehq.org/wine/wine/-/commit/feff51071726c1b543ed6cabd997a5…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 4 09:14:04 2024 +0200 win32u: Use a dedicated helper to move bits from a previous surface. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56766
--- dlls/win32u/dce.c | 98 ++++++++++++++++++++++---------------------- dlls/win32u/win32u_private.h | 6 +-- dlls/win32u/window.c | 6 ++- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 34acb1d10f6..04c0fdfa248 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1194,62 +1194,72 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn, * * Copy bits from a window surface; helper for move_window_bits and move_window_bits_parent. */ -static void copy_bits_from_surface( HWND hwnd, struct window_surface *surface, - const RECT *dst, const RECT *src, BOOL same ) +static void copy_bits_from_surface( HWND hwnd, const RECT *dst, const RECT *src ) { - char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; - BITMAPINFO *info = (BITMAPINFO *)buffer; - void *bits; UINT flags = UPDATE_NOCHILDREN | UPDATE_CLIPCHILDREN; HRGN rgn = get_update_region( hwnd, &flags, NULL ); HDC hdc = NtUserGetDCEx( hwnd, rgn, DCX_CACHE | DCX_WINDOW | DCX_EXCLUDERGN ); - if (same) - { - RECT rect = *src; - NtGdiStretchBlt( hdc, dst->left, dst->top, dst->right - dst->left, dst->bottom - dst->top, - hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SRCCOPY, 0 ); - } - else - { - bits = surface->funcs->get_info( surface, info ); - window_surface_lock( surface ); - NtGdiSetDIBitsToDeviceInternal( hdc, dst->left, dst->top, dst->right - dst->left, dst->bottom - dst->top, - src->left - surface->rect.left, surface->rect.bottom - src->bottom, - 0, surface->rect.bottom - surface->rect.top, - bits, info, DIB_RGB_COLORS, 0, 0, FALSE, NULL ); - window_surface_unlock( surface ); - } - + NtGdiStretchBlt( hdc, dst->left, dst->top, dst->right - dst->left, dst->bottom - dst->top, + hdc, src->left, src->top, src->right - src->left, src->bottom - src->top, SRCCOPY, 0 ); NtUserReleaseDC( hwnd, hdc ); } /*********************************************************************** * move_window_bits * - * Move the window bits when a window is resized or its surface recreated. + * Move the window bits when a window is resized. */ -void move_window_bits( HWND hwnd, struct window_surface *old_surface, - struct window_surface *new_surface, - const RECT *visible_rect, const RECT *old_visible_rect, +void move_window_bits( HWND hwnd, const RECT *visible_rect, const RECT *old_visible_rect, const RECT *window_rect, const RECT *valid_rects ) { RECT dst = valid_rects[0]; RECT src = valid_rects[1]; - if (new_surface != old_surface || - src.left - old_visible_rect->left != dst.left - visible_rect->left || + if (src.left - old_visible_rect->left != dst.left - visible_rect->left || src.top - old_visible_rect->top != dst.top - visible_rect->top) { TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst )); - if (new_surface != old_surface) OffsetRect( &src, -old_visible_rect->left, -old_visible_rect->top ); - else OffsetRect( &src, -window_rect->left, -window_rect->top ); + OffsetRect( &src, -window_rect->left, -window_rect->top ); OffsetRect( &dst, -window_rect->left, -window_rect->top ); - copy_bits_from_surface( hwnd, old_surface, &dst, &src, new_surface == old_surface ); + copy_bits_from_surface( hwnd, &dst, &src ); } } +/*********************************************************************** + * move_window_bits_surface + * + * Move the window bits from a previous window surface when its surface is recreated. + */ +void move_window_bits_surface( HWND hwnd, const RECT *window_rect, struct window_surface *old_surface, + const RECT *old_visible_rect, const RECT *valid_rects ) +{ + char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; + BITMAPINFO *info = (BITMAPINFO *)buffer; + UINT flags = UPDATE_NOCHILDREN | UPDATE_CLIPCHILDREN; + HRGN rgn = get_update_region( hwnd, &flags, NULL ); + HDC hdc = NtUserGetDCEx( hwnd, rgn, DCX_CACHE | DCX_WINDOW | DCX_EXCLUDERGN ); + void *bits; + + RECT dst = valid_rects[0]; + RECT src = valid_rects[1]; + + TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst )); + OffsetRect( &src, -old_visible_rect->left, -old_visible_rect->top ); + OffsetRect( &dst, -window_rect->left, -window_rect->top ); + + bits = old_surface->funcs->get_info( old_surface, info ); + window_surface_lock( old_surface ); + NtGdiSetDIBitsToDeviceInternal( hdc, dst.left, dst.top, dst.right - dst.left, dst.bottom - dst.top, + src.left - old_surface->rect.left, old_surface->rect.bottom - src.bottom, + 0, old_surface->rect.bottom - old_surface->rect.top, + bits, info, DIB_RGB_COLORS, 0, 0, FALSE, NULL ); + window_surface_unlock( old_surface ); + NtUserReleaseDC( hwnd, hdc ); +} + + /*********************************************************************** * move_window_bits_parent * @@ -1257,30 +1267,18 @@ void move_window_bits( HWND hwnd, struct window_surface *old_surface, */ void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, const RECT *valid_rects ) { - struct window_surface *surface; RECT dst = valid_rects[0]; RECT src = valid_rects[1]; - WND *win; - - if (src.left == dst.left && src.top == dst.top) return; - if (!(win = get_win_ptr( parent ))) return; - if (win == WND_DESKTOP || win == WND_OTHER_PROCESS) return; - if (!(surface = win->surface)) + if (src.left != dst.left || src.top != dst.top) { - release_win_ptr( win ); - return; - } - - TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst )); - map_window_points( NtUserGetAncestor( hwnd, GA_PARENT ), parent, (POINT *)&src, 2, get_thread_dpi() ); - OffsetRect( &src, -window_rect->left, -window_rect->top ); - OffsetRect( &dst, -window_rect->left, -window_rect->top ); - window_surface_add_ref( surface ); - release_win_ptr( win ); + TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst )); + map_window_points( NtUserGetAncestor( hwnd, GA_PARENT ), parent, (POINT *)&src, 2, get_thread_dpi() ); + OffsetRect( &src, -window_rect->left, -window_rect->top ); + OffsetRect( &dst, -window_rect->left, -window_rect->top ); - copy_bits_from_surface( hwnd, surface, &dst, &src, TRUE ); - window_surface_release( surface ); + copy_bits_from_surface( hwnd, &dst, &src ); + } } /*********************************************************************** diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 8aed662d2d8..54b3798d8fb 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -49,10 +49,10 @@ extern void create_offscreen_window_surface( HWND hwnd, const RECT *visible_rect struct window_surface **surface ); extern void erase_now( HWND hwnd, UINT rdw_flags ); extern void flush_window_surfaces( BOOL idle ); -extern void move_window_bits( HWND hwnd, struct window_surface *old_surface, - struct window_surface *new_surface, - const RECT *visible_rect, const RECT *old_visible_rect, +extern void move_window_bits( HWND hwnd, const RECT *visible_rect, const RECT *old_visible_rect, const RECT *window_rect, const RECT *valid_rects ); +extern void move_window_bits_surface( HWND hwnd, const RECT *window_rect, struct window_surface *old_surface, + const RECT *old_visible_rect, const RECT *valid_rects ); extern void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, const RECT *valid_rects ); extern void register_window_surface( struct window_surface *old, diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 12f2a9027f0..22e9e326d6e 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1929,8 +1929,10 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, { if (valid_rects) { - move_window_bits( hwnd, old_surface, new_surface, &visible_rect, - &old_visible_rect, window_rect, valid_rects ); + if (old_surface != new_surface) + move_window_bits_surface( hwnd, window_rect, old_surface, &old_visible_rect, valid_rects ); + else + move_window_bits( hwnd, &visible_rect, &old_visible_rect, window_rect, valid_rects ); valid_rects = NULL; /* prevent the driver from trying to also move the bits */ } window_surface_release( old_surface );
1
0
0
0
Rémi Bernon : win32u: Restore surface rect, which may offsetted from the window rect.
by Alexandre Julliard
04 Jun '24
04 Jun '24
Module: wine Branch: master Commit: 09b9c1b5fe002c0d55f53f68b474acb02310018f URL:
https://gitlab.winehq.org/wine/wine/-/commit/09b9c1b5fe002c0d55f53f68b474ac…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 4 10:22:40 2024 +0200 win32u: Restore surface rect, which may offsetted from the window rect. Some drivers only create surfaces over the visible part of the window, and the surface rect has an offset. Fixes a regression from 5d0efbcc6e88e2b7886f2a0cfb58c9100b452160, which causes XSHM errors with partially offscreen windows. --- dlls/win32u/dce.c | 7 ++++--- dlls/wineandroid.drv/window.c | 2 +- dlls/winemac.drv/surface.c | 2 +- dlls/winewayland.drv/window_surface.c | 2 +- dlls/winex11.drv/bitblt.c | 2 +- include/wine/gdi_driver.h | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index f6726b49aa1..34acb1d10f6 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -188,7 +188,7 @@ void create_offscreen_window_surface( HWND hwnd, const RECT *visible_rect, struc /* create a new window surface */ *surface = NULL; if (!(impl = calloc(1, sizeof(*impl)))) return; - window_surface_init( &impl->header, &offscreen_window_surface_funcs, hwnd, info, 0 ); + window_surface_init( &impl->header, &offscreen_window_surface_funcs, hwnd, &surface_rect, info, 0 ); impl->info = *info; TRACE( "created window surface %p\n", &impl->header ); @@ -199,7 +199,7 @@ void create_offscreen_window_surface( HWND hwnd, const RECT *visible_rect, struc /* window surface common helpers */ W32KAPI BOOL window_surface_init( struct window_surface *surface, const struct window_surface_funcs *funcs, - HWND hwnd, BITMAPINFO *info, HBITMAP bitmap ) + HWND hwnd, const RECT *rect, BITMAPINFO *info, HBITMAP bitmap ) { struct bitblt_coords coords = {0}; struct gdi_image_bits bits; @@ -208,7 +208,7 @@ W32KAPI BOOL window_surface_init( struct window_surface *surface, const struct w surface->funcs = funcs; surface->ref = 1; surface->hwnd = hwnd; - SetRect( &surface->rect, 0, 0, info->bmiHeader.biWidth, abs( info->bmiHeader.biHeight ) ); + surface->rect = *rect; pthread_mutex_init( &surface->mutex, NULL ); reset_bounds( &surface->bounds ); @@ -256,6 +256,7 @@ W32KAPI void window_surface_flush( struct window_surface *surface ) window_surface_lock( surface ); + OffsetRect( &dirty, -dirty.left, -dirty.top ); if (intersect_rect( &dirty, &dirty, &surface->bounds )) { TRACE( "Flushing hwnd %p, surface %p %s, bounds %s, dirty %s\n", surface->hwnd, surface, diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index fa7b87522c5..7b7d680fe2e 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -792,7 +792,7 @@ static struct window_surface *create_surface( HWND hwnd, const RECT *rect, surface = calloc( 1, FIELD_OFFSET( struct android_window_surface, info.bmiColors[3] )); if (!surface) return NULL; - if (!window_surface_init( &surface->header, &android_surface_funcs, hwnd, info, 0 )) goto failed; + if (!window_surface_init( &surface->header, &android_surface_funcs, hwnd, rect, info, 0 )) goto failed; memcpy( &surface->info, info, get_dib_info_size( info, DIB_RGB_COLORS ) ); surface->window = get_ioctl_window( hwnd ); diff --git a/dlls/winemac.drv/surface.c b/dlls/winemac.drv/surface.c index 82b7a382ec4..37e2c466926 100644 --- a/dlls/winemac.drv/surface.c +++ b/dlls/winemac.drv/surface.c @@ -147,7 +147,7 @@ struct window_surface *create_surface(HWND hwnd, macdrv_window window, const REC surface = calloc(1, FIELD_OFFSET(struct macdrv_window_surface, info.bmiColors[3])); if (!surface) return NULL; - if (!window_surface_init(&surface->header, &macdrv_surface_funcs, hwnd, info, 0)) goto failed; + if (!window_surface_init(&surface->header, &macdrv_surface_funcs, hwnd, rect, info, 0)) goto failed; memcpy(&surface->info, info, offsetof(BITMAPINFO, bmiColors[3])); surface->window = window; diff --git a/dlls/winewayland.drv/window_surface.c b/dlls/winewayland.drv/window_surface.c index c0b516c9288..fb3b8750001 100644 --- a/dlls/winewayland.drv/window_surface.c +++ b/dlls/winewayland.drv/window_surface.c @@ -470,7 +470,7 @@ struct window_surface *wayland_window_surface_create(HWND hwnd, const RECT *rect wws = calloc(1, sizeof(*wws)); if (!wws) return NULL; - if (!window_surface_init(&wws->header, &wayland_window_surface_funcs, hwnd, info, 0)) goto failed; + if (!window_surface_init(&wws->header, &wayland_window_surface_funcs, hwnd, rect, info, 0)) goto failed; wws->info = *info; TRACE("created %p hwnd %p %s bits [%p,%p)\n", wws, hwnd, wine_dbgstr_rect(rect), diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index ec6250048cf..8a001606420 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -2098,7 +2098,7 @@ struct window_surface *create_surface( HWND hwnd, Window window, const XVisualIn surface->image = image; surface->byteswap = byteswap; - if (!window_surface_init( &surface->header, &x11drv_surface_funcs, hwnd, info, bitmap )) goto failed; + if (!window_surface_init( &surface->header, &x11drv_surface_funcs, hwnd, rect, info, bitmap )) goto failed; memcpy( &surface->info, info, get_dib_info_size( info, DIB_RGB_COLORS ) ); surface->window = window; diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index ce954a7f4d8..701e3031dc3 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -235,7 +235,7 @@ struct window_surface }; W32KAPI BOOL window_surface_init( struct window_surface *surface, const struct window_surface_funcs *funcs, - HWND hwnd, BITMAPINFO *info, HBITMAP bitmap ); + HWND hwnd, const RECT *rect, BITMAPINFO *info, HBITMAP bitmap ); W32KAPI void window_surface_add_ref( struct window_surface *surface ); W32KAPI void window_surface_release( struct window_surface *surface ); W32KAPI void window_surface_lock( struct window_surface *surface );
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
61
62
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Results per page:
10
25
50
100
200