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
1fe319d2
Commit
1fe319d2
authored
Nov 16, 2017
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Cocoa: Filter out duplicate size events
Fixes #1085.
parent
d6306846
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
src/cocoa_platform.h
+4
-0
4 additions, 0 deletions
src/cocoa_platform.h
src/cocoa_window.m
+25
-3
25 additions, 3 deletions
src/cocoa_window.m
with
30 additions
and
3 deletions
README.md
+
1
−
0
View file @
1fe319d2
...
...
@@ -246,6 +246,7 @@ information on what to include when reporting a bug.
-
[Cocoa] Bugfix: Some characters did not repeat due to Press and Hold (#1010)
-
[Cocoa] Bugfix: Window title was lost when full screen or undecorated (#1082)
-
[Cocoa] Bugfix: Window was resized twice when entering full screen (#1085)
-
[Cocoa] Bugfix: Duplicate size events were not filtered (#1085)
-
[WGL] Added support for
`WGL_EXT_colorspace`
for OpenGL ES contexts
-
[WGL] Added support for
`WGL_ARB_create_context_no_error`
-
[GLX] Added support for
`GLX_ARB_create_context_no_error`
...
...
This diff is collapsed.
Click to expand it.
src/cocoa_platform.h
+
4
−
0
View file @
1fe319d2
...
...
@@ -88,6 +88,10 @@ typedef struct _GLFWwindowNS
GLFWbool
maximized
;
// Cached window and framebuffer sizes used to filter out duplicate events
int
width
,
height
;
int
fbWidth
,
fbHeight
;
// The total sum of the distances the cursor has been warped
// since the last cursor motion event was processed
// This is kept to counteract Cocoa doing the same internally
...
...
This diff is collapsed.
Click to expand it.
src/cocoa_window.m
+
25
−
3
View file @
1fe319d2
...
...
@@ -267,9 +267,22 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
const
NSRect
contentRect
=
[
window
->
ns
.
view
frame
];
const
NSRect
fbRect
=
[
window
->
ns
.
view
convertRectToBacking
:
contentRect
];
if
(
fbRect
.
size
.
width
!=
window
->
ns
.
fbWidth
||
fbRect
.
size
.
height
!=
window
->
ns
.
fbHeight
)
{
window
->
ns
.
fbWidth
=
fbRect
.
size
.
width
;
window
->
ns
.
fbHeight
=
fbRect
.
size
.
height
;
_glfwInputFramebufferSize
(
window
,
fbRect
.
size
.
width
,
fbRect
.
size
.
height
);
}
if
(
contentRect
.
size
.
width
!=
window
->
ns
.
width
||
contentRect
.
size
.
height
!=
window
->
ns
.
height
)
{
window
->
ns
.
width
=
contentRect
.
size
.
width
;
window
->
ns
.
height
=
contentRect
.
size
.
height
;
_glfwInputWindowSize
(
window
,
contentRect
.
size
.
width
,
contentRect
.
size
.
height
);
}
}
-
(
void
)
windowDidMove
:(
NSNotification
*
)
notification
{
...
...
@@ -551,8 +564,14 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
const
NSRect
contentRect
=
[
window
->
ns
.
view
frame
];
const
NSRect
fbRect
=
[
window
->
ns
.
view
convertRectToBacking
:
contentRect
];
if
(
fbRect
.
size
.
width
!=
window
->
ns
.
fbWidth
||
fbRect
.
size
.
height
!=
window
->
ns
.
fbHeight
)
{
window
->
ns
.
fbWidth
=
fbRect
.
size
.
width
;
window
->
ns
.
fbHeight
=
fbRect
.
size
.
height
;
_glfwInputFramebufferSize
(
window
,
fbRect
.
size
.
width
,
fbRect
.
size
.
height
);
}
}
-
(
void
)
drawRect
:(
NSRect
)
rect
{
...
...
@@ -1095,6 +1114,9 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
[
window
->
ns
.
object
setAcceptsMouseMovedEvents
:
YES
];
[
window
->
ns
.
object
setRestorable
:
NO
];
_glfwPlatformGetWindowSize
(
window
,
&
window
->
ns
.
width
,
&
window
->
ns
.
height
);
_glfwPlatformGetFramebufferSize
(
window
,
&
window
->
ns
.
fbWidth
,
&
window
->
ns
.
fbHeight
);
return
GLFW_TRUE
;
}
...
...
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
sign in
to comment