Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c970621d
Commit
c970621d
authored
Aug 15, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Create contexts at initialization time to avoid the need for locks.
parent
b2a7111a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
mouse.c
dlls/winex11.drv/mouse.c
+5
-7
window.c
dlls/winex11.drv/window.c
+1
-5
x11drv.h
dlls/winex11.drv/x11drv.h
+4
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+4
-0
No files found.
dlls/winex11.drv/mouse.c
View file @
c970621d
...
...
@@ -121,10 +121,11 @@ static const UINT button_up_data[NB_BUTTONS] =
XBUTTON2
};
XContext
cursor_context
=
0
;
static
HWND
cursor_window
;
static
HCURSOR
last_cursor
;
static
DWORD
last_cursor_change
;
static
XContext
cursor_context
;
static
RECT
clip_rect
;
static
Cursor
create_cursor
(
HANDLE
handle
);
...
...
@@ -200,16 +201,13 @@ void set_window_cursor( Window window, HCURSOR handle )
{
Cursor
cursor
,
prev
;
wine_tsx11_lock
();
if
(
!
handle
)
cursor
=
get_empty_cursor
();
else
if
(
!
cursor_context
||
XFindContext
(
gdi_display
,
(
XID
)
handle
,
cursor_context
,
(
char
**
)
&
cursor
))
else
if
(
XFindContext
(
gdi_display
,
(
XID
)
handle
,
cursor_context
,
(
char
**
)
&
cursor
))
{
/* try to create it */
wine_tsx11_unlock
();
if
(
!
(
cursor
=
create_cursor
(
handle
)))
return
;
wine_tsx11_lock
();
if
(
!
cursor_context
)
cursor_context
=
XUniqueContext
();
if
(
!
XFindContext
(
gdi_display
,
(
XID
)
handle
,
cursor_context
,
(
char
**
)
&
prev
))
{
/* someone else was here first */
...
...
@@ -221,12 +219,12 @@ void set_window_cursor( Window window, HCURSOR handle )
XSaveContext
(
gdi_display
,
(
XID
)
handle
,
cursor_context
,
(
char
*
)
cursor
);
TRACE
(
"cursor %p created %lx
\n
"
,
handle
,
cursor
);
}
wine_tsx11_unlock
();
}
XDefineCursor
(
gdi_display
,
window
,
cursor
);
/* make the change take effect immediately */
XFlush
(
gdi_display
);
wine_tsx11_unlock
();
}
/***********************************************************************
...
...
@@ -1205,7 +1203,7 @@ void CDECL X11DRV_DestroyCursorIcon( HCURSOR handle )
Cursor
cursor
;
wine_tsx11_lock
();
if
(
cursor_context
&&
!
XFindContext
(
gdi_display
,
(
XID
)
handle
,
cursor_context
,
(
char
**
)
&
cursor
))
if
(
!
XFindContext
(
gdi_display
,
(
XID
)
handle
,
cursor_context
,
(
char
**
)
&
cursor
))
{
TRACE
(
"%p xid %lx
\n
"
,
handle
,
cursor
);
XFreeCursor
(
gdi_display
,
cursor
);
...
...
dlls/winex11.drv/window.c
View file @
c970621d
...
...
@@ -75,7 +75,7 @@ int clipping_cursor = 0;
XContext
winContext
=
0
;
/* X context to associate a struct x11drv_win_data to an hwnd */
static
XContext
win_data_context
;
XContext
win_data_context
=
0
;
/* time of last user event and window where it's stored */
static
Time
last_user_time
;
...
...
@@ -1914,11 +1914,7 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd )
if
((
data
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
data
))))
{
data
->
hwnd
=
hwnd
;
wine_tsx11_lock
();
if
(
!
winContext
)
winContext
=
XUniqueContext
();
if
(
!
win_data_context
)
win_data_context
=
XUniqueContext
();
XSaveContext
(
display
,
(
XID
)
hwnd
,
win_data_context
,
(
char
*
)
data
);
wine_tsx11_unlock
();
}
return
data
;
}
...
...
dlls/winex11.drv/x11drv.h
View file @
c970621d
...
...
@@ -615,6 +615,10 @@ static inline BOOL is_window_rect_fullscreen( const RECT *rect )
/* X context to associate a hwnd to an X window */
extern
XContext
winContext
DECLSPEC_HIDDEN
;
/* X context to associate a struct x11drv_win_data to an hwnd */
extern
XContext
win_data_context
DECLSPEC_HIDDEN
;
/* X context to associate an X cursor to a Win32 cursor handle */
extern
XContext
cursor_context
DECLSPEC_HIDDEN
;
extern
void
X11DRV_InitClipboard
(
void
)
DECLSPEC_HIDDEN
;
extern
int
CDECL
X11DRV_AcquireClipboard
(
HWND
hWndClipWindow
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/x11drv_main.c
View file @
c970621d
...
...
@@ -570,6 +570,10 @@ static BOOL process_attach(void)
XInternAtoms
(
display
,
(
char
**
)
atom_names
,
NB_XATOMS
-
FIRST_XATOM
,
False
,
X11DRV_Atoms
);
winContext
=
XUniqueContext
();
win_data_context
=
XUniqueContext
();
cursor_context
=
XUniqueContext
();
if
(
TRACE_ON
(
synchronous
))
XSynchronize
(
display
,
True
);
xinerama_init
(
WidthOfScreen
(
screen
),
HeightOfScreen
(
screen
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment