Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
bc381a6a
Commit
bc381a6a
authored
23 years ago
by
Gavriel State
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Copy the first 128 colors from the default colormap to Wine's private
colormap when using 'shared' colors.
parent
10b3402c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
graphics/x11drv/palette.c
+16
-2
16 additions, 2 deletions
graphics/x11drv/palette.c
include/ts_xlib.h
+1
-0
1 addition, 0 deletions
include/ts_xlib.h
tsx11/X11_calls
+1
-0
1 addition, 0 deletions
tsx11/X11_calls
tsx11/ts_xlib.c
+9
-0
9 additions, 0 deletions
tsx11/ts_xlib.c
with
27 additions
and
2 deletions
graphics/x11drv/palette.c
+
16
−
2
View file @
bc381a6a
...
...
@@ -312,14 +312,28 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void)
int
i
,
j
,
warn
=
0
;
int
diff
,
r
,
g
,
b
,
max
=
256
,
bp
=
0
,
wp
=
1
;
int
step
=
1
;
int
defaultCM_max_copy
;
Colormap
defaultCM
;
XColor
defaultColors
[
256
];
/* Copy the first bunch of colors out of the default colormap to prevent
* colormap flashing as much as possible. We're likely to get the most
* important Window Manager colors, etc in the first 128 colors */
defaultCM
=
DefaultColormapOfScreen
(
X11DRV_GetXScreen
()
);
defaultCM_max_copy
=
PROFILE_GetWineIniInt
(
"x11drv"
,
"CopyDefaultColors"
,
128
);
for
(
i
=
0
;
i
<
defaultCM_max_copy
;
i
++
)
defaultColors
[
i
].
pixel
=
(
long
)
i
;
TSXQueryColors
(
display
,
defaultCM
,
&
defaultColors
[
0
],
defaultCM_max_copy
);
for
(
i
=
0
;
i
<
defaultCM_max_copy
;
i
++
)
TSXAllocColor
(
display
,
X11DRV_PALETTE_PaletteXColormap
,
&
defaultColors
[
i
]
);
/* read "AllocSystemColors" from wine.conf */
COLOR_max
=
PROFILE_GetWineIniInt
(
"x11drv"
,
"AllocSystemColors"
,
256
);
if
(
COLOR_max
>
256
)
COLOR_max
=
256
;
else
if
(
COLOR_max
<
20
)
COLOR_max
=
20
;
TRACE
(
"%d colors configured.
\n
"
,
COLOR_max
);
TRACE
(
"Building shared map - %i palette entries
\n
"
,
X11DRV_DevCaps
.
sizePalette
);
/* Be nice and allocate system colors as read-only */
...
...
This diff is collapsed.
Click to expand it.
include/ts_xlib.h
+
1
−
0
View file @
bc381a6a
...
...
@@ -106,6 +106,7 @@ extern int TSXPending(Display*);
extern
int
TSXPutBackEvent
(
Display
*
,
XEvent
*
);
extern
int
TSXPutImage
(
Display
*
,
Drawable
,
GC
,
XImage
*
,
int
,
int
,
int
,
int
,
unsigned
int
,
unsigned
int
);
extern
int
TSXQueryColor
(
Display
*
,
Colormap
,
XColor
*
);
extern
int
TSXQueryColors
(
Display
*
,
Colormap
,
XColor
*
,
int
);
extern
int
TSXQueryKeymap
(
Display
*
,
char
*
);
extern
int
TSXQueryPointer
(
Display
*
,
Window
,
Window
*
,
Window
*
,
int
*
,
int
*
,
int
*
,
int
*
,
unsigned
int
*
);
extern
int
TSXQueryTree
(
Display
*
,
Window
,
Window
*
,
Window
*
,
Window
**
,
unsigned
int
*
);
...
...
This diff is collapsed.
Click to expand it.
tsx11/X11_calls
+
1
−
0
View file @
bc381a6a
...
...
@@ -109,6 +109,7 @@ XPolygonRegion
XPutBackEvent
XPutImage
XQueryColor
XQueryColors
XQueryKeymap
XQueryPointer
XQueryTree
...
...
This diff is collapsed.
Click to expand it.
tsx11/ts_xlib.c
+
9
−
0
View file @
bc381a6a
...
...
@@ -811,6 +811,15 @@ int TSXQueryColor(Display* a0, Colormap a1, XColor* a2)
return
r
;
}
int
TSXQueryColors
(
Display
*
a0
,
Colormap
a1
,
XColor
*
a2
,
int
a3
)
{
int
r
;
wine_tsx11_lock
();
r
=
XQueryColors
(
a0
,
a1
,
a2
,
a3
);
wine_tsx11_unlock
();
return
r
;
}
int
TSXQueryKeymap
(
Display
*
a0
,
char
*
a1
)
{
int
r
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment