Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI overhaul #194

Draft
wants to merge 78 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
5098aa3
freezes on Page event
samizdatco Nov 27, 2024
ebc7d9b
patch out multi-threading
samizdatco Nov 27, 2024
dd190b3
dispatch events to windows on main thread
samizdatco Nov 27, 2024
262c3c5
move threading from the window to the renderer
samizdatco Nov 28, 2024
74b0abc
use old-style event handling so roundtrip closure can be shared
samizdatco Nov 28, 2024
c6b1527
make native/node event-loop mode selectable
samizdatco Nov 28, 2024
20ce7e6
replace `gui::app` module
samizdatco Nov 28, 2024
02574ad
return event loop status from activate()
samizdatco Nov 28, 2024
a66d24a
dispatch window events immediately rather than queueing
samizdatco Nov 29, 2024
ab8dbe0
fix es module path & add default export
samizdatco Nov 29, 2024
a9542c1
abandon DirectContext before dropping Window
samizdatco Nov 29, 2024
bf0bc83
unify Window & WindowRef
samizdatco Nov 29, 2024
e18582e
refactor renderer events and gpu imports
samizdatco Nov 30, 2024
e9879d3
drop unused queue reference
samizdatco Nov 30, 2024
14593b1
fix: underflow for very short windows
samizdatco Nov 30, 2024
bd42572
draw window's `.background` behind canvas
samizdatco Nov 30, 2024
933c6f5
allow windows to be added post-launch
samizdatco Nov 30, 2024
0188241
make event loop restartable after last window is closed
samizdatco Nov 30, 2024
decf1e1
add App repr
samizdatco Nov 30, 2024
8e2c910
add `open` and `close` window events to App
samizdatco Nov 30, 2024
9b6f373
close all windows before quitting
samizdatco Nov 30, 2024
163b68c
run an addition `pump_events` pass on window open/close
samizdatco Nov 30, 2024
ef586ba
allow process termination after all windows are closed
samizdatco Nov 30, 2024
84ff393
move render closure into private method
samizdatco Nov 30, 2024
dac24c8
expose window.id
samizdatco Nov 30, 2024
70e36a0
use plain integers for window.id
samizdatco Nov 30, 2024
e6d9b9c
fix cursor selection on window creation
samizdatco Dec 1, 2024
f89a310
restore pre-render wakeup to Cadence
samizdatco Dec 1, 2024
2b043c1
render in the same pass as the Cadence trigger
samizdatco Dec 1, 2024
eb4644e
spin within Cadence for final 10% of frame time (≤1.5ms)
samizdatco Dec 1, 2024
fc9db55
loop nonstop in App and let Cadence handle timing
samizdatco Dec 1, 2024
3c30f42
reorder methods
samizdatco Dec 1, 2024
92d3508
add `rev` counter to Page and only redraw if changed
samizdatco Dec 1, 2024
14ccc13
only discard stale Draw events, apply all Resizes
samizdatco Dec 1, 2024
97fea06
delete comment
samizdatco Dec 1, 2024
a0bb3c7
fix cursor type validation
samizdatco Dec 1, 2024
27eb166
move `pre_present_notify` into renderers
samizdatco Dec 1, 2024
936f8c8
drop special-case window_mgr setters
samizdatco Dec 1, 2024
2248265
update win spec when position/size changes via gui
samizdatco Dec 1, 2024
71f33c3
fix fullscreen notifications on macs with display notch
samizdatco Dec 1, 2024
7710418
fix spurious `Moved` window events
samizdatco Dec 1, 2024
7742fd9
separate filter & map logic
samizdatco Dec 1, 2024
ec7e347
only run on new pull requests
samizdatco Dec 1, 2024
a20776b
simplify fullscreen state-change detection
samizdatco Dec 2, 2024
c2e493a
dispatch fullscreen events when state toggled
samizdatco Dec 2, 2024
d623b21
clean up imports
samizdatco Dec 2, 2024
5482926
satisfy linter
samizdatco Dec 2, 2024
0234838
rename AppEvent
samizdatco Dec 4, 2024
aff3e0e
merge global GUI state into App
samizdatco Dec 4, 2024
63999c8
replace `getWindow` with private method
samizdatco Dec 4, 2024
e2bb9b7
have windows signal open/close via events
samizdatco Dec 4, 2024
d736470
revamp event dispatch
samizdatco Dec 4, 2024
3452c97
use `raw-window-metal` crate to access Layer
samizdatco Dec 5, 2024
218bd36
filter vulkan format/color types based on skia support
samizdatco Dec 5, 2024
b353d9c
pass window reference to backend
samizdatco Dec 5, 2024
367431d
make vulkan format static
samizdatco Dec 5, 2024
f368fa1
move gpu backends off their per-window threads
samizdatco Dec 6, 2024
e98a80a
fix for intel integrated GPUs
samizdatco Dec 7, 2024
6e40907
classify software implementations of vulkan as `GPU`
samizdatco Dec 7, 2024
896c170
move looping into async `App.launch()`
samizdatco Dec 10, 2024
d5cf6da
initialize Cadence with 60 Hz default rate
samizdatco Dec 10, 2024
7d7e891
redraw synchronously during resizes (on mac only)
samizdatco Dec 10, 2024
836637f
refactor event loop handling into App
samizdatco Dec 11, 2024
c6e675d
simplify callback closure to just providing `cx` reference
samizdatco Dec 11, 2024
ce1af5f
pass all mouse events rather than coalescing
samizdatco Dec 12, 2024
a21093e
use correct `inputType` for whitespace/deletion/composition
samizdatco Dec 12, 2024
4bce46c
let Cadence schedule event polling time
samizdatco Dec 14, 2024
b16a2eb
fix cursor selection/hiding
samizdatco Dec 14, 2024
c2b1e22
add `buttons` bitfield to mouse events
samizdatco Dec 14, 2024
7251a49
update event, App, & export types
samizdatco Dec 15, 2024
4f66781
pin ubuntu 22
samizdatco Dec 16, 2024
1ba4e57
remove debug logging
samizdatco Dec 16, 2024
323524e
use `rev` and layer count to detect changes
samizdatco Dec 16, 2024
0b0bf14
upgrade winit to 0.30.7
samizdatco Dec 26, 2024
1bc593e
Revert "fix spurious `Moved` window events"
samizdatco Dec 26, 2024
1fac0ce
check for window support before registering App callback
samizdatco Dec 26, 2024
dae1472
move event-capture to App
samizdatco Dec 26, 2024
db6c1c5
upgrade winit to 0.30.8
samizdatco Jan 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
workflow_dispatch:
push:
pull_request:
branches:
- main
types: [opened, reopened]
branches: [main]

