Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xorg-server
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Mike Hommey
xorg-server
Commits
bac34a54
Commit
bac34a54
authored
Apr 23, 2011
by
Jeremy Huddleston
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XQuartz: xpr: Initialize window_hash in xprInit
Signed-off-by:
Jeremy Huddleston
<
jeremyhu@apple.com
>
parent
1596ea72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
33 deletions
+19
-33
hw/xquartz/xpr/xprFrame.c
hw/xquartz/xpr/xprFrame.c
+19
-33
No files found.
hw/xquartz/xpr/xprFrame.c
View file @
bac34a54
/*
* Xplugin rootless implementation frame functions
*
* Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
* Copyright (c) 2002
-2011
Apple Computer, Inc. All rights reserved.
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
...
...
@@ -35,7 +35,6 @@
#include "rootlessCommon.h"
#include <Xplugin.h>
#include "x-hash.h"
#include "x-list.h"
#include "applewmExt.h"
#include "propertyst.h"
...
...
@@ -61,6 +60,10 @@ DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID")
/* Maps xp_window_id -> RootlessWindowRec */
static
x_hash_table
*
window_hash
;
/* Need to guard window_hash since xprGetXWindowFromAppKit and xprIsX11Window
* can be called from any thread.
*/
static
pthread_mutex_t
window_hash_mutex
;
/* Prototypes for static functions */
...
...
@@ -178,12 +181,6 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
return
FALSE
;
}
if
(
window_hash
==
NULL
)
{
window_hash
=
x_hash_table_new
(
NULL
,
NULL
,
NULL
,
NULL
);
pthread_mutex_init
(
&
window_hash_mutex
,
NULL
);
}
pthread_mutex_lock
(
&
window_hash_mutex
);
x_hash_table_insert
(
window_hash
,
pFrame
->
wid
,
pFrame
);
pthread_mutex_unlock
(
&
window_hash_mutex
);
...
...
@@ -256,6 +253,7 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
static
void
xprRestackFrame
(
RootlessFrameID
wid
,
RootlessFrameID
nextWid
)
{
xp_window_changes
wc
;
unsigned
int
mask
=
XP_STACKING
;
RootlessWindowRec
*
winRec
;
/* Stack frame below nextWid it if it exists, or raise
frame above everything otherwise. */
...
...
@@ -268,18 +266,16 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
wc
.
sibling
=
x_cvt_vptr_to_uint
(
nextWid
);
}
if
(
window_hash
)
{
RootlessWindowRec
*
winRec
=
x_hash_table_lookup
(
window_hash
,
wid
,
NULL
);
if
(
winRec
)
{
if
(
XQuartzIsRootless
)
wc
.
window_level
=
normal_window_levels
[
winRec
->
level
];
else
if
(
XQuartzShieldingWindowLevel
)
wc
.
window_level
=
XQuartzShieldingWindowLevel
+
1
;
else
wc
.
window_level
=
rooted_window_levels
[
winRec
->
level
];
mask
|=
XP_WINDOW_LEVEL
;
}
winRec
=
x_hash_table_lookup
(
window_hash
,
wid
,
NULL
);
if
(
winRec
)
{
if
(
XQuartzIsRootless
)
wc
.
window_level
=
normal_window_levels
[
winRec
->
level
];
else
if
(
XQuartzShieldingWindowLevel
)
wc
.
window_level
=
XQuartzShieldingWindowLevel
+
1
;
else
wc
.
window_level
=
rooted_window_levels
[
winRec
->
level
];
mask
|=
XP_WINDOW_LEVEL
;
}
xprConfigureWindow
(
x_cvt_vptr_to_uint
(
wid
),
mask
,
&
wc
);
...
...
@@ -450,6 +446,9 @@ xprInit(ScreenPtr pScreen)
rootless_CopyBytes_threshold
=
xp_copy_bytes_threshold
;
rootless_CopyWindow_threshold
=
xp_scroll_area_threshold
;
assert
((
window_hash
=
x_hash_table_new
(
NULL
,
NULL
,
NULL
,
NULL
)));
assert
(
0
==
pthread_mutex_init
(
&
window_hash_mutex
,
NULL
));
return
TRUE
;
}
...
...
@@ -463,9 +462,6 @@ xprGetXWindow(xp_window_id wid)
{
RootlessWindowRec
*
winRec
;
if
(
window_hash
==
NULL
)
return
NULL
;
winRec
=
x_hash_table_lookup
(
window_hash
,
x_cvt_uint_to_vptr
(
wid
),
NULL
);
return
winRec
!=
NULL
?
winRec
->
win
:
NULL
;
...
...
@@ -483,11 +479,6 @@ xprGetXWindowFromAppKit(int windowNumber)
Bool
ret
;
xp_window_id
wid
;
if
(
window_hash
==
NULL
)
return
FALSE
;
/* need to lock, since this function can be called by any thread */
pthread_mutex_lock
(
&
window_hash_mutex
);
if
(
xp_lookup_native_window
(
windowNumber
,
&
wid
))
...
...
@@ -514,11 +505,6 @@ xprIsX11Window(void *nsWindow, int windowNumber)
Bool
ret
;
xp_window_id
wid
;
if
(
window_hash
==
NULL
)
return
FALSE
;
/* need to lock, since this function can be called by any thread */
pthread_mutex_lock
(
&
window_hash_mutex
);
if
(
xp_lookup_native_window
(
windowNumber
,
&
wid
))
...
...
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