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
be417d68
Commit
be417d68
authored
Apr 30, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: When changing a process desktop, start the close timeout on the old desktop if necessary.
parent
53ec9b32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
25 deletions
+38
-25
winstation.c
server/winstation.c
+38
-25
No files found.
server/winstation.c
View file @
be417d68
...
@@ -300,6 +300,40 @@ struct desktop *get_thread_desktop( struct thread *thread, unsigned int access )
...
@@ -300,6 +300,40 @@ struct desktop *get_thread_desktop( struct thread *thread, unsigned int access )
return
get_desktop_obj
(
thread
->
process
,
thread
->
desktop
,
access
);
return
get_desktop_obj
(
thread
->
process
,
thread
->
desktop
,
access
);
}
}
static
void
close_desktop_timeout
(
void
*
private
)
{
struct
desktop
*
desktop
=
private
;
desktop
->
close_timeout
=
NULL
;
unlink_named_object
(
&
desktop
->
obj
);
/* make sure no other process can open it */
post_desktop_message
(
desktop
,
WM_CLOSE
,
0
,
0
);
/* and signal the owner to quit */
}
/* add a user of the desktop and cancel the close timeout */
static
void
add_desktop_user
(
struct
desktop
*
desktop
)
{
desktop
->
users
++
;
if
(
desktop
->
close_timeout
)
{
remove_timeout_user
(
desktop
->
close_timeout
);
desktop
->
close_timeout
=
NULL
;
}
}
/* remove a user of the desktop and start the close timeout if necessary */
static
void
remove_desktop_user
(
struct
desktop
*
desktop
)
{
assert
(
desktop
->
users
>
0
);
desktop
->
users
--
;
/* if we have one remaining user, it has to be the manager of the desktop window */
if
(
desktop
->
users
==
1
&&
get_top_window_owner
(
desktop
))
{
assert
(
!
desktop
->
close_timeout
);
desktop
->
close_timeout
=
add_timeout_user
(
-
TICKS_PER_SEC
,
close_desktop_timeout
,
desktop
);
}
}
/* set the process default desktop handle */
/* set the process default desktop handle */
void
set_process_default_desktop
(
struct
process
*
process
,
struct
desktop
*
desktop
,
void
set_process_default_desktop
(
struct
process
*
process
,
struct
desktop
*
desktop
,
obj_handle_t
handle
)
obj_handle_t
handle
)
...
@@ -316,15 +350,10 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt
...
@@ -316,15 +350,10 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt
LIST_FOR_EACH_ENTRY
(
thread
,
&
process
->
thread_list
,
struct
thread
,
proc_entry
)
LIST_FOR_EACH_ENTRY
(
thread
,
&
process
->
thread_list
,
struct
thread
,
proc_entry
)
if
(
!
thread
->
desktop
)
thread
->
desktop
=
handle
;
if
(
!
thread
->
desktop
)
thread
->
desktop
=
handle
;
if
(
!
process
->
is_system
)
if
(
!
process
->
is_system
&&
desktop
!=
old_desktop
)
{
{
desktop
->
users
++
;
add_desktop_user
(
desktop
);
if
(
desktop
->
close_timeout
)
if
(
old_desktop
)
remove_desktop_user
(
old_desktop
);
{
remove_timeout_user
(
desktop
->
close_timeout
);
desktop
->
close_timeout
=
NULL
;
}
if
(
old_desktop
)
old_desktop
->
users
--
;
}
}
if
(
old_desktop
)
release_object
(
old_desktop
);
if
(
old_desktop
)
release_object
(
old_desktop
);
...
@@ -372,15 +401,6 @@ done:
...
@@ -372,15 +401,6 @@ done:
clear_error
();
clear_error
();
}
}
static
void
close_desktop_timeout
(
void
*
private
)
{
struct
desktop
*
desktop
=
private
;
desktop
->
close_timeout
=
NULL
;
unlink_named_object
(
&
desktop
->
obj
);
/* make sure no other process can open it */
post_desktop_message
(
desktop
,
WM_CLOSE
,
0
,
0
);
/* and signal the owner to quit */
}
/* close the desktop of a given process */
/* close the desktop of a given process */
void
close_process_desktop
(
struct
process
*
process
)
void
close_process_desktop
(
struct
process
*
process
)
{
{
...
@@ -388,14 +408,7 @@ void close_process_desktop( struct process *process )
...
@@ -388,14 +408,7 @@ void close_process_desktop( struct process *process )
if
(
process
->
desktop
&&
(
desktop
=
get_desktop_obj
(
process
,
process
->
desktop
,
0
)))
if
(
process
->
desktop
&&
(
desktop
=
get_desktop_obj
(
process
,
process
->
desktop
,
0
)))
{
{
assert
(
desktop
->
users
>
0
);
remove_desktop_user
(
desktop
);
desktop
->
users
--
;
/* if we have one remaining user, it has to be the manager of the desktop window */
if
(
desktop
->
users
==
1
&&
get_top_window_owner
(
desktop
))
{
assert
(
!
desktop
->
close_timeout
);
desktop
->
close_timeout
=
add_timeout_user
(
-
TICKS_PER_SEC
,
close_desktop_timeout
,
desktop
);
}
release_object
(
desktop
);
release_object
(
desktop
);
}
}
clear_error
();
/* ignore errors */
clear_error
();
/* ignore errors */
...
...
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