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
Zsolt Vadász
wine
Commits
3e5c76bd
Commit
3e5c76bd
authored
12 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
winex11: Introduce a separate function for initializing the list of XRandR display modes.
parent
76725f98
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/winex11.drv/xrandr.c
+71
-71
71 additions, 71 deletions
dlls/winex11.drv/xrandr.c
with
71 additions
and
71 deletions
dlls/winex11.drv/xrandr.c
+
71
−
71
View file @
3e5c76bd
...
...
@@ -96,32 +96,6 @@ static int XRandRErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
return
1
;
}
/* create the mode structures */
static
void
make_modes
(
void
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
real_xrandr_sizes_count
;
i
++
)
{
if
(
real_xrandr_rates_count
[
i
])
{
for
(
j
=
0
;
j
<
real_xrandr_rates_count
[
i
];
j
++
)
{
X11DRV_Settings_AddOneMode
(
real_xrandr_sizes
[
i
].
width
,
real_xrandr_sizes
[
i
].
height
,
0
,
real_xrandr_rates
[
i
][
j
]);
}
}
else
{
X11DRV_Settings_AddOneMode
(
real_xrandr_sizes
[
i
].
width
,
real_xrandr_sizes
[
i
].
height
,
0
,
0
);
}
}
}
static
int
X11DRV_XRandR_GetCurrentMode
(
void
)
{
SizeID
size
;
...
...
@@ -221,10 +195,79 @@ static LONG X11DRV_XRandR_SetCurrentMode(int mode)
return
DISP_CHANGE_FAILED
;
}
static
void
xrandr_init_modes
(
void
)
{
int
i
,
j
,
nmodes
=
0
;
real_xrandr_sizes
=
pXRRSizes
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
real_xrandr_sizes_count
);
if
(
real_xrandr_sizes_count
<=
0
)
return
;
TRACE
(
"XRandR: found %u sizes.
\n
"
,
real_xrandr_sizes_count
);
real_xrandr_rates
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
short
*
)
*
real_xrandr_sizes_count
);
real_xrandr_rates_count
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
int
)
*
real_xrandr_sizes_count
);
for
(
i
=
0
;
i
<
real_xrandr_sizes_count
;
++
i
)
{
real_xrandr_rates
[
i
]
=
pXRRRates
(
gdi_display
,
DefaultScreen
(
gdi_display
),
i
,
&
real_xrandr_rates_count
[
i
]
);
TRACE
(
"- at %d: %dx%d (%d rates):"
,
i
,
real_xrandr_sizes
[
i
].
width
,
real_xrandr_sizes
[
i
].
height
,
real_xrandr_rates_count
[
i
]);
if
(
real_xrandr_rates_count
[
i
])
{
nmodes
+=
real_xrandr_rates_count
[
i
];
for
(
j
=
0
;
j
<
real_xrandr_rates_count
[
i
];
++
j
)
{
if
(
j
>
0
)
TRACE
(
","
);
TRACE
(
" %d"
,
real_xrandr_rates
[
i
][
j
]);
}
}
else
{
++
nmodes
;
TRACE
(
" <default>"
);
}
TRACE
(
" Hz
\n
"
);
}
real_xrandr_modes_count
=
nmodes
;
TRACE
(
"XRandR modes: count=%d
\n
"
,
nmodes
);
dd_modes
=
X11DRV_Settings_SetHandlers
(
"XRandR"
,
X11DRV_XRandR_GetCurrentMode
,
X11DRV_XRandR_SetCurrentMode
,
nmodes
,
1
);
for
(
i
=
0
;
i
<
real_xrandr_sizes_count
;
++
i
)
{
if
(
real_xrandr_rates_count
[
i
])
{
for
(
j
=
0
;
j
<
real_xrandr_rates_count
[
i
];
++
j
)
{
X11DRV_Settings_AddOneMode
(
real_xrandr_sizes
[
i
].
width
,
real_xrandr_sizes
[
i
].
height
,
0
,
real_xrandr_rates
[
i
][
j
]
);
}
}
else
{
X11DRV_Settings_AddOneMode
(
real_xrandr_sizes
[
i
].
width
,
real_xrandr_sizes
[
i
].
height
,
0
,
0
);
}
}
X11DRV_Settings_AddDepthModes
();
dd_mode_count
=
X11DRV_Settings_GetModeCount
();
TRACE
(
"Available DD modes: count=%d
\n
"
,
dd_mode_count
);
TRACE
(
"Enabling XRandR
\n
"
);
}
void
X11DRV_XRandR_Init
(
void
)
{
Bool
ok
;
int
i
,
nmodes
=
0
;
if
(
xrandr_major
)
return
;
/* already initialized? */
if
(
!
usexrandr
)
return
;
/* disabled in config */
...
...
@@ -243,52 +286,9 @@ void X11DRV_XRandR_Init(void)
if
(
ok
)
{
TRACE
(
"Found XRandR - major: %d, minor: %d
\n
"
,
xrandr_major
,
xrandr_minor
);
/* retrieve modes */
real_xrandr_sizes
=
pXRRSizes
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
real_xrandr_sizes_count
);
ok
=
(
real_xrandr_sizes_count
>
0
);
}
if
(
ok
)
{
TRACE
(
"XRandR: found %u resolutions sizes
\n
"
,
real_xrandr_sizes_count
);
real_xrandr_rates
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
short
*
)
*
real_xrandr_sizes_count
);
real_xrandr_rates_count
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
int
)
*
real_xrandr_sizes_count
);
for
(
i
=
0
;
i
<
real_xrandr_sizes_count
;
i
++
)
{
real_xrandr_rates
[
i
]
=
pXRRRates
(
gdi_display
,
DefaultScreen
(
gdi_display
),
i
,
&
(
real_xrandr_rates_count
[
i
]));
TRACE
(
"- at %d: %dx%d (%d rates):"
,
i
,
real_xrandr_sizes
[
i
].
width
,
real_xrandr_sizes
[
i
].
height
,
real_xrandr_rates_count
[
i
]);
if
(
real_xrandr_rates_count
[
i
])
{
int
j
;
nmodes
+=
real_xrandr_rates_count
[
i
];
for
(
j
=
0
;
j
<
real_xrandr_rates_count
[
i
];
++
j
)
{
if
(
j
>
0
)
TRACE
(
","
);
TRACE
(
" %d"
,
real_xrandr_rates
[
i
][
j
]);
}
}
else
{
nmodes
++
;
TRACE
(
" <default>"
);
}
TRACE
(
" Hz
\n
"
);
}
xrandr_init_modes
();
}
wine_tsx11_unlock
();
if
(
!
ok
)
return
;
real_xrandr_modes_count
=
nmodes
;
TRACE
(
"XRandR modes: count=%d
\n
"
,
nmodes
);
dd_modes
=
X11DRV_Settings_SetHandlers
(
"XRandR"
,
X11DRV_XRandR_GetCurrentMode
,
X11DRV_XRandR_SetCurrentMode
,
nmodes
,
1
);
make_modes
();
X11DRV_Settings_AddDepthModes
();
dd_mode_count
=
X11DRV_Settings_GetModeCount
();
TRACE
(
"Available DD modes: count=%d
\n
"
,
dd_mode_count
);
TRACE
(
"Enabling XRandR
\n
"
);
}
#else
/* SONAME_LIBXRANDR */
...
...
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