Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glfw
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
glfw
Commits
9dd3b810
Commit
9dd3b810
authored
9 years ago
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Clarify Win32 getWindowFullSize
parent
d84772d6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/win32_window.c
+10
-8
10 additions, 8 deletions
src/win32_window.c
with
10 additions
and
8 deletions
src/win32_window.c
+
10
−
8
View file @
9dd3b810
...
@@ -69,15 +69,14 @@ static DWORD getWindowExStyle(const _GLFWwindow* window)
...
@@ -69,15 +69,14 @@ static DWORD getWindowExStyle(const _GLFWwindow* window)
return
style
;
return
style
;
}
}
// Translate client window size to full window size
(including window borders)
// Translate client window size to full window size
according to styles
//
//
static
void
getFullWindowSize
(
_GLFWwindow
*
window
,
static
void
getFullWindowSize
(
DWORD
style
,
DWORD
exStyle
,
int
clientWidth
,
int
clientHeight
,
int
clientWidth
,
int
clientHeight
,
int
*
fullWidth
,
int
*
fullHeight
)
int
*
fullWidth
,
int
*
fullHeight
)
{
{
RECT
rect
=
{
0
,
0
,
clientWidth
,
clientHeight
};
RECT
rect
=
{
0
,
0
,
clientWidth
,
clientHeight
};
AdjustWindowRectEx
(
&
rect
,
getWindowStyle
(
window
),
AdjustWindowRectEx
(
&
rect
,
style
,
FALSE
,
exStyle
);
FALSE
,
getWindowExStyle
(
window
));
*
fullWidth
=
rect
.
right
-
rect
.
left
;
*
fullWidth
=
rect
.
right
-
rect
.
left
;
*
fullHeight
=
rect
.
bottom
-
rect
.
top
;
*
fullHeight
=
rect
.
bottom
-
rect
.
top
;
}
}
...
@@ -90,7 +89,8 @@ static void applyAspectRatio(_GLFWwindow* window, int edge, RECT* area)
...
@@ -90,7 +89,8 @@ static void applyAspectRatio(_GLFWwindow* window, int edge, RECT* area)
const
float
ratio
=
(
float
)
window
->
win32
.
numer
/
const
float
ratio
=
(
float
)
window
->
win32
.
numer
/
(
float
)
window
->
win32
.
denom
;
(
float
)
window
->
win32
.
denom
;
getFullWindowSize
(
window
,
0
,
0
,
&
xoff
,
&
yoff
);
getFullWindowSize
(
getWindowStyle
(
window
),
getWindowExStyle
(
window
),
0
,
0
,
&
xoff
,
&
yoff
);
if
(
edge
==
WMSZ_LEFT
||
edge
==
WMSZ_BOTTOMLEFT
||
if
(
edge
==
WMSZ_LEFT
||
edge
==
WMSZ_BOTTOMLEFT
||
edge
==
WMSZ_RIGHT
||
edge
==
WMSZ_BOTTOMRIGHT
)
edge
==
WMSZ_RIGHT
||
edge
==
WMSZ_BOTTOMRIGHT
)
...
@@ -560,7 +560,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
...
@@ -560,7 +560,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
{
{
int
xoff
,
yoff
;
int
xoff
,
yoff
;
MINMAXINFO
*
mmi
=
(
MINMAXINFO
*
)
lParam
;
MINMAXINFO
*
mmi
=
(
MINMAXINFO
*
)
lParam
;
getFullWindowSize
(
window
,
0
,
0
,
&
xoff
,
&
yoff
);
getFullWindowSize
(
getWindowStyle
(
window
),
getWindowExStyle
(
window
),
0
,
0
,
&
xoff
,
&
yoff
);
if
(
window
->
win32
.
minwidth
!=
GLFW_DONT_CARE
&&
if
(
window
->
win32
.
minwidth
!=
GLFW_DONT_CARE
&&
window
->
win32
.
minheight
!=
GLFW_DONT_CARE
)
window
->
win32
.
minheight
!=
GLFW_DONT_CARE
)
...
@@ -685,7 +686,7 @@ static GLFWbool createWindow(_GLFWwindow* window,
...
@@ -685,7 +686,7 @@ static GLFWbool createWindow(_GLFWwindow* window,
xpos
=
CW_USEDEFAULT
;
xpos
=
CW_USEDEFAULT
;
ypos
=
CW_USEDEFAULT
;
ypos
=
CW_USEDEFAULT
;
getFullWindowSize
(
window
,
getFullWindowSize
(
getWindowStyle
(
window
),
getWindowExStyle
(
window
)
,
wndconfig
->
width
,
wndconfig
->
height
,
wndconfig
->
width
,
wndconfig
->
height
,
&
fullWidth
,
&
fullHeight
);
&
fullWidth
,
&
fullHeight
);
}
}
...
@@ -934,7 +935,8 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
...
@@ -934,7 +935,8 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
else
else
{
{
int
fullWidth
,
fullHeight
;
int
fullWidth
,
fullHeight
;
getFullWindowSize
(
window
,
width
,
height
,
&
fullWidth
,
&
fullHeight
);
getFullWindowSize
(
getWindowStyle
(
window
),
getWindowExStyle
(
window
),
width
,
height
,
&
fullWidth
,
&
fullHeight
);
SetWindowPos
(
window
->
win32
.
handle
,
HWND_TOP
,
SetWindowPos
(
window
->
win32
.
handle
,
HWND_TOP
,
0
,
0
,
fullWidth
,
fullHeight
,
0
,
0
,
fullWidth
,
fullHeight
,
...
...
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