-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from pbouffard-muon/macos-set-window-icon-fix
Ignore SetWindowIcon calls on MacOS
- Loading branch information
Showing
2 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
using GLFW, Test | ||
|
||
window = GLFW.CreateWindow(800, 600, "InexactError") | ||
@test !GLFW.WindowShouldClose(window) | ||
# If you call the julia function GLFW.SetWindowShouldClose(window, | ||
# truefalse), then only 0 or 1 can be passed. However, at least on | ||
# some platforms (Linux), clicking on the window's close icon can send | ||
# other values (like 189). Make sure such values don't cause trouble for | ||
# GLFW.WindowShouldClose. | ||
ccall((:glfwSetWindowShouldClose, GLFW.libglfw), Cvoid, (GLFW.Window, Cint), window, 189) | ||
@test GLFW.WindowShouldClose(window) | ||
GLFW.DestroyWindow(window) | ||
@testset "WindowShouldClose" begin | ||
window = GLFW.CreateWindow(800, 600, "InexactError") | ||
@test !GLFW.WindowShouldClose(window) | ||
# If you call the julia function GLFW.SetWindowShouldClose(window, | ||
# truefalse), then only 0 or 1 can be passed. However, at least on | ||
# some platforms (Linux), clicking on the window's close icon can send | ||
# other values (like 189). Make sure such values don't cause trouble for | ||
# GLFW.WindowShouldClose. | ||
ccall((:glfwSetWindowShouldClose, GLFW.libglfw), Cvoid, (GLFW.Window, Cint), window, 189) | ||
@test GLFW.WindowShouldClose(window) | ||
GLFW.DestroyWindow(window) | ||
end | ||
|
||
@testset "SetWindowIcon" begin | ||
window = GLFW.CreateWindow(800, 600, "InexactError") | ||
icon = reshape([repeat([(0x00, 0x00, 0x00, 0x00)], 128 * 128)...], (128,128)) | ||
# 2 methods, test both: | ||
GLFW.SetWindowIcon(window, icon) | ||
GLFW.SetWindowIcon(window, [icon]) | ||
GLFW.DestroyWindow(window) | ||
end |