Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d70a253f
Commit
d70a253f
authored
Apr 26, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure a thread has a queue as soon as it creates a window.
parent
1b548812
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
queue.c
server/queue.c
+8
-1
user.h
server/user.h
+1
-0
window.c
server/window.c
+17
-9
No files found.
server/queue.c
View file @
d70a253f
...
...
@@ -282,7 +282,7 @@ struct hook_table *get_queue_hooks( struct thread *thread )
void
set_queue_hooks
(
struct
thread
*
thread
,
struct
hook_table
*
hooks
)
{
struct
msg_queue
*
queue
=
thread
->
queue
;
if
(
!
queue
)
queue
=
create_msg_queue
(
thread
,
NULL
)
;
if
(
!
queue
&&
!
(
queue
=
create_msg_queue
(
thread
,
NULL
)))
return
;
if
(
queue
->
hooks
)
release_object
(
queue
->
hooks
);
queue
->
hooks
=
hooks
;
}
...
...
@@ -828,6 +828,13 @@ static int check_queue_input_window( struct msg_queue *queue, user_handle_t wind
return
ret
;
}
/* make sure the specified thread has a queue */
int
init_thread_queue
(
struct
thread
*
thread
)
{
if
(
thread
->
queue
)
return
1
;
return
(
create_msg_queue
(
thread
,
NULL
)
!=
NULL
);
}
/* attach two thread input data structures */
int
attach_thread_input
(
struct
thread
*
thread_from
,
struct
thread
*
thread_to
)
{
...
...
server/user.h
View file @
d70a253f
...
...
@@ -61,6 +61,7 @@ extern struct hook_table *get_queue_hooks( struct thread *thread );
extern
void
set_queue_hooks
(
struct
thread
*
thread
,
struct
hook_table
*
hooks
);
extern
void
inc_queue_paint_count
(
struct
thread
*
thread
,
int
incr
);
extern
void
queue_cleanup_window
(
struct
thread
*
thread
,
user_handle_t
win
);
extern
int
init_thread_queue
(
struct
thread
*
thread
);
extern
int
attach_thread_input
(
struct
thread
*
thread_from
,
struct
thread
*
thread_to
);
extern
void
post_message
(
user_handle_t
win
,
unsigned
int
message
,
unsigned
int
wparam
,
unsigned
int
lparam
);
...
...
server/window.c
View file @
d70a253f
...
...
@@ -338,13 +338,8 @@ static struct window *create_window( struct window *parent, struct window *owner
release_class
(
class
);
return
NULL
;
}
if
(
!
(
win
->
handle
=
alloc_user_handle
(
win
,
USER_WINDOW
)))
goto
failed
;
if
(
!
(
win
->
handle
=
alloc_user_handle
(
win
,
USER_WINDOW
)))
{
release_class
(
class
);
free
(
win
);
return
NULL
;
}
win
->
parent
=
parent
;
win
->
owner
=
owner
?
owner
->
handle
:
0
;
win
->
thread
=
current
;
...
...
@@ -368,13 +363,26 @@ static struct window *create_window( struct window *parent, struct window *owner
list_init
(
&
win
->
children
);
list_init
(
&
win
->
unlinked
);
/* if parent belongs to a different thread, attach the two threads */
if
(
parent
&&
parent
->
thread
&&
parent
->
thread
!=
current
)
{
if
(
!
attach_thread_input
(
current
,
parent
->
thread
))
goto
failed
;
}
else
/* otherwise just make sure that the thread has a message queue */
{
if
(
!
current
->
queue
&&
!
init_thread_queue
(
current
))
goto
failed
;
}
/* put it on parent unlinked list */
if
(
parent
)
list_add_head
(
&
parent
->
unlinked
,
&
win
->
entry
);
/* if parent belongs to a different thread, attach the two threads */
if
(
parent
&&
parent
->
thread
&&
parent
->
thread
!=
current
)
attach_thread_input
(
current
,
parent
->
thread
);
return
win
;
failed:
if
(
win
->
handle
)
free_user_handle
(
win
->
handle
);
release_class
(
class
);
free
(
win
);
return
NULL
;
}
/* destroy all windows belonging to a given thread */
...
...
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