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
c9a3f95e
Commit
c9a3f95e
authored
10 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Constantly watch vstat.scaling for changes in both SDL and X11 output modes.
parent
4d15f969
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conio/sdl_con.c
+6
-1
6 additions, 1 deletion
src/conio/sdl_con.c
src/conio/x_events.c
+13
-0
13 additions, 0 deletions
src/conio/x_events.c
with
19 additions
and
1 deletion
src/conio/sdl_con.c
+
6
−
1
View file @
c9a3f95e
...
...
@@ -1460,6 +1460,8 @@ int sdl_video_event_thread(void *data)
{
SDL_Event
ev
;
int
new_scaling
=
-
1
;
int
old_scaling
=
vstat
.
scaling
;
fprintf
(
stderr
,
"At start, scaling is %d
\n
"
,
old_scaling
);
if
(
!
init_sdl_video
())
{
char
driver
[
16
];
...
...
@@ -1482,7 +1484,9 @@ int sdl_video_event_thread(void *data)
while
(
1
)
{
if
(
sdl
.
PollEvent
(
&
ev
)
!=
1
)
{
if
(
new_scaling
!=
-
1
)
{
if
(
new_scaling
!=
-
1
||
vstat
.
scaling
!=
old_scaling
)
{
if
(
new_scaling
==
-
1
)
new_scaling
=
vstat
.
scaling
;
if
(
pthread_mutex_trylock
(
&
vstatlock
)
==
0
)
{
vstat
.
scaling
=
new_scaling
;
new_scaling
=
-
1
;
...
...
@@ -1491,6 +1495,7 @@ int sdl_video_event_thread(void *data)
pthread_mutex_unlock
(
&
vstatlock
);
setup_surfaces
();
}
old_scaling
=
vstat
.
scaling
;
}
SLEEP
(
1
);
}
...
...
This diff is collapsed.
Click to expand it.
src/conio/x_events.c
+
13
−
0
View file @
c9a3f95e
...
...
@@ -65,6 +65,8 @@ static unsigned long black;
static
unsigned
long
white
;
static
int
bitmap_width
=
0
;
static
int
bitmap_height
=
0
;
static
int
old_scaling
=
0
;
/* Array of Graphics Contexts */
static
GC
gca
[
sizeof
(
dac_default
)
/
sizeof
(
struct
dac_colors
)];
...
...
@@ -428,6 +430,7 @@ static void handle_resize_event(int width, int height)
vstat
.
scaling
=
newFSH
;
else
vstat
.
scaling
=
newFSW
;
old_scaling
=
vstat
.
scaling
;
if
(
vstat
.
scaling
>
16
)
vstat
.
scaling
=
16
;
/*
...
...
@@ -814,6 +817,14 @@ static int x11_event(XEvent *ev)
return
(
0
);
}
void
check_scaling
(
void
)
{
if
(
old_scaling
!=
vstat
.
scaling
)
{
resize_window
();
old_scaling
=
vstat
.
scaling
;
}
}
void
x11_event_thread
(
void
*
args
)
{
int
x
;
...
...
@@ -836,6 +847,8 @@ void x11_event_thread(void *args)
high_fd
=
xfd
;
for
(;;)
{
check_scaling
();
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
54925
;
/* was 54925 (was also 10) */
...
...
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