jobs:
run-tests:
Expand All @@ -16,7 +16,7 @@ jobs:
os:
- macos-latest
- windows-latest
- ubuntu-latest
- ubuntu-22.04
node:
- 16
- 22
Expand Down
26 changes: 24 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ crate-type = ["cdylib"]
lto = "fat"

[features]
metal = ["skia-safe/metal", "dep:metal", "dep:raw-window-handle", "dep:core-graphics-types", "dep:cocoa", "dep:objc"]
metal = ["skia-safe/metal", "dep:metal", "dep:raw-window-handle", "dep:raw-window-metal", "dep:core-graphics-types", "dep:cocoa", "dep:objc"]
vulkan = ["skia-safe/vulkan", "winit/rwh_05", "dep:ash", "dep:vulkano"]
window = ["dep:winit"]
window = ["dep:winit", "dep:spin_sleep"]

[dependencies]
neon = "1.0"
Expand All @@ -37,9 +37,11 @@ vulkano = { version = "0.34.1", optional = true }
# metal
metal = { version = "0.29", optional = true }
raw-window-handle = { version = "0.6", optional = true }
raw-window-metal = { version = "1.0.0", optional = true }
core-graphics-types = { version = "0.1.1", optional = true }
cocoa = { version = "0.26.0", optional = true }
objc = { version = "0.2.7", optional = true }

# window
winit = { version = '0.30.5', features = ["serde"], optional = true }
winit = { version = '0.30.8', features = ["serde"], optional = true }
spin_sleep = {version = "1.2.1", optional = true }
11 changes: 7 additions & 4 deletions lib/classes/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,15 @@ function parseTextDecoration(str){


// -- Window Types -----------------------------------------------------------------------

let cursorTypes = [
"default", "crosshair", "hand", "arrow", "move", "text", "wait", "help", "progress", "not-allowed", "context-menu",
"cell", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "zoom-in", "zoom-out",
"e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize",
"ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "none"
"default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair",
"text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing",
"e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize",
"ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll",
"zoom-in", "zoom-out",
]

function parseCursor(str){
return cursorTypes.includes(str)
}
Expand Down
Loading