Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Main
Synchronet
Commits
8032b14c
Commit
8032b14c
authored
1 year ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Some cleanup, make SDL hyper turbo DPI aware as well.
parent
21c62012
No related branches found
No related tags found
No related merge requests found
Pipeline
#5860
passed
1 year ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conio/sdlfuncs.c
+13
-4
13 additions, 4 deletions
src/conio/sdlfuncs.c
src/conio/win32gdi.c
+2
-8
2 additions, 8 deletions
src/conio/win32gdi.c
with
15 additions
and
12 deletions
src/conio/sdlfuncs.c
+
13
−
4
View file @
8032b14c
...
...
@@ -240,11 +240,12 @@ int init_sdl_video(void)
// code that tells windows we're High DPI aware so it doesn't scale our windows
// taken from Yamagi Quake II
typedef
enum
D3_PROCESS_DPI_AWARENESS
{
enum
D3_PROCESS_DPI_AWARENESS
{
D3_PROCESS_DPI_UNAWARE
=
0
,
D3_PROCESS_SYSTEM_DPI_AWARE
=
1
,
D3_PROCESS_PER_MONITOR_DPI_AWARE
=
2
}
YQ2_PROCESS_DPI_AWARENESS
;
D3_PROCESS_PER_MONITOR_DPI_AWARE
=
2
,
D3_PROCESS_PER_MONITOR_DPI_AWARE_V2
=
3
,
};
/* For Vista, Win7 and Win8 */
BOOL
(
WINAPI
*
SetProcessDPIAware
)(
void
)
=
NULL
;
...
...
@@ -252,12 +253,16 @@ int init_sdl_video(void)
/* Win8.1 and later */
HRESULT
(
WINAPI
*
SetProcessDpiAwareness
)(
enum
D3_PROCESS_DPI_AWARENESS
dpiAwareness
)
=
NULL
;
/* Win10v1703 and later */
HRESULT
(
WINAPI
*
SetProcessDpiAwarenessContext
)(
enum
D3_PROCESS_DPI_AWARENESS
dpiAwareness
)
=
NULL
;
const
char
*
user32dll
[]
=
{
"User32"
,
NULL
};
dll_handle
userDLL
=
xp_dlopen
(
user32dll
,
RTLD_LAZY
,
0
);
if
(
userDLL
)
{
SetProcessDPIAware
=
xp_dlsym
(
userDLL
,
SetProcessDPIAware
);
SetProcessDpiAwarenessContext
=
xp_dlsym
(
userDLL
,
SetProcessDpiAwarenessContext
);
}
...
...
@@ -269,7 +274,11 @@ int init_sdl_video(void)
SetProcessDpiAwareness
=
xp_dlsym
(
shcoreDLL
,
SetProcessDpiAwareness
);
}
if
(
SetProcessDpiAwareness
)
{
if
(
SetProcessDpiAwarenessContext
)
{
if
(
!
SetProcessDpiAwarenessContext
(
D3_PROCESS_PER_MONITOR_DPI_AWARE_V2
))
SetProcessDpiAwarenessContext
(
D3_PROCESS_PER_MONITOR_DPI_AWARE
);
}
else
if
(
SetProcessDpiAwareness
)
{
SetProcessDpiAwareness
(
D3_PROCESS_PER_MONITOR_DPI_AWARE
);
}
else
if
(
SetProcessDPIAware
)
{
...
...
This diff is collapsed.
Click to expand it.
src/conio/win32gdi.c
+
2
−
8
View file @
8032b14c
...
...
@@ -429,10 +429,8 @@ gdi_handle_wm_char(WPARAM wParam, LPARAM lParam)
uint8_t
ch
;
uint16_t
repeat
;
uint16_t
i
;
bool
alt
;
repeat
=
lParam
&
0xffff
;
alt
=
lParam
&
(
1
<<
29
);
if
(
IS_HIGH_SURROGATE
(
wParam
))
{
highpair
=
wParam
;
return
0
;
...
...
@@ -527,10 +525,6 @@ gdi_handle_mouse_wheel(int16_t distance, LPARAM lParam)
static
LRESULT
gdi_handle_activate
(
HWND
hwnd
,
WPARAM
wParam
)
{
static
LPCTSTR
lc
=
IDC_IBEAM
;
uint16_t
lw
=
wParam
&
0xffff
;
// TODO: We may need to read the state of CTRL and SHIFT keys for extended key input...
return
0
;
}
...
...
@@ -1169,12 +1163,12 @@ gdi_init(int mode)
// code that tells windows we're High DPI aware so it doesn't scale our windows
// taken from Yamagi Quake II
typedef
enum
D3_PROCESS_DPI_AWARENESS
{
enum
D3_PROCESS_DPI_AWARENESS
{
D3_PROCESS_DPI_UNAWARE
=
0
,
D3_PROCESS_SYSTEM_DPI_AWARE
=
1
,
D3_PROCESS_PER_MONITOR_DPI_AWARE
=
2
,
D3_PROCESS_PER_MONITOR_DPI_AWARE_V2
=
3
,
}
YQ2_PROCESS_DPI_AWARENESS
;
};
/* For Vista, Win7 and Win8 */
BOOL
(
WINAPI
*
SetProcessDPIAware
)(
void
)
=
NULL
;
...
...
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