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
0ea8bf17
Commit
0ea8bf17
authored
Mar 03, 2011
by
Peter Urbanec
Committed by
Alexandre Julliard
Mar 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintab32: Better handling of XInput initialisation errors.
parent
af0a4b69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
14 deletions
+33
-14
wintab.c
dlls/winex11.drv/wintab.c
+10
-6
context.c
dlls/wintab32/context.c
+23
-8
No files found.
dlls/winex11.drv/wintab.c
View file @
0ea8bf17
...
...
@@ -484,7 +484,7 @@ static void disable_system_cursors(void)
/***********************************************************************
* X11DRV_LoadTabletInfo (X11DRV.@)
*/
void
CDECL
X11DRV_LoadTabletInfo
(
HWND
hwnddefault
)
BOOL
CDECL
X11DRV_LoadTabletInfo
(
HWND
hwnddefault
)
{
const
WCHAR
SZ_CONTEXT_NAME
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'T'
,
'a'
,
'b'
,
'l'
,
'e'
,
't'
,
' '
,
'C'
,
'o'
,
'n'
,
't'
,
'e'
,
'x'
,
't'
,
0
};
const
WCHAR
SZ_DEVICE_NAME
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'T'
,
'a'
,
'b'
,
'l'
,
'e'
,
't'
,
' '
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
...
...
@@ -507,7 +507,7 @@ void CDECL X11DRV_LoadTabletInfo(HWND hwnddefault)
if
(
!
X11DRV_XInput_Init
())
{
ERR
(
"Unable to initialize the XInput library.
\n
"
);
return
;
return
FALSE
;
}
hwndTabletDefault
=
hwnddefault
;
...
...
@@ -555,9 +555,9 @@ void CDECL X11DRV_LoadTabletInfo(HWND hwnddefault)
devices
=
pXListInputDevices
(
data
->
display
,
&
num_devices
);
if
(
!
devices
)
{
WARN
(
"XInput Extensions reported as not avalable
\n
"
);
WARN
(
"XInput Extensions reported as not ava
i
lable
\n
"
);
wine_tsx11_unlock
();
return
;
return
FALSE
;
}
TRACE
(
"XListInputDevices reports %d devices
\n
"
,
num_devices
);
for
(
loop
=
0
;
loop
<
num_devices
;
loop
++
)
...
...
@@ -778,6 +778,7 @@ void CDECL X11DRV_LoadTabletInfo(HWND hwnddefault)
}
wine_tsx11_unlock
();
return
TRUE
;
}
static
int
figure_deg
(
int
x
,
int
y
)
...
...
@@ -971,7 +972,7 @@ int CDECL X11DRV_AttachEventQueueToTablet(HWND hOwner)
XEventClass
event_list
[
7
];
Window
win
=
X11DRV_get_whole_window
(
hOwner
);
if
(
!
win
)
return
0
;
if
(
!
win
||
!
xinput_handle
)
return
0
;
TRACE
(
"Creating context for window %p (%lx) %i cursors
\n
"
,
hOwner
,
win
,
gNumCursors
);
...
...
@@ -1080,6 +1081,8 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput)
LPWTI_CURSORS_INFO
tgtcursor
;
TRACE
(
"(%u, %u, %p)
\n
"
,
wCategory
,
nIndex
,
lpOutput
);
if
(
!
xinput_handle
)
return
0
;
switch
(
wCategory
)
{
case
0
:
...
...
@@ -1512,8 +1515,9 @@ int CDECL X11DRV_GetCurrentPacket(LPWTPACKET packet)
/***********************************************************************
* LoadTabletInfo (X11DRV.@)
*/
void
CDECL
X11DRV_LoadTabletInfo
(
HWND
hwnddefault
)
BOOL
CDECL
X11DRV_LoadTabletInfo
(
HWND
hwnddefault
)
{
return
FALSE
;
}
/***********************************************************************
...
...
dlls/wintab32/context.c
View file @
0ea8bf17
...
...
@@ -42,7 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wintab32);
* http://www.csl.sony.co.jp/projects/ar/restricted/wintabl.html
*/
static
BOOL
gLoaded
;
static
LPOPENCONTEXT
gOpenContexts
;
static
HCTX
gTopContext
=
(
HCTX
)
0xc00
;
...
...
@@ -151,12 +150,26 @@ static LPOPENCONTEXT TABLET_FindOpenContext(HCTX hCtx)
return
NULL
;
}
static
void
LoadTablet
(
void
)
static
inline
BOOL
LoadTablet
(
void
)
{
TRACE
(
"Initializing the tablet to hwnd %p
\n
"
,
hwndDefault
);
gLoaded
=
TRUE
;
if
(
pLoadTabletInfo
)
pLoadTabletInfo
(
hwndDefault
);
static
enum
{
TI_START
=
0
,
TI_OK
,
TI_FAIL
}
loaded
=
TI_START
;
if
(
loaded
==
TI_START
)
{
TRACE
(
"Initializing the tablet to hwnd %p
\n
"
,
hwndDefault
);
if
(
pLoadTabletInfo
&&
pLoadTabletInfo
(
hwndDefault
))
{
loaded
=
TI_OK
;
}
else
{
loaded
=
TI_FAIL
;
ERR
(
"LoadTabletInfo(%p) failed
\n
"
,
hwndDefault
);
}
}
return
loaded
==
TI_OK
;
}
int
TABLET_PostTabletMessage
(
LPOPENCONTEXT
newcontext
,
UINT
msg
,
WPARAM
wParam
,
...
...
@@ -366,9 +379,9 @@ static UINT WTInfoT(UINT wCategory, UINT nIndex, LPVOID lpOutput, BOOL bUnicode)
{
UINT
result
;
if
(
!
LoadTablet
())
return
0
;
TRACE
(
"(%d, %d, %p, %d)
\n
"
,
wCategory
,
nIndex
,
lpOutput
,
bUnicode
);
if
(
gLoaded
==
FALSE
)
LoadTablet
();
/*
* Handle system extents here, as we can use user32.dll code to set them.
...
...
@@ -450,6 +463,8 @@ HCTX WINAPI WTOpenW(HWND hWnd, LPLOGCONTEXTW lpLogCtx, BOOL fEnable)
{
LPOPENCONTEXT
newcontext
;
if
(
!
LoadTablet
())
return
0
;
TRACE
(
"hWnd=%p, lpLogCtx=%p, fEnable=%u
\n
"
,
hWnd
,
lpLogCtx
,
fEnable
);
DUMPCONTEXT
(
*
lpLogCtx
);
...
...
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