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
b50272bd
Commit
b50272bd
authored
Feb 21, 1999
by
Stephane Lussier
Committed by
Alexandre Julliard
Feb 21, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problem where you need mouse activity to unlock some 16 bits
thread with multi-threaded apps.
parent
eb5a29b6
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
108 additions
and
11 deletions
+108
-11
message.h
include/message.h
+2
-0
ttydrv.h
include/ttydrv.h
+2
-1
x11drv.h
include/x11drv.h
+1
-0
task.c
loader/task.c
+6
-5
event.c
windows/event.c
+12
-0
event.c
windows/ttydrv/event.c
+6
-0
init.c
windows/ttydrv/init.c
+2
-1
event.c
windows/x11drv/event.c
+75
-3
init.c
windows/x11drv/init.c
+2
-1
No files found.
include/message.h
View file @
b50272bd
...
...
@@ -43,6 +43,7 @@ typedef struct _EVENT_DRIVER {
void
(
*
pDummyMotionNotify
)(
void
);
BOOL32
(
*
pPending
)(
void
);
BOOL16
(
*
pIsUserIdle
)(
void
);
void
(
*
pWakeUp
)(
void
);
}
EVENT_DRIVER
;
extern
void
EVENT_AddIO
(
int
fd
,
unsigned
flag
);
...
...
@@ -54,6 +55,7 @@ extern BOOL32 EVENT_CheckFocus( void );
extern
BOOL32
EVENT_QueryPointer
(
DWORD
*
posX
,
DWORD
*
posY
,
DWORD
*
state
);
extern
void
EVENT_DummyMotionNotify
(
void
);
extern
BOOL32
EVENT_Pending
(
void
);
extern
void
EVENT_WakeUp
(
void
);
/* input.c */
...
...
include/ttydrv.h
View file @
b50272bd
...
...
@@ -5,7 +5,7 @@
#ifndef __WINE_TTYDRV_H
#define __WINE_TTYDRV_H
#include "win
dow
s.h"
#include "win
type
s.h"
#include "wine/winuser16.h"
struct
tagCLASS
;
...
...
@@ -57,6 +57,7 @@ extern BOOL32 TTYDRV_EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state);
extern
void
TTYDRV_EVENT_DummyMotionNotify
(
void
);
extern
BOOL32
TTYDRV_EVENT_Pending
(
void
);
extern
BOOL16
TTYDRV_EVENT_IsUserIdle
(
void
);
extern
void
TTYDRV_EVENT_WakeUp
(
void
);
/* TTY keyboard driver */
...
...
include/x11drv.h
View file @
b50272bd
...
...
@@ -262,6 +262,7 @@ extern BOOL32 X11DRV_EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state);
extern
void
X11DRV_EVENT_DummyMotionNotify
(
void
);
extern
BOOL32
X11DRV_EVENT_Pending
(
void
);
extern
BOOL16
X11DRV_EVENT_IsUserIdle
(
void
);
extern
void
X11DRV_EVENT_WakeUp
(
void
);
/* X11 keyboard driver */
...
...
loader/task.c
View file @
b50272bd
...
...
@@ -500,7 +500,8 @@ void TASK_StartTask( HTASK16 hTask )
if
(
THREAD_IsWin16
(
THREAD_Current
()
)
)
OldYield
();
else
FIXME
(
task
,
"Don't know how to start 16-bit task from 32-bit thread. Move the mouse!
\n
"
);
/* wake-up the scheduler waiting in EVENT_WaitNetEvent */
EVENT_WakeUp
();
}
...
...
@@ -944,13 +945,13 @@ void WINAPI PostEvent( HTASK16 hTask )
if
(
!
hTask
)
hTask
=
GetCurrentTask
();
if
(
!
(
pTask
=
(
TDB
*
)
GlobalLock16
(
hTask
)))
return
;
pTask
->
nEvents
++
;
if
(
!
THREAD_IsWin16
(
THREAD_Current
()
)
)
{
WARN
(
task
,
"called for Win32 thread (%04x)!
\n
"
,
THREAD_Current
()
->
teb_sel
);
/* return; */
/* wake-up the scheduler waiting in EVENT_WaitNetEvent */
EVENT_WakeUp
();
}
pTask
->
nEvents
++
;
}
...
...
windows/event.c
View file @
b50272bd
...
...
@@ -119,3 +119,15 @@ BOOL16 WINAPI IsUserIdle(void)
{
return
EVENT_GetDriver
()
->
pIsUserIdle
();
}
/***********************************************************************
* EVENT_WakeUp
*
* Wake up the scheduler (EVENT_WaitNetEvent). Use by 32 bit thread
* when thew want signaled an event to a 16 bit task. This function
* will become obsolete when an Asynchronous thread will be implemented
*/
void
EVENT_WakeUp
(
void
)
{
EVENT_GetDriver
()
->
pWakeUp
();
}
windows/ttydrv/event.c
View file @
b50272bd
...
...
@@ -91,3 +91,9 @@ BOOL16 TTYDRV_EVENT_IsUserIdle(void)
return
TRUE
;
}
/**********************************************************************
* TTYDRV_EVENT_WakeUp
*/
void
TTYDRV_EVENT_WakeUp
(
void
)
{
}
windows/ttydrv/init.c
View file @
b50272bd
...
...
@@ -37,7 +37,8 @@ EVENT_DRIVER TTYDRV_EVENT_Driver =
TTYDRV_EVENT_QueryPointer
,
TTYDRV_EVENT_DummyMotionNotify
,
TTYDRV_EVENT_Pending
,
TTYDRV_EVENT_IsUserIdle
TTYDRV_EVENT_IsUserIdle
,
TTYDRV_EVENT_WakeUp
};
KEYBOARD_DRIVER
TTYDRV_KEYBOARD_Driver
=
...
...
windows/x11drv/event.c
View file @
b50272bd
...
...
@@ -16,6 +16,7 @@
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include "callback.h"
#include "class.h"
#include "clipboard.h"
...
...
@@ -67,6 +68,7 @@ extern void X11DRV_KEYBOARD_HandleEvent(WND *pWnd, XKeyEvent *event);
static
fd_set
__event_io_set
[
3
];
static
int
__event_max_fd
=
0
;
static
int
__event_x_connection
=
0
;
static
int
__wakeup_pipe
[
2
];
static
const
char
*
const
event_names
[]
=
{
...
...
@@ -119,6 +121,20 @@ BOOL32 X11DRV_EVENT_Init(void)
__event_max_fd
=
__event_x_connection
=
ConnectionNumber
(
display
);
FD_SET
(
__event_x_connection
,
&
__event_io_set
[
EVENT_IO_READ
]
);
/* this pipe is used to be able to wake-up the scheduler(WaitNetEvent) by
a 32 bit thread, this will become obsolete when the input thread will be
implemented */
pipe
(
__wakeup_pipe
);
/* make the pipe non-blocking */
fcntl
(
__wakeup_pipe
[
0
],
F_SETFL
,
O_NONBLOCK
);
fcntl
(
__wakeup_pipe
[
1
],
F_SETFL
,
O_NONBLOCK
);
FD_SET
(
__wakeup_pipe
[
0
],
&
__event_io_set
[
EVENT_IO_READ
]
);
if
(
__wakeup_pipe
[
0
]
>
__event_max_fd
)
__event_max_fd
=
__wakeup_pipe
[
0
];
__event_max_fd
++
;
return
TRUE
;
}
...
...
@@ -155,6 +171,26 @@ BOOL16 X11DRV_EVENT_IsUserIdle(void)
return
FALSE
;
}
/***********************************************************************
* EVENT_ReadWakeUpPipe
*
* Empty the wake up pipe
*/
void
EVENT_ReadWakeUpPipe
(
void
)
{
char
tmpBuf
[
10
];
ssize_t
ret
;
EnterCriticalSection
(
&
X11DRV_CritSection
);
/* Flush the wake-up pipe, it's just dummy data for waking-up this
thread. This will be obsolete when the input thread will be done */
while
(
(
ret
=
read
(
__wakeup_pipe
[
0
],
&
tmpBuf
,
10
))
==
10
);
LeaveCriticalSection
(
&
X11DRV_CritSection
);
}
/***********************************************************************
* X11DRV_EVENT_WaitNetEvent
*
...
...
@@ -209,6 +245,7 @@ BOOL32 X11DRV_EVENT_WaitNetEvent( BOOL32 sleep, BOOL32 peek )
num_pending
=
select
(
__event_max_fd
,
&
io_set
[
EVENT_IO_READ
],
&
io_set
[
EVENT_IO_WRITE
],
&
io_set
[
EVENT_IO_EXCEPT
],
&
timeout
);
if
(
num_pending
==
0
)
{
/* Timeout or error */
...
...
@@ -217,6 +254,14 @@ BOOL32 X11DRV_EVENT_WaitNetEvent( BOOL32 sleep, BOOL32 peek )
}
#endif
/* CONFIG_IPC */
/* Flush the wake-up pipe, it's just dummy data for waking-up this
thread. This will be obsolete when the input thread will be done */
if
(
FD_ISSET
(
__wakeup_pipe
[
0
],
&
io_set
[
EVENT_IO_READ
]
)
)
{
num_pending
--
;
EVENT_ReadWakeUpPipe
();
}
/* Winsock asynchronous services */
if
(
FD_ISSET
(
__event_x_connection
,
&
io_set
[
EVENT_IO_READ
])
)
...
...
@@ -234,10 +279,24 @@ BOOL32 X11DRV_EVENT_WaitNetEvent( BOOL32 sleep, BOOL32 peek )
else
if
(
!
pending
)
{
/* Wait for X11 input. */
fd_set
set
;
int
max_fd
;
FD_ZERO
(
&
set
);
FD_SET
(
__event_x_connection
,
&
set
);
select
(
__event_x_connection
+
1
,
&
set
,
0
,
0
,
0
);
/* wait on wake-up pipe also */
FD_SET
(
__wakeup_pipe
[
0
],
&
set
);
if
(
__event_x_connection
>
__wakeup_pipe
[
0
])
max_fd
=
__event_x_connection
+
1
;
else
max_fd
=
__wakeup_pipe
[
0
]
+
1
;
select
(
max_fd
,
&
set
,
0
,
0
,
0
);
/* Flush the wake-up pipe, it's just dummy data for waking-up this
thread. This will be obsolete when the input thread will be done */
if
(
FD_ISSET
(
__wakeup_pipe
[
0
],
&
set
)
)
EVENT_ReadWakeUpPipe
();
}
/* Process current X event (and possibly others that occurred in the meantime) */
...
...
@@ -1057,7 +1116,8 @@ static void EVENT_DropFromOffiX( WND *pWnd, XClientMessageEvent *event )
if
(
!
lpDragInfo
||
!
spDragInfo
)
return
;
TSXQueryPointer
(
display
,
X11DRV_WND_GetXWindow
(
pWnd
),
&
w_aux_root
,
&
w_aux_child
,
&
x
,
&
y
,
&
u
.
pt_aux
.
x
,
&
u
.
pt_aux
.
y
,
(
unsigned
int
*
)
&
aux_long
);
&
x
,
&
y
,
(
int
*
)
&
u
.
pt_aux
.
x
,
(
int
*
)
&
u
.
pt_aux
.
y
,
(
unsigned
int
*
)
&
aux_long
);
lpDragInfo
->
hScope
=
pWnd
->
hwndSelf
;
lpDragInfo
->
pt
.
x
=
(
INT16
)
x
;
lpDragInfo
->
pt
.
y
=
(
INT16
)
y
;
...
...
@@ -1079,7 +1139,7 @@ static void EVENT_DropFromOffiX( WND *pWnd, XClientMessageEvent *event )
{
TSXGetWindowProperty
(
display
,
DefaultRootWindow
(
display
),
dndSelection
,
0
,
65535
,
FALSE
,
AnyPropertyType
,
&
u
.
atom_aux
,
&
u
.
pt_aux
.
y
,
AnyPropertyType
,
&
u
.
atom_aux
,
(
int
*
)
&
u
.
pt_aux
.
y
,
&
data_length
,
&
aux_long
,
&
p_data
);
if
(
!
aux_long
&&
p_data
)
/* don't bother if > 64K */
...
...
@@ -1364,4 +1424,16 @@ BOOL32 X11DRV_EVENT_Pending()
return
TSXPending
(
display
);
}
/**********************************************************************
* X11DRV_EVENT_WakeUp
*/
void
X11DRV_EVENT_WakeUp
(
void
)
{
/* wake-up EVENT_WaitNetEvent function, a 32 bit thread post an event
for a 16 bit task */
if
(
write
(
__wakeup_pipe
[
1
],
"A"
,
1
)
!=
1
)
ERR
(
event
,
"unable to write in wakeup_pipe
\n
"
);
}
#endif
/* !defined(X_DISPLAY_MISSING) */
windows/x11drv/init.c
View file @
b50272bd
...
...
@@ -42,7 +42,8 @@ EVENT_DRIVER X11DRV_EVENT_Driver =
X11DRV_EVENT_QueryPointer
,
X11DRV_EVENT_DummyMotionNotify
,
X11DRV_EVENT_Pending
,
X11DRV_EVENT_IsUserIdle
X11DRV_EVENT_IsUserIdle
,
X11DRV_EVENT_WakeUp
};
KEYBOARD_DRIVER
X11DRV_KEYBOARD_Driver
=
...
...
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