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
July
June
May
April
March
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
September 2016
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
430 discussions
Start a n
N
ew thread
Matteo Bruni : wined3d: Update the Mesa d3d level detection hack.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: ae2aa2df59966e0aeb05980064b6392a8d1f18c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ae2aa2df59966e0aeb0598006…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Thu Sep 22 20:39:38 2016 +0200 wined3d: Update the Mesa d3d level detection hack. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 6b019b6..a9a2922 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1737,16 +1737,13 @@ static enum wined3d_d3d_level d3d_level_from_caps(const struct shader_caps *shad if (shader_caps->vs_version >= 5) return WINED3D_D3D_LEVEL_11; if (shader_caps->vs_version == 4) - { - /* No backed supports SM 5 at the moment */ - if (glsl_version >= MAKEDWORD_VERSION(4, 00)) - return WINED3D_D3D_LEVEL_11; return WINED3D_D3D_LEVEL_10; - } if (shader_caps->vs_version == 3) { - /* Wine cannot use SM 4 on mesa drivers as the necessary functionality - * is not exposed on compatibility contexts */ + /* wined3d with default settings at the moment doesn't expose SM4+ on + * Mesa drivers. */ + if (glsl_version >= MAKEDWORD_VERSION(4, 30)) + return WINED3D_D3D_LEVEL_11; if (glsl_version >= MAKEDWORD_VERSION(1, 30)) return WINED3D_D3D_LEVEL_10; return WINED3D_D3D_LEVEL_9_SM3;
1
0
0
0
Matteo Bruni : wined3d: Fix a bunch of typos.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: d1bc192b294a16a3ded1f64d350e31b8a92e27e0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d1bc192b294a16a3ded1f64d3…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Thu Sep 22 20:39:37 2016 +0200 wined3d: Fix a bunch of typos. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 6 +++--- dlls/wined3d/state.c | 2 +- dlls/wined3d/utils.c | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index f5311af..b5a4589 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -551,7 +551,7 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context, rt_texture = render_targets[i]->container; TRACE(" Color attachment %u: %p format %s, %s %u, %ux%u, %u samples.\n", i, render_targets[i], debug_d3dformat(rt_texture->resource.format->id), - context->fbo_key->rb_namespace & (1 << (i + 1)) ? "renderbuffer" : "texure", + context->fbo_key->rb_namespace & (1 << (i + 1)) ? "renderbuffer" : "texture", context->fbo_key->objects[i + 1].object, wined3d_texture_get_level_pow2_width(rt_texture, render_targets[i]->texture_level), wined3d_texture_get_level_pow2_height(rt_texture, render_targets[i]->texture_level), @@ -563,7 +563,7 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context, ds_texture = depth_stencil->container; TRACE(" Depth attachment: %p format %s, %s %u, %ux%u, %u samples.\n", depth_stencil, debug_d3dformat(ds_texture->resource.format->id), - context->fbo_key->rb_namespace & (1 << 0) ? "renderbuffer" : "texure", + context->fbo_key->rb_namespace & (1 << 0) ? "renderbuffer" : "texture", context->fbo_key->objects[0].object, wined3d_texture_get_level_pow2_width(ds_texture, depth_stencil->texture_level), wined3d_texture_get_level_pow2_height(ds_texture, depth_stencil->texture_level), @@ -1920,7 +1920,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment); checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);"); gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, device->surface_alignment);"); + checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, 1);"); if (gl_info->supported[ARB_VERTEX_BLEND]) { diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 9bdc773..1b0d018 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3662,7 +3662,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state { /* Note that WINED3D_SAMP_MAX_MIP_LEVEL specifies the largest mipmap * (default 0), while GL_TEXTURE_MAX_LEVEL specifies the smallest - * mimap used (default 1000). So WINED3D_SAMP_MAX_MIP_LEVEL + * mipmap used (default 1000). So WINED3D_SAMP_MAX_MIP_LEVEL * corresponds to GL_TEXTURE_BASE_LEVEL. */ gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, base_level); gl_tex->base_level = base_level; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index cf909de..aa654ff 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1882,8 +1882,7 @@ static void create_and_bind_fbo_attachment(const struct wined3d_gl_info *gl_info case WINED3D_GL_RES_TYPE_TEX_3D: gl_info->gl_ops.gl.p_glGenTextures(1, object); gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, *object); - GL_EXTCALL(glTexImage3D)(GL_TEXTURE_3D, 0, internal, 16, 16, 16, 0, - format, type, NULL); + GL_EXTCALL(glTexImage3D(GL_TEXTURE_3D, 0, internal, 16, 16, 16, 0, format, type, NULL)); gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -2321,7 +2320,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for } delete_fbo_attachment(gl_info, type, object); - checkGLcall("Framebuffer format check cleaup"); + checkGLcall("Framebuffer format check cleanup"); } if (fallback_fmt_used && regular_fmt_used)
1
0
0
0
Huw Davies : wordpad: Only read up to the maximum number of recent files from the menu.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: 9b701eb7eb2fad167516e1759591eb2233977a21 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b701eb7eb2fad167516e1759…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 23 12:01:28 2016 +0100 wordpad: Only read up to the maximum number of recent files from the menu. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/wordpad/registry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/wordpad/registry.c b/programs/wordpad/registry.c index 6f7f14b..1381116 100644 --- a/programs/wordpad/registry.c +++ b/programs/wordpad/registry.c @@ -283,7 +283,7 @@ void registry_set_filelist(LPCWSTR newFile, HWND hMainWnd) for(i = 0; i < FILELIST_ENTRIES; i++) pFiles[i] = NULL; - for(i = 0; GetMenuItemInfoW(hMenu, ID_FILE_RECENT1+i, FALSE, &mi); i++) + for(i = 0; i < FILELIST_ENTRIES && GetMenuItemInfoW(hMenu, ID_FILE_RECENT1+i, FALSE, &mi); i++) pFiles[i] = (LPWSTR)mi.dwItemData; if(lstrcmpiW(newFile, pFiles[0]))
1
0
0
0
Michael Stefaniuc : jscript: Add more jsdisp_t to Instance helpers.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: 7af3f651888944a9d9df4636e273814bbb066ea1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7af3f651888944a9d9df4636e…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Sep 22 10:00:36 2016 +0200 jscript: Add more jsdisp_t to Instance helpers. Signed-off-by: Michael Stefaniuc <mstefani(a)redhat.de> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/bool.c | 14 ++++++++++++-- dlls/jscript/vbarray.c | 9 +++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/dlls/jscript/bool.c b/dlls/jscript/bool.c index 7cd0c21..75c98c2 100644 --- a/dlls/jscript/bool.c +++ b/dlls/jscript/bool.c @@ -34,15 +34,25 @@ typedef struct { static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; +static inline BoolInstance *bool_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, BoolInstance, dispex); +} + +static inline BoolInstance *bool_from_vdisp(vdisp_t *vdisp) +{ + return bool_from_jsdisp(vdisp->u.jsdisp); +} + static inline BoolInstance *bool_this(vdisp_t *jsthis) { - return is_vclass(jsthis, JSCLASS_BOOLEAN) ? (BoolInstance*)jsthis->u.jsdisp : NULL; + return is_vclass(jsthis, JSCLASS_BOOLEAN) ? bool_from_vdisp(jsthis) : NULL; } BOOL bool_obj_value(jsdisp_t *obj) { assert(is_class(obj, JSCLASS_BOOLEAN)); - return ((BoolInstance*)obj)->val; + return bool_from_jsdisp(obj)->val; } /* ECMA-262 3rd Edition 15.6.4.2 */ diff --git a/dlls/jscript/vbarray.c b/dlls/jscript/vbarray.c index f374fb0..2312228 100644 --- a/dlls/jscript/vbarray.c +++ b/dlls/jscript/vbarray.c @@ -34,9 +34,14 @@ static const WCHAR lboundW[] = {'l','b','o','u','n','d',0}; static const WCHAR toArrayW[] = {'t','o','A','r','r','a','y',0}; static const WCHAR uboundW[] = {'u','b','o','u','n','d',0}; +static inline VBArrayInstance *vbarray_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, VBArrayInstance, dispex); +} + static inline VBArrayInstance *vbarray_from_vdisp(vdisp_t *vdisp) { - return CONTAINING_RECORD(vdisp->u.jsdisp, VBArrayInstance, dispex); + return vbarray_from_jsdisp(vdisp->u.jsdisp); } static inline VBArrayInstance *vbarray_this(vdisp_t *jsthis) @@ -236,7 +241,7 @@ static HRESULT VBArray_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns static void VBArray_destructor(jsdisp_t *dispex) { - VBArrayInstance *vbarray = (VBArrayInstance*)dispex; + VBArrayInstance *vbarray = vbarray_from_jsdisp(dispex); SafeArrayDestroy(vbarray->safearray); heap_free(vbarray);
1
0
0
0
Michael Stefaniuc : jscript: Use the existing helpers to get from a jsdisp_t to an Instance.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: 55f6e3c350e35d6bdbadf58bdbacd97b9f26075e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=55f6e3c350e35d6bdbadf58bd…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Sep 22 09:56:28 2016 +0200 jscript: Use the existing helpers to get from a jsdisp_t to an Instance. Signed-off-by: Michael Stefaniuc <mstefani(a)redhat.de> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/array.c | 6 +++--- dlls/jscript/date.c | 2 +- dlls/jscript/function.c | 14 +++++++------- dlls/jscript/jsregexp.c | 10 +++++----- dlls/jscript/string.c | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index eda49cb..d17b605 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -103,7 +103,7 @@ static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, static HRESULT set_length(jsdisp_t *obj, DWORD length) { if(is_class(obj, JSCLASS_ARRAY)) { - ((ArrayInstance*)obj)->length = length; + array_from_jsdisp(obj)->length = length; return S_OK; } @@ -191,7 +191,7 @@ static HRESULT concat_obj(jsdisp_t *array, IDispatch *obj, DWORD *len) jsobj = iface_to_jsdisp(obj); if(jsobj) { if(is_class(jsobj, JSCLASS_ARRAY)) { - hres = concat_array(array, (ArrayInstance*)jsobj, len); + hres = concat_array(array, array_from_jsdisp(jsobj), len); jsdisp_release(jsobj); return hres; } @@ -1022,7 +1022,7 @@ static void Array_destructor(jsdisp_t *dispex) static void Array_on_put(jsdisp_t *dispex, const WCHAR *name) { - ArrayInstance *array = (ArrayInstance*)dispex; + ArrayInstance *array = array_from_jsdisp(dispex); const WCHAR *ptr = name; DWORD id = 0; diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index a66a286..21a359a 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -2424,7 +2424,7 @@ static HRESULT DateConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, if(FAILED(hres)) return hres; - di = (DateInstance*)date; + di = date_from_jsdisp(date); di->time = utc(di->time, di); } } diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 04dcb18..8480a3b 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -81,7 +81,7 @@ static HRESULT Arguments_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u static void Arguments_destructor(jsdisp_t *jsdisp) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); TRACE("(%p)\n", arguments); @@ -98,7 +98,7 @@ static void Arguments_destructor(jsdisp_t *jsdisp) static unsigned Arguments_idx_length(jsdisp_t *jsdisp) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); return arguments->argc; } @@ -113,7 +113,7 @@ static jsval_t *get_argument_ref(ArgumentsInstance *arguments, unsigned idx) static HRESULT Arguments_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); jsval_t *ref; TRACE("%p[%u]\n", arguments, idx); @@ -127,7 +127,7 @@ static HRESULT Arguments_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) static HRESULT Arguments_idx_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); jsval_t *ref; HRESULT hres; @@ -327,7 +327,7 @@ HRESULT Function_invoke(jsdisp_t *func_this, IDispatch *jsthis, WORD flags, unsi TRACE("func %p this %p\n", func_this, jsthis); assert(is_class(func_this, JSCLASS_FUNCTION)); - function = (FunctionInstance*)func_this; + function = function_from_jsdisp(func_this); flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; if(function->value_proc) @@ -530,7 +530,7 @@ HRESULT Function_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned return E_FAIL; } - function = (FunctionInstance*)jsthis->u.jsdisp; + function = function_from_jsdisp(jsthis->u.jsdisp); assert(function->value_proc != NULL); return invoke_value_proc(ctx, function, NULL, flags, argc, argv, r); @@ -577,7 +577,7 @@ static HRESULT Function_get_arguments(script_ctx_t *ctx, jsdisp_t *jsthis, jsval static void Function_destructor(jsdisp_t *dispex) { - FunctionInstance *This = (FunctionInstance*)dispex; + FunctionInstance *This = function_from_jsdisp(dispex); if(This->code) release_bytecode(This->code); diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index a9924ee..5798635 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -125,7 +125,7 @@ static HRESULT do_regexp_match_next(script_ctx_t *ctx, RegExpInstance *regexp, HRESULT regexp_match_next(script_ctx_t *ctx, jsdisp_t *dispex, DWORD rem_flags, jsstr_t *jsstr, match_state_t **ret) { - RegExpInstance *regexp = (RegExpInstance*)dispex; + RegExpInstance *regexp = regexp_from_jsdisp(dispex); match_state_t *match; heap_pool_t *mark; const WCHAR *str; @@ -182,7 +182,7 @@ HRESULT regexp_match_next(script_ctx_t *ctx, jsdisp_t *dispex, static HRESULT regexp_match(script_ctx_t *ctx, jsdisp_t *dispex, jsstr_t *jsstr, BOOL gflag, match_result_t **match_result, DWORD *result_cnt) { - RegExpInstance *This = (RegExpInstance*)dispex; + RegExpInstance *This = regexp_from_jsdisp(dispex); match_result_t *ret = NULL; match_state_t *result; DWORD i=0, ret_size = 0; @@ -596,7 +596,7 @@ static HRESULT RegExp_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi static void RegExp_destructor(jsdisp_t *dispex) { - RegExpInstance *This = (RegExpInstance*)dispex; + RegExpInstance *This = regexp_from_jsdisp(dispex); if(This->jsregexp) regexp_destroy(This->jsregexp); @@ -708,7 +708,7 @@ HRESULT create_regexp_var(script_ctx_t *ctx, jsval_t src_arg, jsval_t *flags_arg obj = iface_to_jsdisp(get_object(src_arg)); if(obj) { if(is_class(obj, JSCLASS_REGEXP)) { - RegExpInstance *regexp = (RegExpInstance*)obj; + RegExpInstance *regexp = regexp_from_jsdisp(obj); hres = create_regexp(ctx, regexp->str, regexp->jsregexp->flags, ret); jsdisp_release(obj); @@ -754,7 +754,7 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, jsstr_t *jsstr, jsv static const WCHAR inputW[] = {'i','n','p','u','t',0}; static const WCHAR lastIndexW[] = {'l','a','s','t','I','n','d','e','x',0}; - RegExpInstance *regexp = (RegExpInstance*)re; + RegExpInstance *regexp = regexp_from_jsdisp(re); match_result_t *match_result; unsigned match_cnt, i; const WCHAR *str; diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index b5c0197..ad978f2 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -111,7 +111,7 @@ static HRESULT get_string_flat_val(script_ctx_t *ctx, vdisp_t *jsthis, jsstr_t * static HRESULT String_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { - StringInstance *string = (StringInstance*)jsthis; + StringInstance *string = string_from_jsdisp(jsthis); TRACE("%p\n", jsthis); @@ -1480,7 +1480,7 @@ static HRESULT String_localeCompare(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla static HRESULT String_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { - StringInstance *This = (StringInstance*)jsthis; + StringInstance *This = string_from_jsdisp(jsthis); TRACE("\n"); @@ -1490,7 +1490,7 @@ static HRESULT String_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) static void String_destructor(jsdisp_t *dispex) { - StringInstance *This = (StringInstance*)dispex; + StringInstance *This = string_from_jsdisp(dispex); jsstr_release(This->str); heap_free(This); @@ -1498,7 +1498,7 @@ static void String_destructor(jsdisp_t *dispex) static unsigned String_idx_length(jsdisp_t *jsdisp) { - StringInstance *string = (StringInstance*)jsdisp; + StringInstance *string = string_from_jsdisp(jsdisp); /* * NOTE: For invoke version < 2, indexed array is not implemented at all. @@ -1512,7 +1512,7 @@ static unsigned String_idx_length(jsdisp_t *jsdisp) static HRESULT String_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) { - StringInstance *string = (StringInstance*)jsdisp; + StringInstance *string = string_from_jsdisp(jsdisp); jsstr_t *ret; ret = jsstr_substr(string->str, idx, 1);
1
0
0
0
Alexandre Julliard : server: Get rid of the clipboard sequence number update hack.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: 99408d78597027e709fba465f3effd4bbdf2740f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=99408d78597027e709fba465f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 23 14:16:56 2016 +0900 server: Get rid of the clipboard sequence number update hack. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/clipboard.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/server/clipboard.c b/server/clipboard.c index 43172ae..189bef2 100644 --- a/server/clipboard.c +++ b/server/clipboard.c @@ -46,7 +46,6 @@ struct clipboard user_handle_t viewer; /* first window in clipboard viewer list */ unsigned int seqno; /* clipboard change sequence number */ unsigned int open_seqno; /* sequence number at open time */ - timeout_t seqno_timestamp; /* time stamp of last seqno increment */ unsigned int listen_size; /* size of listeners array */ unsigned int listen_count; /* count of listeners */ user_handle_t *listeners; /* array of listener windows */ @@ -78,8 +77,6 @@ static const struct object_ops clipboard_ops = }; -#define MINUPDATELAPSE (2 * TICKS_PER_SEC) - /* dump a clipboard object */ static void clipboard_dump( struct object *obj, int verbose ) { @@ -115,7 +112,6 @@ static struct clipboard *get_process_clipboard(void) clipboard->owner_win = 0; clipboard->viewer = 0; clipboard->seqno = 0; - clipboard->seqno_timestamp = 0; clipboard->listen_size = 0; clipboard->listen_count = 0; clipboard->listeners = NULL; @@ -244,17 +240,6 @@ static int release_clipboard_owner( struct clipboard *clipboard, user_handle_t w } -static int get_seqno( struct clipboard *clipboard ) -{ - if (!clipboard->owner_thread && (current_time - clipboard->seqno_timestamp > MINUPDATELAPSE)) - { - clipboard->seqno_timestamp = current_time; - clipboard->seqno++; - } - return clipboard->seqno; -} - - /* open the clipboard */ DECL_HANDLER(open_clipboard) { @@ -314,7 +299,7 @@ DECL_HANDLER(set_clipboard_info) if (req->flags & SET_CB_SEQNO) clipboard->seqno++; - reply->seqno = get_seqno( clipboard ); + reply->seqno = clipboard->seqno; if (clipboard->open_thread) reply->flags |= CB_OPEN_ANY; if (clipboard->open_thread == current) reply->flags |= CB_OPEN; @@ -371,7 +356,7 @@ DECL_HANDLER(get_clipboard_info) reply->window = clipboard->open_win; reply->owner = clipboard->owner_win; reply->viewer = clipboard->viewer; - reply->seqno = get_seqno( clipboard ); + reply->seqno = clipboard->seqno; }
1
0
0
0
Alexandre Julliard : winex11: Implement the UpdateClipboard entry point to refresh the cache.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: adf96003a50a42b074ddb8c33c79052414d73db4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=adf96003a50a42b074ddb8c33…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 23 14:07:59 2016 +0900 winex11: Implement the UpdateClipboard entry point to refresh the cache. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 74 +++++++++++---------------------------- dlls/winex11.drv/winex11.drv.spec | 1 + 2 files changed, 22 insertions(+), 53 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 9e1c8a3..cc4f92f 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -95,6 +95,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipboard); #define SELECTION_RETRIES 500 /* wait for .5 seconds */ #define SELECTION_WAIT 1000 /* us */ +#define SELECTION_UPDATE_DELAY 2000 /* delay between checks of the X11 selection */ + /* Selection masks */ #define S_NOSELECTION 0 #define S_PRIMARY 1 @@ -224,10 +226,6 @@ static unsigned int nb_current_x11_formats; static struct list data_list = LIST_INIT( data_list ); static UINT ClipDataCount = 0; -/* - * Clipboard sequence number - */ -static UINT wSeqNo = 0; /************************************************************************** * Internal Clipboard implementation methods @@ -587,39 +585,6 @@ static void X11DRV_CLIPBOARD_FreeData(LPWINE_CLIPDATA lpData) /************************************************************************** - * X11DRV_CLIPBOARD_UpdateCache - */ -static BOOL X11DRV_CLIPBOARD_UpdateCache(void) -{ - BOOL bret = TRUE; - - if (!selectionAcquired) - { - DWORD seqno = GetClipboardSequenceNumber(); - - if (!seqno) - { - ERR("Failed to retrieve clipboard information.\n"); - bret = FALSE; - } - else if (wSeqNo < seqno) - { - empty_clipboard(); - - if (X11DRV_CLIPBOARD_QueryAvailableData(thread_init_display()) < 0) - { - ERR("Failed to cache clipboard data owned by another process.\n"); - bret = FALSE; - } - wSeqNo = seqno; - } - } - - return bret; -} - - -/************************************************************************** * X11DRV_CLIPBOARD_RenderFormat */ static BOOL X11DRV_CLIPBOARD_RenderFormat(Display *display, LPWINE_CLIPDATA lpData) @@ -2379,8 +2344,6 @@ void CDECL X11DRV_EmptyClipboard(void) */ BOOL CDECL X11DRV_SetClipboardData(UINT wFormat, HANDLE hData, BOOL owner) { - if (!owner) X11DRV_CLIPBOARD_UpdateCache(); - return X11DRV_CLIPBOARD_InsertClipboardData( wFormat, hData ); } @@ -2390,10 +2353,6 @@ BOOL CDECL X11DRV_SetClipboardData(UINT wFormat, HANDLE hData, BOOL owner) */ INT CDECL X11DRV_CountClipboardFormats(void) { - X11DRV_CLIPBOARD_UpdateCache(); - - TRACE(" count=%d\n", ClipDataCount); - return ClipDataCount; } @@ -2405,10 +2364,6 @@ UINT CDECL X11DRV_EnumClipboardFormats(UINT wFormat) { struct list *ptr = NULL; - TRACE("(%04X)\n", wFormat); - - X11DRV_CLIPBOARD_UpdateCache(); - if (!wFormat) { ptr = list_head( &data_list ); @@ -2431,10 +2386,6 @@ BOOL CDECL X11DRV_IsClipboardFormatAvailable(UINT wFormat) { BOOL bRet = FALSE; - TRACE("(%04X)\n", wFormat); - - X11DRV_CLIPBOARD_UpdateCache(); - if (wFormat != 0 && X11DRV_CLIPBOARD_LookupData(wFormat)) bRet = TRUE; @@ -2453,8 +2404,6 @@ HANDLE CDECL X11DRV_GetClipboardData(UINT wFormat) TRACE("(%04X)\n", wFormat); - X11DRV_CLIPBOARD_UpdateCache(); - if ((lpRender = X11DRV_CLIPBOARD_LookupData(wFormat))) { if ( !lpRender->hData ) @@ -2469,6 +2418,25 @@ HANDLE CDECL X11DRV_GetClipboardData(UINT wFormat) /************************************************************************** + * X11DRV_UpdateClipboard + */ +void CDECL X11DRV_UpdateClipboard(void) +{ + static ULONG last_update; + ULONG now; + + if (selectionAcquired) return; + now = GetTickCount(); + if ((int)(now - last_update) <= SELECTION_UPDATE_DELAY) return; + last_update = now; + + empty_clipboard(); + if (X11DRV_CLIPBOARD_QueryAvailableData(thread_init_display()) < 0) + ERR("Failed to cache clipboard data owned by another process.\n"); +} + + +/************************************************************************** * ResetSelectionOwner * * Called when the thread owning the selection is destroyed and we need to diff --git a/dlls/winex11.drv/winex11.drv.spec b/dlls/winex11.drv/winex11.drv.spec index 54afd83..a3e847c 100644 --- a/dlls/winex11.drv/winex11.drv.spec +++ b/dlls/winex11.drv/winex11.drv.spec @@ -47,6 +47,7 @@ @ cdecl SetWindowText(long wstr) X11DRV_SetWindowText @ cdecl ShowWindow(long long ptr long) X11DRV_ShowWindow @ cdecl SysCommand(long long long) X11DRV_SysCommand +@ cdecl UpdateClipboard() X11DRV_UpdateClipboard @ cdecl UpdateLayeredWindow(long ptr ptr) X11DRV_UpdateLayeredWindow @ cdecl WindowMessage(long long long long) X11DRV_WindowMessage @ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) X11DRV_WindowPosChanging
1
0
0
0
Alexandre Julliard : user32: Add an UpdateClipboard entry point to allow the driver to refresh the clipboard before it 's open.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: 11c3867349be49768f1364453fff8b7e4f912098 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=11c3867349be49768f1364453…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 23 14:07:08 2016 +0900 user32: Add an UpdateClipboard entry point to allow the driver to refresh the clipboard before it's open. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/clipboard.c | 14 ++++++++++++-- dlls/user32/driver.c | 12 ++++++++++++ dlls/user32/user_private.h | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index 1693aae..43729e6 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -523,6 +523,8 @@ BOOL WINAPI OpenClipboard( HWND hwnd ) TRACE( "%p\n", hwnd ); + USER_Driver->pUpdateClipboard(); + SERVER_START_REQ( open_clipboard ) { req->window = wine_server_user_handle( hwnd ); @@ -759,7 +761,11 @@ HANDLE WINAPI SetClipboardData( UINT format, HANDLE data ) */ INT WINAPI CountClipboardFormats(void) { - INT count = USER_Driver->pCountClipboardFormats(); + INT count; + + USER_Driver->pUpdateClipboard(); + + count = USER_Driver->pCountClipboardFormats(); TRACE("returning %d\n", count); return count; } @@ -790,7 +796,11 @@ UINT WINAPI EnumClipboardFormats( UINT format ) */ BOOL WINAPI IsClipboardFormatAvailable( UINT format ) { - BOOL ret = USER_Driver->pIsClipboardFormatAvailable( format ); + BOOL ret; + + USER_Driver->pUpdateClipboard(); + + ret = USER_Driver->pIsClipboardFormatAvailable( format ); TRACE( "%s -> %u\n", debugstr_format( format ), ret ); return ret; } diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 32acf28..1745b50 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -128,6 +128,7 @@ static const USER_DRIVER *load_driver(void) GET_USER_FUNC(EnumClipboardFormats); GET_USER_FUNC(IsClipboardFormatAvailable); GET_USER_FUNC(EndClipboardUpdate); + GET_USER_FUNC(UpdateClipboard); GET_USER_FUNC(ChangeDisplaySettingsEx); GET_USER_FUNC(EnumDisplayMonitors); GET_USER_FUNC(EnumDisplaySettingsEx); @@ -369,6 +370,10 @@ static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL own return FALSE; } +static void CDECL nulldrv_UpdateClipboard(void) +{ +} + static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd, DWORD flags, LPVOID lparam ) { @@ -548,6 +553,7 @@ static USER_DRIVER null_driver = nulldrv_GetClipboardData, nulldrv_IsClipboardFormatAvailable, nulldrv_SetClipboardData, + nulldrv_UpdateClipboard, /* display modes */ nulldrv_ChangeDisplaySettingsEx, nulldrv_EnumDisplayMonitors, @@ -716,6 +722,11 @@ static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE handle, BOOL o return load_driver()->pSetClipboardData( format, handle, owner ); } +static void CDECL loaderdrv_UpdateClipboard(void) +{ + load_driver()->pUpdateClipboard(); +} + static LONG CDECL loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd, DWORD flags, LPVOID lparam ) { @@ -805,6 +816,7 @@ static USER_DRIVER lazy_load_driver = loaderdrv_GetClipboardData, loaderdrv_IsClipboardFormatAvailable, loaderdrv_SetClipboardData, + loaderdrv_UpdateClipboard, /* display modes */ loaderdrv_ChangeDisplaySettingsEx, loaderdrv_EnumDisplayMonitors, diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index c8b283a..3b9b200 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -87,6 +87,7 @@ typedef struct tagUSER_DRIVER { HANDLE (CDECL *pGetClipboardData)(UINT); /* Get specified selection data */ BOOL (CDECL *pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */ BOOL (CDECL *pSetClipboardData)(UINT, HANDLE, BOOL); /* Set specified selection data */ + void (CDECL *pUpdateClipboard)(void); /* display modes */ LONG (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID); BOOL (CDECL *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM);
1
0
0
0
Alexandre Julliard : winex11: Store the list of X11 formats when retrieving the TARGETS property.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: a502a36af8a45ce355bf21c0df0360b2cf422c6b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a502a36af8a45ce355bf21c0d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 23 20:28:28 2016 +0900 winex11: Store the list of X11 formats when retrieving the TARGETS property. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 93 +++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 49 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index f139586..9e1c8a3 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -118,8 +118,6 @@ typedef struct tagWINE_CLIPDATA { struct list entry; UINT wFormatID; HANDLE hData; - UINT drvData; - LPWINE_CLIPFORMAT lpFormat; } WINE_CLIPDATA, *LPWINE_CLIPDATA; static int selectionAcquired = 0; /* Contains the current selection masks */ @@ -216,6 +214,9 @@ static struct list format_list = LIST_INIT( format_list ); #define NB_BUILTIN_FORMATS (sizeof(builtin_formats) / sizeof(builtin_formats[0])) #define GET_ATOM(prop) (((prop) < FIRST_XATOM) ? (Atom)(prop) : X11DRV_Atoms[(prop) - FIRST_XATOM]) +static struct clipboard_format **current_x11_formats; +static unsigned int nb_current_x11_formats; + /* * Cached clipboard data. @@ -523,16 +524,11 @@ static BOOL X11DRV_CLIPBOARD_ReleaseOwnership(void) * * Caller *must* have the clipboard open and be the owner. */ -static BOOL X11DRV_CLIPBOARD_InsertClipboardData(UINT wFormatID, HANDLE hData, - LPWINE_CLIPFORMAT lpFormat, BOOL override) +static BOOL X11DRV_CLIPBOARD_InsertClipboardData( UINT wFormatID, HANDLE hData ) { LPWINE_CLIPDATA lpData = X11DRV_CLIPBOARD_LookupData(wFormatID); - TRACE("format=%04x lpData=%p hData=%p lpFormat=%p override=%d\n", - wFormatID, lpData, hData, lpFormat, override); - - if (lpData && !override) - return TRUE; + TRACE("format=%04x lpData=%p hData=%p\n", wFormatID, lpData, hData); if (lpData) { @@ -546,8 +542,6 @@ static BOOL X11DRV_CLIPBOARD_InsertClipboardData(UINT wFormatID, HANDLE hData, lpData->wFormatID = wFormatID; lpData->hData = hData; - lpData->lpFormat = lpFormat; - lpData->drvData = 0; list_add_tail( &data_list, &lpData->entry ); ClipDataCount++; @@ -575,10 +569,6 @@ static void X11DRV_CLIPBOARD_FreeData(LPWINE_CLIPDATA lpData) case CF_PALETTE: DeleteObject(lpData->hData); break; - case CF_DIB: - if (lpData->drvData) XFreePixmap(gdi_display, lpData->drvData); - GlobalFree(lpData->hData); - break; case CF_METAFILEPICT: case CF_DSPMETAFILEPICT: DeleteMetaFile(((METAFILEPICT *)GlobalLock( lpData->hData ))->hMF ); @@ -593,7 +583,6 @@ static void X11DRV_CLIPBOARD_FreeData(LPWINE_CLIPDATA lpData) break; } lpData->hData = 0; - lpData->drvData = 0; } @@ -1245,14 +1234,19 @@ static HANDLE import_text_uri_list( Atom type, const void *data, size_t size ) */ static HANDLE import_targets( Atom type, const void *data, size_t size ) { - UINT i, count = size / sizeof(Atom); + UINT i, pos, count = size / sizeof(Atom); const Atom *properties = data; - struct clipboard_format *format; + struct clipboard_format *format, **formats; if (type != XA_ATOM && type != x11drv_atom(TARGETS)) return 0; register_x11_formats( properties, count ); + /* the builtin formats contain duplicates, so allocate some extra space */ + if (!(formats = HeapAlloc( GetProcessHeap(), 0, (count + NB_BUILTIN_FORMATS) * sizeof(*formats )))) + return 0; + + pos = 0; LIST_FOR_EACH_ENTRY( format, &format_list, struct clipboard_format, entry ) { for (i = 0; i < count; i++) if (properties[i] == format->atom) break; @@ -1261,10 +1255,15 @@ static HANDLE import_targets( Atom type, const void *data, size_t size ) { TRACE( "property %s -> format %s\n", debugstr_xatom( properties[i] ), debugstr_format( format->id )); - X11DRV_CLIPBOARD_InsertClipboardData( format->id, 0, format, FALSE ); + X11DRV_CLIPBOARD_InsertClipboardData( format->id, 0 ); + formats[pos++] = format; } else TRACE( "property %s (ignoring)\n", debugstr_xatom( properties[i] )); } + + HeapFree( GetProcessHeap(), 0, current_x11_formats ); + current_x11_formats = formats; + nb_current_x11_formats = pos; return (HANDLE)1; } @@ -1344,6 +1343,25 @@ void X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom select /************************************************************************** + * render_format + */ +static BOOL render_format( Display *display, Window win, Atom selection, UINT id ) +{ + unsigned int i; + HANDLE handle = 0; + + for (i = 0; i < nb_current_x11_formats; i++) + { + if (current_x11_formats[i]->id != id) continue; + handle = import_selection( display, win, selection, current_x11_formats[i] ); + break; + } + if (handle) X11DRV_CLIPBOARD_InsertClipboardData( id, handle ); + return handle != 0; +} + + +/************************************************************************** * export_data * * Generic export clipboard data routine. @@ -1944,12 +1962,12 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) /* Selection Owner doesn't understand TARGETS, try retrieving XA_STRING */ if (use_primary_selection && (handle = import_selection( display, w, XA_PRIMARY, format ))) { - X11DRV_CLIPBOARD_InsertClipboardData( format->id, handle, format, TRUE ); + X11DRV_CLIPBOARD_InsertClipboardData( format->id, handle ); selectionCacheSrc = XA_PRIMARY; } else if ((handle = import_selection( display, w, x11drv_atom(CLIPBOARD), format ))) { - X11DRV_CLIPBOARD_InsertClipboardData( format->id, handle, format, TRUE ); + X11DRV_CLIPBOARD_InsertClipboardData( format->id, handle ); selectionCacheSrc = x11drv_atom(CLIPBOARD); } else @@ -1974,37 +1992,14 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) */ static BOOL X11DRV_CLIPBOARD_ReadSelectionData(Display *display, LPWINE_CLIPDATA lpData) { - BOOL bRet = FALSE; - HANDLE hData; + Window w = thread_selection_wnd(); - if (!lpData->lpFormat) + if (!w) { - ERR("Requesting format %04x but no source format linked to data.\n", - lpData->wFormatID); + ERR("No window available to read selection data!\n"); return FALSE; } - - if (!selectionAcquired) - { - Window w = thread_selection_wnd(); - if(!w) - { - ERR("No window available to read selection data!\n"); - return FALSE; - } - - hData = import_selection( display, w, selectionCacheSrc, lpData->lpFormat ); - if (hData) - bRet = X11DRV_CLIPBOARD_InsertClipboardData(lpData->wFormatID, hData, lpData->lpFormat, TRUE); - } - else - { - ERR("Received request to cache selection data but process is owner\n"); - } - - TRACE("Returning %d\n", bRet); - - return bRet; + return render_format( display, w, selectionCacheSrc, lpData->wFormatID ); } @@ -2386,7 +2381,7 @@ BOOL CDECL X11DRV_SetClipboardData(UINT wFormat, HANDLE hData, BOOL owner) { if (!owner) X11DRV_CLIPBOARD_UpdateCache(); - return X11DRV_CLIPBOARD_InsertClipboardData(wFormat, hData, NULL, TRUE); + return X11DRV_CLIPBOARD_InsertClipboardData( wFormat, hData ); }
1
0
0
0
Alexandre Julliard : winex11: Reimplement import_targets to go through the format list in the standard way.
by Alexandre Julliard
23 Sep '16
23 Sep '16
Module: wine Branch: master Commit: 548ce58b4f43efdfe19fa57925e22d780fe45c30 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=548ce58b4f43efdfe19fa5792…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 23 12:33:44 2016 +0900 winex11: Reimplement import_targets to go through the format list in the standard way. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 89 +++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 58 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index f557c80..f139586 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -464,22 +464,6 @@ void X11DRV_InitClipboard(void) /************************************************************************** - * X11DRV_CLIPBOARD_LookupProperty - */ -static struct clipboard_format *X11DRV_CLIPBOARD_LookupProperty( struct clipboard_format *current, Atom prop ) -{ - struct list *ptr = current ? ¤t->entry : &format_list; - - while ((ptr = list_next( &format_list, ptr ))) - { - struct clipboard_format *format = LIST_ENTRY( ptr, struct clipboard_format, entry ); - if (format->atom == prop) return format; - } - return NULL; -} - - -/************************************************************************** * X11DRV_CLIPBOARD_LookupData */ static LPWINE_CLIPDATA X11DRV_CLIPBOARD_LookupData(DWORD wID) @@ -1255,6 +1239,37 @@ static HANDLE import_text_uri_list( Atom type, const void *data, size_t size ) /************************************************************************** + * import_targets + * + * Import TARGETS and mark the corresponding clipboard formats as available. + */ +static HANDLE import_targets( Atom type, const void *data, size_t size ) +{ + UINT i, count = size / sizeof(Atom); + const Atom *properties = data; + struct clipboard_format *format; + + if (type != XA_ATOM && type != x11drv_atom(TARGETS)) return 0; + + register_x11_formats( properties, count ); + + LIST_FOR_EACH_ENTRY( format, &format_list, struct clipboard_format, entry ) + { + for (i = 0; i < count; i++) if (properties[i] == format->atom) break; + if (i == count) continue; + if (format->import && format->id) + { + TRACE( "property %s -> format %s\n", + debugstr_xatom( properties[i] ), debugstr_format( format->id )); + X11DRV_CLIPBOARD_InsertClipboardData( format->id, 0, format, FALSE ); + } + else TRACE( "property %s (ignoring)\n", debugstr_xatom( properties[i] )); + } + return (HANDLE)1; +} + + +/************************************************************************** * import_data * * Generic import clipboard data routine. @@ -1883,48 +1898,6 @@ static BOOL export_multiple( Display *display, Window win, Atom prop, Atom targe /************************************************************************** - * import_targets - * - * Import TARGETS and mark the corresponding clipboard formats as available. - */ -static HANDLE import_targets( Atom type, const void *data, size_t size ) -{ - UINT i, count = size / sizeof(Atom); - const Atom *properties = data; - - if (type != XA_ATOM && type != x11drv_atom(TARGETS)) return 0; - - register_x11_formats( properties, count ); - - /* Cache these formats in the clipboard cache */ - for (i = 0; i < count; i++) - { - LPWINE_CLIPFORMAT lpFormat = X11DRV_CLIPBOARD_LookupProperty(NULL, properties[i]); - - if (lpFormat) - { - /* We found at least one Window's format that mapps to the property. - * Continue looking for more. - * - * If more than one property map to a Window's format then we use the first - * one and ignore the rest. - */ - while (lpFormat) - { - TRACE( "property %s -> format %s\n", - debugstr_xatom( lpFormat->atom ), debugstr_format( lpFormat->id )); - if (lpFormat->id) - X11DRV_CLIPBOARD_InsertClipboardData( lpFormat->id, 0, lpFormat, FALSE ); - lpFormat = X11DRV_CLIPBOARD_LookupProperty(lpFormat, properties[i]); - } - } - } - - return (HANDLE)1; -} - - -/************************************************************************** * X11DRV_CLIPBOARD_QueryAvailableData * * Caches the list of data formats available from the current selection.
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
43
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
Results per page:
10
25
50
100
200