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
February 2011
----- 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
2 participants
674 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Moved VARIANT to style value string conversion to separated function.
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: fa946c09cedf64d15d9f8839550dc946ff2b4c31 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fa946c09cedf64d15d9f88395…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 14:11:39 2011 +0100 mshtml: Moved VARIANT to style value string conversion to separated function. --- dlls/mshtml/htmlstyle.c | 45 ++++++++++++++++++++++++++++++--------------- 1 files changed, 30 insertions(+), 15 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 1d57bc4..679e363 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -335,38 +335,53 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCW return S_OK; } -HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) +static HRESULT var_to_styleval(const VARIANT *v, WCHAR *buf, DWORD flags, const WCHAR **ret) { - switch(V_VT(value)) { + switch(V_VT(v)) { case VT_NULL: - return set_nsstyle_attr(nsstyle, sid, emptyW, flags); + *ret = emptyW; + return S_OK; case VT_BSTR: - return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags); + *ret = V_BSTR(v); + return S_OK; case VT_BSTR|VT_BYREF: - return set_nsstyle_attr(nsstyle, sid, *V_BSTRREF(value), flags); + *ret = *V_BSTRREF(v); + return S_OK; case VT_I4: { - WCHAR str[14]; - - static const WCHAR format[] = {'%','d',0}; - static const WCHAR px_format[] = {'%','d','p','x',0}; - static const WCHAR hex_format[] = {'#','%','0','6','x',0}; + static const WCHAR formatW[] = {'%','d',0}; + static const WCHAR hex_formatW[] = {'#','%','0','6','x',0}; if(flags & ATTR_HEX_INT) - wsprintfW(str, hex_format, V_I4(value)); + wsprintfW(buf, hex_formatW, V_I4(v)); + else if(flags & ATTR_FIX_PX) + wsprintfW(buf, px_formatW, V_I4(v)); else - wsprintfW(str, flags&ATTR_FIX_PX ? px_format : format, V_I4(value)); - return set_nsstyle_attr(nsstyle, sid, str, flags & ~ATTR_FIX_PX); + wsprintfW(buf, formatW, V_I4(v)); + + *ret = buf; + return S_OK; } default: - FIXME("not implemented vt %d\n", V_VT(value)); + FIXME("not implemented vt %d\n", V_VT(v)); return E_NOTIMPL; } +} - return S_OK; +HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) +{ + const WCHAR *val; + WCHAR buf[14]; + HRESULT hres; + + hres = var_to_styleval(value, buf, flags, &val); + if(FAILED(hres)) + return hres; + + return set_nsstyle_attr(nsstyle, sid, val, flags); } static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
1
0
0
0
Jacek Caban : mshtml: Fixed buffer handling in set_nsstyle_attr.
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: 3aa970c9ea0a83935064634efae35dc64cca477f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3aa970c9ea0a83935064634ef…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 14:11:26 2011 +0100 mshtml: Fixed buffer handling in set_nsstyle_attr. --- dlls/mshtml/htmlstyle.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 7f1308c..1d57bc4 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -314,8 +314,6 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCW LPWSTR val = NULL; nsresult nsres; - static const PRUnichar wszEmpty[] = {0}; - if(flags & ATTR_FIX_PX) val = fix_px_value(value); if(flags & ATTR_FIX_URL) @@ -323,8 +321,7 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCW nsAString_InitDepend(&str_name, style_tbl[sid].name); nsAString_InitDepend(&str_value, val ? val : value); - nsAString_InitDepend(&str_empty, wszEmpty); - heap_free(val); + nsAString_InitDepend(&str_empty, emptyW); nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty); if(NS_FAILED(nsres)) @@ -333,6 +330,7 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCW nsAString_Finish(&str_name); nsAString_Finish(&str_value); nsAString_Finish(&str_empty); + heap_free(val); return S_OK; }
1
0
0
0
Jacek Caban : mshtml: Added IHTMLStyle::[get|put] _backgroundPosition implementation.
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: b5d68c70d3027efda996d5717ee831ae0c872e70 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5d68c70d3027efda996d5717…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 14:11:16 2011 +0100 mshtml: Added IHTMLStyle::[get|put]_backgroundPosition implementation. --- dlls/mshtml/htmlstyle.c | 15 +++++++++++---- dlls/mshtml/htmlstyle.h | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 51e3fd3..7f1308c 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -41,6 +41,8 @@ static const WCHAR attrBackgroundColor[] = {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0}; static const WCHAR attrBackgroundImage[] = {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0}; +static const WCHAR attrBackgroundPosition[] = + {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0}; static const WCHAR attrBackgroundPositionX[] = {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0}; static const WCHAR attrBackgroundPositionY[] = @@ -171,6 +173,7 @@ static const struct{ {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND}, {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR}, {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE}, + {attrBackgroundPosition, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION}, {attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX}, {attrBackgroundPositionY, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY}, {attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT}, @@ -952,15 +955,19 @@ static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return set_style_attr(This, STYLEID_BACKGROUND_POSITION, v, 0); } static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_style_attr(This, STYLEID_BACKGROUND_POSITION, p); } static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index ea4ece3..6731584 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -33,6 +33,7 @@ typedef enum { STYLEID_BACKGROUND, STYLEID_BACKGROUND_COLOR, STYLEID_BACKGROUND_IMAGE, + STYLEID_BACKGROUND_POSITION, STYLEID_BACKGROUND_POSITION_X, STYLEID_BACKGROUND_POSITION_Y, STYLEID_BACKGROUND_REPEAT,
1
0
0
0
Jacek Caban : mshtml: Moved call_disp_func to htmlevent.c.
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: 1c881e534b8ab59c09e9f291e39176b39fbd78d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1c881e534b8ab59c09e9f291e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 14:11:05 2011 +0100 mshtml: Moved call_disp_func to htmlevent.c. --- dlls/mshtml/dispex.c | 24 ------------------------ dlls/mshtml/htmlevent.c | 24 ++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 4 +--- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index b360442..be949d5 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -324,30 +324,6 @@ static dispex_data_t *get_dispex_data(DispatchEx *This) return This->data->data; } -HRESULT call_disp_func(IDispatch *disp, DISPPARAMS *dp) -{ - EXCEPINFO ei; - IDispatchEx *dispex; - VARIANT res; - HRESULT hres; - - VariantInit(&res); - memset(&ei, 0, sizeof(ei)); - - hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); - if(SUCCEEDED(hres)) { - hres = IDispatchEx_InvokeEx(dispex, 0, GetUserDefaultLCID(), DISPATCH_METHOD, dp, &res, &ei, NULL); - IDispatchEx_Release(dispex); - }else { - TRACE("Could not get IDispatchEx interface: %08x\n", hres); - hres = IDispatch_Invoke(disp, 0, &IID_NULL, GetUserDefaultLCID(), DISPATCH_METHOD, - dp, &res, &ei, NULL); - } - - VariantClear(&res); - return hres; -} - static inline BOOL is_custom_dispid(DISPID id) { return MSHTML_DISPID_CUSTOM_MIN <= id && id <= MSHTML_DISPID_CUSTOM_MAX; diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 19a6013..c8dad46 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -786,6 +786,30 @@ static IHTMLEventObj *create_event(HTMLDOMNode *target, eventid_t eid, nsIDOMEve return &ret->IHTMLEventObj_iface; } +static HRESULT call_disp_func(IDispatch *disp, DISPPARAMS *dp) +{ + EXCEPINFO ei; + IDispatchEx *dispex; + VARIANT res; + HRESULT hres; + + VariantInit(&res); + memset(&ei, 0, sizeof(ei)); + + hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + if(SUCCEEDED(hres)) { + hres = IDispatchEx_InvokeEx(dispex, 0, GetUserDefaultLCID(), DISPATCH_METHOD, dp, &res, &ei, NULL); + IDispatchEx_Release(dispex); + }else { + TRACE("Could not get IDispatchEx interface: %08x\n", hres); + hres = IDispatch_Invoke(disp, 0, &IID_NULL, GetUserDefaultLCID(), DISPATCH_METHOD, + dp, &res, &ei, NULL); + } + + VariantClear(&res); + return hres; +} + static HRESULT call_cp_func(IDispatch *disp, DISPID dispid) { DISPPARAMS dp = {NULL,NULL,0,0}; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e69949e..9bb11fb 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -204,6 +204,7 @@ BOOL dispex_query_interface(DispatchEx*,REFIID,void**); HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**); HRESULT get_dispids(tid_t,DWORD*,DISPID**); HRESULT remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*); +void release_typelib(void); typedef struct HTMLWindow HTMLWindow; typedef struct HTMLDocumentNode HTMLDocumentNode; @@ -866,9 +867,6 @@ void remove_target_tasks(LONG); DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*); HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD); -void release_typelib(void); -HRESULT call_disp_func(IDispatch*,DISPPARAMS*); - const char *debugstr_variant(const VARIANT*); DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1
0
0
0
Jacek Caban : mshtml: Added IHTMLDOMAttribute::get_nodeValue implementation .
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: 47ebbbd44753de727b0ae2d5f9d9759b792ac886 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47ebbbd44753de727b0ae2d5f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 14:10:54 2011 +0100 mshtml: Added IHTMLDOMAttribute::get_nodeValue implementation. --- dlls/mshtml/htmlattr.c | 23 +++++++++++++++++++++-- dlls/mshtml/tests/dom.c | 25 ++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index 3d6de22..9fef7d8 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -134,8 +134,27 @@ static HRESULT WINAPI HTMLDOMAttribute_put_nodeName(IHTMLDOMAttribute *iface, VA static HRESULT WINAPI HTMLDOMAttribute_get_nodeValue(IHTMLDOMAttribute *iface, VARIANT *p) { HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + const PRUnichar *val; + nsAString val_str; + HRESULT hres = S_OK; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&val_str, NULL); + nsIDOMAttr_GetNodeValue(This->nsattr, &val_str); + nsAString_GetData(&val_str, &val); + + V_VT(p) = VT_BSTR; + if(*val) { + V_BSTR(p) = SysAllocString(val); + if(!V_BSTR(p)) + hres = E_OUTOFMEMORY; + }else { + V_BSTR(p) = NULL; + } + + nsAString_Finish(&val_str); + return hres; } static HRESULT WINAPI HTMLDOMAttribute_get_specified(IHTMLDOMAttribute *iface, VARIANT_BOOL *p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 296de73..b4e1619 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -56,7 +56,7 @@ static const char elem_test_str[] = "</body></html>"; static const char elem_test2_str[] = "<html><head><title>test</title><style>.body { margin-right: 0px; }</style>" - "<body><div id=\"divid\"></div></body>" + "<body><div id=\"divid\" emptyattr=""></div></body>" "</html>"; static const char indent_test_str[] = @@ -2845,6 +2845,23 @@ static IHTMLDOMAttribute *_get_elem_attr_node(unsigned line, IUnknown *unk, cons return attr; } +#define test_attr_node_value(a,b) _test_attr_node_value(__LINE__,a,b) +static void _test_attr_node_value(unsigned line, IHTMLDOMAttribute *attr, const char *exval) +{ + VARIANT var; + HRESULT hres; + + hres = IHTMLDOMAttribute_get_nodeValue(attr, &var); + ok_(__FILE__,line) (hres == S_OK, "get_nodeValue failed: %08x, expected VT_BSTR\n", hres); + ok_(__FILE__,line) (V_VT(&var) == VT_BSTR, "vt=%d\n", V_VT(&var)); + if(exval) + ok_(__FILE__,line) (!strcmp_wa(V_BSTR(&var), exval), "unexpected value %s\n", wine_dbgstr_w(V_BSTR(&var))); + else + ok_(__FILE__,line) (!V_BSTR(&var), "nodeValue = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&var))); + + VariantClear(&var); +} + #define get_window_doc(e) _get_window_doc(__LINE__,e) static IHTMLDocument2 *_get_window_doc(unsigned line, IHTMLWindow2 *window) { @@ -6651,6 +6668,12 @@ static void test_attr(IHTMLElement *elem) ok(iface_cmp((IUnknown*)attr, (IUnknown*)attr2), "attr != attr2\n"); IHTMLDOMAttribute_Release(attr2); + test_attr_node_value(attr, "divid"); + + IHTMLDOMAttribute_Release(attr); + + attr = get_elem_attr_node((IUnknown*)elem, "emptyattr", TRUE); + test_attr_node_value(attr, NULL); IHTMLDOMAttribute_Release(attr); }
1
0
0
0
Marcus Meissner : user32: Fixed some more side effect functions in assert() (Coverity).
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: b0b77d4ba9b9267f84b0949a41c3ca1adef3fd61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b0b77d4ba9b9267f84b0949a4…
Author: Marcus Meissner <meissner(a)suse.de> Date: Thu Feb 24 17:53:16 2011 +0100 user32: Fixed some more side effect functions in assert() (Coverity). --- dlls/user32/tests/dde.c | 7 ++++--- dlls/user32/tests/edit.c | 24 ++++++++++++++++++------ dlls/user32/tests/input.c | 5 +++-- dlls/user32/tests/listbox.c | 2 +- dlls/user32/tests/msg.c | 2 +- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/dlls/user32/tests/dde.c b/dlls/user32/tests/dde.c index f6a0844..510f3e4 100644 --- a/dlls/user32/tests/dde.c +++ b/dlls/user32/tests/dde.c @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <assert.h> #include <stdarg.h> #include <stdio.h> @@ -63,17 +62,19 @@ static void flush_events(void) static void create_dde_window(HWND *hwnd, LPCSTR name, WNDPROC wndproc) { WNDCLASSA wcA; + ATOM aclass; memset(&wcA, 0, sizeof(wcA)); wcA.lpfnWndProc = wndproc; wcA.lpszClassName = name; wcA.hInstance = GetModuleHandleA(0); - assert(RegisterClassA(&wcA)); + aclass = RegisterClassA(&wcA); + ok (aclass, "RegisterClass failed\n"); *hwnd = CreateWindowExA(0, name, NULL, WS_POPUP, 500, 500, CW_USEDEFAULT, CW_USEDEFAULT, GetDesktopWindow(), 0, GetModuleHandleA(0), NULL); - assert(*hwnd); + ok(*hwnd != NULL, "CreateWindowExA failed\n"); } static void destroy_dde_window(HWND *hwnd, LPCSTR name) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 2308faa..d279f0d 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -559,6 +559,7 @@ static HWND create_editcontrol (DWORD style, DWORD exstyle) style, 10, 10, 300, 300, NULL, NULL, hinst, NULL); + ok (handle != NULL, "CreateWindow EDIT Control failed\n"); assert (handle); if (winetest_interactive) ShowWindow (handle, SW_SHOW); @@ -570,12 +571,14 @@ static HWND create_child_editcontrol (DWORD style, DWORD exstyle) HWND parentWnd; HWND editWnd; RECT rect; + BOOL b; rect.left = 0; rect.top = 0; rect.right = 300; rect.bottom = 300; - assert(AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE)); + b = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); + ok(b, "AdjustWindowRect failed\n"); parentWnd = CreateWindowEx(0, szEditTextPositionClass, @@ -584,6 +587,7 @@ static HWND create_child_editcontrol (DWORD style, DWORD exstyle) CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, hinst, NULL); + ok (parentWnd != NULL, "CreateWindow EDIT Test failed\n"); assert(parentWnd); editWnd = CreateWindowEx(exstyle, @@ -592,6 +596,7 @@ static HWND create_child_editcontrol (DWORD style, DWORD exstyle) WS_CHILD | style, 0, 0, 300, 300, parentWnd, NULL, hinst, NULL); + ok (editWnd != NULL, "CreateWindow EDIT Test Text failed\n"); assert(editWnd); if (winetest_interactive) ShowWindow (parentWnd, SW_SHOW); @@ -1572,7 +1577,7 @@ static void test_text_position_style(DWORD style) HDC dc; TEXTMETRIC metrics; INT b, bm, b2, b3; - BOOL single_line = !(style & ES_MULTILINE); + BOOL xb, single_line = !(style & ES_MULTILINE); b = GetSystemMetrics(SM_CYBORDER) + 1; b2 = 2 * b; @@ -1580,10 +1585,13 @@ static void test_text_position_style(DWORD style) bm = b2 - 1; /* Get a stock font for which we can determine the metrics */ - assert(font = GetStockObject(SYSTEM_FONT)); - assert(dc = GetDC(NULL)); + font = GetStockObject(SYSTEM_FONT); + ok (font != NULL, "GetStockObjcet SYSTEM_FONT failed\n"); + dc = GetDC(NULL); + ok (dc != NULL, "GetDC() failed\n"); oldFont = SelectObject(dc, font); - assert(GetTextMetrics(dc, &metrics)); + xb = GetTextMetrics(dc, &metrics); + ok (xb, "GetTextMetrics failed\n"); SelectObject(dc, oldFont); ReleaseDC(NULL, dc); @@ -2448,10 +2456,14 @@ static void test_dialogmode(void) START_TEST(edit) { + BOOL b; + init_function_pointers(); hinst = GetModuleHandleA(NULL); - assert(RegisterWindowClasses()); + b = RegisterWindowClasses(); + ok (b, "RegisterWindowClasses failed\n"); + if (!b) return; test_edit_control_1(); test_edit_control_2(); diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 9eb72c5..22120f0 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -239,8 +239,9 @@ static BOOL do_test( HWND hwnd, int seqnr, const KEV td[] ) } for( kmctr = 0; kmctr < MAXKEYEVENTS && expmsg[kmctr].message; kmctr++) ; - assert( evtctr <= MAXKEYEVENTS ); - assert( evtctr == pSendInput(evtctr, &inputs[0], sizeof(INPUT))); + ok( evtctr <= MAXKEYEVENTS, "evtctr is above MAXKEYEVENTS\n" ); + if( evtctr != pSendInput(evtctr, &inputs[0], sizeof(INPUT))) + ok (FALSE, "SendInput failed to send some events\n"); i = 0; if (winetest_debug > 1) trace("======== key stroke sequence #%d: %s =============\n", diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index be4640f..1d6e8a3 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -291,7 +291,7 @@ static void test_ownerdraw(void) cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "main_window_class"; - assert(RegisterClass(&cls)); + ok (RegisterClass(&cls), "RegisterClass failed\n"); parent = CreateWindowEx(0, "main_window_class", NULL, WS_POPUP | WS_VISIBLE, diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index b3ca5d0..ab9a3fb 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -3367,7 +3367,7 @@ static void test_mdi_messages(void) RECT rc; HMENU hMenu = CreateMenu(); - assert(mdi_RegisterWindowClasses()); + if (!mdi_RegisterWindowClasses()) assert(0); flush_sequence();
1
0
0
0
Alexandre Julliard : server: Store the global key state in the server.
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: 06b78feadec13335d96cf3560e2db2ffa6cc4739 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06b78feadec13335d96cf3560…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Feb 25 12:10:04 2011 +0100 server: Store the global key state in the server. --- server/queue.c | 88 ++++++++++++++++++++++++++++++--------------------- server/user.h | 1 + server/winstation.c | 1 + 3 files changed, 54 insertions(+), 36 deletions(-) diff --git a/server/queue.c b/server/queue.c index 16486cd..281c8bc 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1101,18 +1101,18 @@ static struct timer *set_timer( struct msg_queue *queue, unsigned int rate ) } /* change the input key state for a given key */ -static void set_input_key_state( struct thread_input *input, unsigned char key, int down ) +static void set_input_key_state( unsigned char *keystate, unsigned char key, int down ) { if (down) { - if (!(input->keystate[key] & 0x80)) input->keystate[key] ^= 0x01; - input->keystate[key] |= 0x80; + if (!(keystate[key] & 0x80)) keystate[key] ^= 0x01; + keystate[key] |= 0x80; } - else input->keystate[key] &= ~0x80; + else keystate[key] &= ~0x80; } /* update the input key state for a keyboard message */ -static void update_input_key_state( struct thread_input *input, const struct message *msg ) +static void update_input_key_state( unsigned char *keystate, const struct message *msg ) { unsigned char key; int down = 0; @@ -1123,26 +1123,26 @@ static void update_input_key_state( struct thread_input *input, const struct mes down = 1; /* fall through */ case WM_LBUTTONUP: - set_input_key_state( input, VK_LBUTTON, down ); + set_input_key_state( keystate, VK_LBUTTON, down ); break; case WM_MBUTTONDOWN: down = 1; /* fall through */ case WM_MBUTTONUP: - set_input_key_state( input, VK_MBUTTON, down ); + set_input_key_state( keystate, VK_MBUTTON, down ); break; case WM_RBUTTONDOWN: down = 1; /* fall through */ case WM_RBUTTONUP: - set_input_key_state( input, VK_RBUTTON, down ); + set_input_key_state( keystate, VK_RBUTTON, down ); break; case WM_XBUTTONDOWN: down = 1; /* fall through */ case WM_XBUTTONUP: - if (msg->wparam == XBUTTON1) set_input_key_state( input, VK_XBUTTON1, down ); - else if (msg->wparam == XBUTTON2) set_input_key_state( input, VK_XBUTTON2, down ); + if (msg->wparam == XBUTTON1) set_input_key_state( keystate, VK_XBUTTON1, down ); + else if (msg->wparam == XBUTTON2) set_input_key_state( keystate, VK_XBUTTON2, down ); break; case WM_KEYDOWN: case WM_SYSKEYDOWN: @@ -1151,23 +1151,23 @@ static void update_input_key_state( struct thread_input *input, const struct mes case WM_KEYUP: case WM_SYSKEYUP: key = (unsigned char)msg->wparam; - set_input_key_state( input, key, down ); + set_input_key_state( keystate, key, down ); switch(key) { case VK_LCONTROL: case VK_RCONTROL: - down = (input->keystate[VK_LCONTROL] | input->keystate[VK_RCONTROL]) & 0x80; - set_input_key_state( input, VK_CONTROL, down ); + down = (keystate[VK_LCONTROL] | keystate[VK_RCONTROL]) & 0x80; + set_input_key_state( keystate, VK_CONTROL, down ); break; case VK_LMENU: case VK_RMENU: - down = (input->keystate[VK_LMENU] | input->keystate[VK_RMENU]) & 0x80; - set_input_key_state( input, VK_MENU, down ); + down = (keystate[VK_LMENU] | keystate[VK_RMENU]) & 0x80; + set_input_key_state( keystate, VK_MENU, down ); break; case VK_LSHIFT: case VK_RSHIFT: - down = (input->keystate[VK_LSHIFT] | input->keystate[VK_RSHIFT]) & 0x80; - set_input_key_state( input, VK_SHIFT, down ); + down = (keystate[VK_LSHIFT] | keystate[VK_RSHIFT]) & 0x80; + set_input_key_state( keystate, VK_SHIFT, down ); break; } break; @@ -1229,7 +1229,7 @@ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_i } if (remove) { - update_input_key_state( input, msg ); + update_input_key_state( input->keystate, msg ); list_remove( &msg->entry ); free_message( msg ); } @@ -1283,11 +1283,12 @@ static void queue_hardware_message( struct desktop *desktop, struct thread_input if (msg->msg == WM_MOUSEMOVE) set_cursor_pos( desktop, data->x, data->y ); data->x = desktop->cursor_x; data->y = desktop->cursor_y; + update_input_key_state( desktop->keystate, msg ); last_input_time = get_tick_count(); win = find_hardware_message_window( input, msg, &msg_code ); if (!win || !(thread = get_window_thread(win))) { - if (input) update_input_key_state( input, msg ); + if (input) update_input_key_state( input->keystate, msg ); free( msg ); return; } @@ -1377,7 +1378,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user if (!win || !(win_thread = get_window_thread( win ))) { /* no window at all, remove it */ - update_input_key_state( input, msg ); + update_input_key_state( input->keystate, msg ); list_remove( &msg->entry ); free_message( msg ); continue; @@ -1393,7 +1394,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user else { /* for another thread input, drop it */ - update_input_key_state( input, msg ); + update_input_key_state( input->keystate, msg ); list_remove( &msg->entry ); free_message( msg ); } @@ -2098,33 +2099,48 @@ DECL_HANDLER(get_thread_input) DECL_HANDLER(get_key_state) { struct thread *thread; - struct thread_input *input; + struct desktop *desktop; + data_size_t size = min( 256, get_reply_max_size() ); - if (!(thread = get_thread_from_id( req->tid ))) return; - input = thread->queue ? thread->queue->input : NULL; - if (input) + if (!req->tid) /* get global async key state */ { - if (req->key >= 0) reply->state = input->keystate[req->key & 0xff]; - set_reply_data( input->keystate, min( get_reply_max_size(), sizeof(input->keystate) )); + if (!(desktop = get_thread_desktop( current, 0 ))) return; + if (req->key >= 0) reply->state = desktop->keystate[req->key & 0xff]; + set_reply_data( desktop->keystate, size ); + release_object( desktop ); + } + else + { + if (!(thread = get_thread_from_id( req->tid ))) return; + if (thread->queue) + { + if (req->key >= 0) reply->state = thread->queue->input->keystate[req->key & 0xff]; + set_reply_data( thread->queue->input->keystate, size ); + } + release_object( thread ); } - release_object( thread ); } /* set queue keyboard state for a given thread */ DECL_HANDLER(set_key_state) { - struct thread *thread = NULL; - struct thread_input *input; + struct thread *thread; + struct desktop *desktop; + data_size_t size = min( 256, get_req_data_size() ); - if (!(thread = get_thread_from_id( req->tid ))) return; - input = thread->queue ? thread->queue->input : NULL; - if (input) + if (!req->tid) /* set global async key state */ { - data_size_t size = min( sizeof(input->keystate), get_req_data_size() ); - if (size) memcpy( input->keystate, get_req_data(), size ); + if (!(desktop = get_thread_desktop( current, 0 ))) return; + memcpy( desktop->keystate, get_req_data(), size ); + release_object( desktop ); + } + else + { + if (!(thread = get_thread_from_id( req->tid ))) return; + if (thread->queue) memcpy( thread->queue->input->keystate, get_req_data(), size ); + release_object( thread ); } - release_object( thread ); } diff --git a/server/user.h b/server/user.h index 8fc19e9..5d7bec8 100644 --- a/server/user.h +++ b/server/user.h @@ -66,6 +66,7 @@ struct desktop int cursor_x; /* cursor position */ int cursor_y; rectangle_t cursor_clip; /* cursor clip rectangle */ + unsigned char keystate[256]; /* asynchronous key state */ }; /* user handles functions */ diff --git a/server/winstation.c b/server/winstation.c index f23dcfe..13871cf 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -238,6 +238,7 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned desktop->cursor_clip.top = 0; desktop->cursor_clip.right = 0; desktop->cursor_clip.bottom = 0; + memset( desktop->keystate, 0, sizeof(desktop->keystate) ); list_add_tail( &winstation->desktops, &desktop->entry ); } }
1
0
0
0
Alexandre Julliard : server: Store the cursor clip rectangle in the server.
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: 02e8174067216e085e2f6a0d1dbbfabad74491b3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02e8174067216e085e2f6a0d1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Feb 25 11:31:47 2011 +0100 server: Store the cursor clip rectangle in the server. --- dlls/user32/cursoricon.c | 58 +++++++++++++++++++++++++++------------ dlls/winex11.drv/mouse.c | 17 +++--------- include/wine/server_protocol.h | 5 +++- server/protocol.def | 3 ++ server/queue.c | 24 +++++++++++----- server/request.h | 6 +++- server/trace.c | 2 + server/user.h | 12 ++++++++ server/window.c | 22 +++++++------- server/winstation.c | 4 +++ 10 files changed, 101 insertions(+), 52 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=02e8174067216e085e2f6…
1
0
0
0
Alexandre Julliard : server: Store the global cursor position in the server .
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: 183c41b49a3501168da4aad5252eefa85f934261 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=183c41b49a3501168da4aad52…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 24 17:47:59 2011 +0100 server: Store the global cursor position in the server. --- dlls/user32/input.c | 17 ++++++++++++++++- include/wine/server_protocol.h | 7 ++++++- server/protocol.def | 5 +++++ server/queue.c | 30 +++++++++++++++++++++++------- server/request.h | 8 ++++++-- server/trace.c | 4 ++++ server/user.h | 2 ++ server/winstation.c | 2 ++ 8 files changed, 64 insertions(+), 11 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 162c155..f19b7e4 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -231,7 +231,22 @@ BOOL WINAPI GetCursorInfo( PCURSORINFO pci ) */ BOOL WINAPI DECLSPEC_HOTPATCH SetCursorPos( INT x, INT y ) { - return USER_Driver->pSetCursorPos( x, y ); + BOOL ret; + + SERVER_START_REQ( set_cursor ) + { + req->flags = SET_CURSOR_POS; + req->x = x; + req->y = y; + if ((ret = !wine_server_call( req ))) + { + x = reply->new_x; + y = reply->new_y; + } + } + SERVER_END_REQ; + if (ret) ret = USER_Driver->pSetCursorPos( x, y ); + return ret; } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 2e940b7..63a6d9d 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4769,15 +4769,20 @@ struct set_cursor_request unsigned int flags; user_handle_t handle; int show_count; + int x; + int y; }; struct set_cursor_reply { struct reply_header __header; user_handle_t prev_handle; int prev_count; + int new_x; + int new_y; }; #define SET_CURSOR_HANDLE 0x01 #define SET_CURSOR_COUNT 0x02 +#define SET_CURSOR_POS 0x04 enum request @@ -5525,6 +5530,6 @@ union generic_reply struct set_cursor_reply set_cursor_reply; }; -#define SERVER_PROTOCOL_VERSION 412 +#define SERVER_PROTOCOL_VERSION 413 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index 728898f..be644b5 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3290,9 +3290,14 @@ enum coords_relative unsigned int flags; /* flags for fields to set (see below) */ user_handle_t handle; /* handle to the cursor */ int show_count; /* show count increment/decrement */ + int x; /* cursor position */ + int y; @REPLY user_handle_t prev_handle; /* previous handle */ int prev_count; /* previous show count */ + int new_x; /* new position */ + int new_y; @END #define SET_CURSOR_HANDLE 0x01 #define SET_CURSOR_COUNT 0x02 +#define SET_CURSOR_POS 0x04 diff --git a/server/queue.c b/server/queue.c index 7a25517..20e0fc0 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1237,8 +1237,9 @@ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_i /* find the window that should receive a given hardware message */ static user_handle_t find_hardware_message_window( struct thread_input *input, struct message *msg, - struct hardware_msg_data *data, unsigned int *msg_code ) + unsigned int *msg_code ) { + struct hardware_msg_data *data = msg->data; user_handle_t win = 0; *msg_code = msg->msg; @@ -1264,15 +1265,23 @@ static user_handle_t find_hardware_message_window( struct thread_input *input, s } /* queue a hardware message into a given thread input */ -static void queue_hardware_message( struct thread_input *input, struct message *msg, - struct hardware_msg_data *data ) +static void queue_hardware_message( struct desktop *desktop, struct thread_input *input, + struct message *msg ) { user_handle_t win; struct thread *thread; unsigned int msg_code; + struct hardware_msg_data *data = msg->data; + if (msg->msg == WM_MOUSEMOVE) + { + desktop->cursor_x = data->x; + desktop->cursor_y = data->y; + } + data->x = desktop->cursor_x; + data->y = desktop->cursor_y; last_input_time = get_tick_count(); - win = find_hardware_message_window( input, msg, data, &msg_code ); + win = find_hardware_message_window( input, msg, &msg_code ); if (!win || !(thread = get_window_thread(win))) { if (input) update_input_key_state( input, msg ); @@ -1361,7 +1370,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user struct hardware_msg_data *data = msg->data; ptr = list_next( &input->msg_list, ptr ); - win = find_hardware_message_window( input, msg, data, &msg_code ); + win = find_hardware_message_window( input, msg, &msg_code ); if (!win || !(win_thread = get_window_thread( win ))) { /* no window at all, remove it */ @@ -1748,7 +1757,7 @@ DECL_HANDLER(send_hardware_message) msg->result = NULL; msg->data = data; msg->data_size = sizeof(*data); - queue_hardware_message( input, msg, data ); + queue_hardware_message( desktop, input, msg ); } else free( data ); @@ -2286,10 +2295,17 @@ DECL_HANDLER(set_cursor) } input->cursor = req->handle; } - if (req->flags & SET_CURSOR_COUNT) { queue->cursor_count += req->show_count; input->cursor_count += req->show_count; } + if (req->flags & SET_CURSOR_POS) + { + input->desktop->cursor_x = req->x; + input->desktop->cursor_y = req->y; + } + + reply->new_x = input->desktop->cursor_x; + reply->new_y = input->desktop->cursor_y; } diff --git a/server/request.h b/server/request.h index ae45ab8..f1894c0 100644 --- a/server/request.h +++ b/server/request.h @@ -2100,10 +2100,14 @@ C_ASSERT( sizeof(struct free_user_handle_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_request, flags) == 12 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_request, handle) == 16 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_request, show_count) == 20 ); -C_ASSERT( sizeof(struct set_cursor_request) == 24 ); +C_ASSERT( FIELD_OFFSET(struct set_cursor_request, x) == 24 ); +C_ASSERT( FIELD_OFFSET(struct set_cursor_request, y) == 28 ); +C_ASSERT( sizeof(struct set_cursor_request) == 32 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, prev_handle) == 8 ); C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, prev_count) == 12 ); -C_ASSERT( sizeof(struct set_cursor_reply) == 16 ); +C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_x) == 16 ); +C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_y) == 20 ); +C_ASSERT( sizeof(struct set_cursor_reply) == 24 ); #endif /* WANT_REQUEST_HANDLERS */ diff --git a/server/trace.c b/server/trace.c index e01a3f1..5305cac 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3871,12 +3871,16 @@ static void dump_set_cursor_request( const struct set_cursor_request *req ) fprintf( stderr, " flags=%08x", req->flags ); fprintf( stderr, ", handle=%08x", req->handle ); fprintf( stderr, ", show_count=%d", req->show_count ); + fprintf( stderr, ", x=%d", req->x ); + fprintf( stderr, ", y=%d", req->y ); } static void dump_set_cursor_reply( const struct set_cursor_reply *req ) { fprintf( stderr, " prev_handle=%08x", req->prev_handle ); fprintf( stderr, ", prev_count=%d", req->prev_count ); + fprintf( stderr, ", new_x=%d", req->new_x ); + fprintf( stderr, ", new_y=%d", req->new_y ); } static const dump_func req_dumpers[REQ_NB_REQUESTS] = { diff --git a/server/user.h b/server/user.h index 708692a..4d39e40 100644 --- a/server/user.h +++ b/server/user.h @@ -63,6 +63,8 @@ struct desktop struct timeout_user *close_timeout; /* timeout before closing the desktop */ struct thread_input *foreground_input; /* thread input of foreground thread */ unsigned int users; /* processes and threads using this desktop */ + int cursor_x; /* cursor position */ + int cursor_y; }; /* user handles functions */ diff --git a/server/winstation.c b/server/winstation.c index b05efac..3d1ac3c 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -232,6 +232,8 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned desktop->close_timeout = NULL; desktop->foreground_input = NULL; desktop->users = 0; + desktop->cursor_x = 0; + desktop->cursor_y = 0; list_add_tail( &winstation->desktops, &desktop->entry ); } }
1
0
0
0
Alexandre Julliard : server: Make the foreground thread input per-desktop instead of global.
by Alexandre Julliard
25 Feb '11
25 Feb '11
Module: wine Branch: master Commit: ac4aac747c2153d903922102da337bd77475750e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac4aac747c2153d903922102d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 24 16:45:04 2011 +0100 server: Make the foreground thread input per-desktop instead of global. --- server/queue.c | 58 ++++++++++++++++++++++++++++++++++++--------------- server/user.h | 19 ++++++++-------- server/winstation.c | 1 + 3 files changed, 52 insertions(+), 26 deletions(-) diff --git a/server/queue.c b/server/queue.c index ae11901..7a25517 100644 --- a/server/queue.c +++ b/server/queue.c @@ -199,7 +199,6 @@ static const struct object_ops thread_input_ops = }; /* pointer to input structure of foreground thread */ -static struct thread_input *foreground_input; static unsigned int last_input_time; static void free_message( struct message *msg ); @@ -894,9 +893,12 @@ static void thread_input_destroy( struct object *obj ) { struct thread_input *input = (struct thread_input *)obj; - if (foreground_input == input) foreground_input = NULL; empty_msg_list( &input->msg_list ); - if (input->desktop) release_object( input->desktop ); + if (input->desktop) + { + if (input->desktop->foreground_input == input) input->desktop->foreground_input = NULL; + release_object( input->desktop ); + } } /* fix the thread input data when a window is destroyed */ @@ -1704,8 +1706,9 @@ DECL_HANDLER(send_hardware_message) { struct message *msg; struct thread *thread = NULL; + struct desktop *desktop = NULL; struct hardware_msg_data *data; - struct thread_input *input = foreground_input; + struct thread_input *input; if (req->id) { @@ -1717,15 +1720,18 @@ DECL_HANDLER(send_hardware_message) return; } input = thread->queue->input; + desktop = (struct desktop *)grab_object( input->desktop ); reply->cursor = input->cursor; reply->count = input->cursor_count; } - - if (!req->msg || !(data = mem_alloc( sizeof(*data) ))) + else { - if (thread) release_object( thread ); - return; + if (!(desktop = get_thread_desktop( current, 0 ))) return; + input = desktop->foreground_input; } + + if (!req->msg || !(data = mem_alloc( sizeof(*data) ))) goto done; + memset( data, 0, sizeof(*data) ); data->x = req->x; data->y = req->y; @@ -1746,7 +1752,9 @@ DECL_HANDLER(send_hardware_message) } else free( data ); +done: if (thread) release_object( thread ); + release_object( desktop ); } /* post a quit message to the current queue */ @@ -2035,14 +2043,24 @@ DECL_HANDLER(attach_thread_input) DECL_HANDLER(get_thread_input) { struct thread *thread = NULL; + struct desktop *desktop; struct thread_input *input; if (req->tid) { if (!(thread = get_thread_from_id( req->tid ))) return; + if (!(desktop = get_thread_desktop( thread, 0 ))) + { + release_object( thread ); + return; + } input = thread->queue ? thread->queue->input : NULL; } - else input = foreground_input; /* get the foreground thread info */ + else + { + if (!(desktop = get_thread_desktop( current, 0 ))) return; + input = desktop->foreground_input; /* get the foreground thread info */ + } if (input) { @@ -2058,8 +2076,9 @@ DECL_HANDLER(get_thread_input) } /* foreground window is active window of foreground thread */ - reply->foreground = foreground_input ? foreground_input->active : 0; + reply->foreground = desktop->foreground_input ? desktop->foreground_input->active : 0; if (thread) release_object( thread ); + release_object( desktop ); } @@ -2100,21 +2119,26 @@ DECL_HANDLER(set_key_state) /* set the system foreground window */ DECL_HANDLER(set_foreground_window) { - struct thread *thread; + struct thread *thread = NULL; + struct desktop *desktop; struct msg_queue *queue = get_current_queue(); - reply->previous = foreground_input ? foreground_input->active : 0; - reply->send_msg_old = (reply->previous && foreground_input != queue->input); + if (!(desktop = get_thread_desktop( current, 0 ))) return; + reply->previous = desktop->foreground_input ? desktop->foreground_input->active : 0; + reply->send_msg_old = (reply->previous && desktop->foreground_input != queue->input); reply->send_msg_new = FALSE; if (is_top_level_window( req->handle ) && - ((thread = get_window_thread( req->handle )))) + ((thread = get_window_thread( req->handle ))) && + (thread->queue->input->desktop == desktop)) { - foreground_input = thread->queue->input; - reply->send_msg_new = (foreground_input != queue->input); - release_object( thread ); + desktop->foreground_input = thread->queue->input; + reply->send_msg_new = (desktop->foreground_input != queue->input); } else set_win32_error( ERROR_INVALID_WINDOW_HANDLE ); + + if (thread) release_object( thread ); + release_object( desktop ); } diff --git a/server/user.h b/server/user.h index 6ac0398..708692a 100644 --- a/server/user.h +++ b/server/user.h @@ -53,15 +53,16 @@ struct winstation struct desktop { - struct object obj; /* object header */ - unsigned int flags; /* desktop flags */ - struct winstation *winstation; /* winstation this desktop belongs to */ - struct list entry; /* entry in winstation list of desktops */ - struct window *top_window; /* desktop window for this desktop */ - struct window *msg_window; /* HWND_MESSAGE top window */ - struct hook_table *global_hooks; /* table of global hooks on this desktop */ - struct timeout_user *close_timeout; /* timeout before closing the desktop */ - unsigned int users; /* processes and threads using this desktop */ + struct object obj; /* object header */ + unsigned int flags; /* desktop flags */ + struct winstation *winstation; /* winstation this desktop belongs to */ + struct list entry; /* entry in winstation list of desktops */ + struct window *top_window; /* desktop window for this desktop */ + struct window *msg_window; /* HWND_MESSAGE top window */ + struct hook_table *global_hooks; /* table of global hooks on this desktop */ + struct timeout_user *close_timeout; /* timeout before closing the desktop */ + struct thread_input *foreground_input; /* thread input of foreground thread */ + unsigned int users; /* processes and threads using this desktop */ }; /* user handles functions */ diff --git a/server/winstation.c b/server/winstation.c index 7ddc277..b05efac 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -230,6 +230,7 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned desktop->msg_window = NULL; desktop->global_hooks = NULL; desktop->close_timeout = NULL; + desktop->foreground_input = NULL; desktop->users = 0; list_add_tail( &winstation->desktops, &desktop->entry ); }
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
68
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
63
64
65
66
67
68
Results per page:
10
25
50
100
200