Commit graph

54 commits

Author SHA1 Message Date
Samson
c0bee7cb86
Format toml files (#30112)
* Add taplo fmt config for toml fmt

* fmt toml files

* Add even-better-toml to extensions recommendations
2023-08-17 15:07:43 +00:00
Delan Azabani
2778beeb7a
winit: initial minibrowser (#29976)
* winit: add minibrowser feature that depends on egui{,-winit}

* winit: carve out some space at the top of headed windows

* winit: minimal toolbar and egui/winit integration (but no painting)

* winit: try to paint with egui_glow (doesn’t work yet)

* winit: add comment about toolbar size

* Add framebuffer object, set it as glow's target

* compositing: clear only the viewport, not the whole framebuffer

* plumb the actual size of the egui toolbar to webrender

* fix formatting

* winit: fix crash when fbo is zero

* winit: don’t bother binding the framebuffer object

* winit: remove unsafe and get toolbar_height

* winit: location field should reflect the current top-level url

* [NFC] winit: move Minibrowser out of App::run

* winit: clean up toolbar height code

* winit: make App own the Minibrowser if any

* winit: make the go button work

* winit:make the location field reflect the current top-level url

* winit: allow enabling minibrowser from command line

* winit: tell compositor to repaint WR and flush when we repaint

* winit: fix bug where location field edits would get overridden

* winit: borrow the minibrowser once in App::handle_events

* winit: address todo about viewport origin coordinates

* winit: fix some minor problems with comments and errors

* winit: update location field once per HistoryChanged event

* winit: rename Window::set_toolbar_size to set_toolbar_height

* winit: take toolbar height into account in hit testing

* winit: pass egui only relevant CursorMoved events

* winit: scratch that, coalesce minibrowser updates instead

* ensure both minibrowser and WR are repainted on every frame

* compositing: only skip framebuffer clear in external present mode

* winit: destroy egui glow Painter when shutting down

* winit: clean up and fix license lint

* fix duplicate versions lint by downgrading bytemuck_derive

was egui_glow ^0.22.0 (0.22.0)
→ egui/bytemuck ^0.22.0 (0.22.0)
→ epaint/bytemuck ^0.22.0 (0.22.0)
→ bytemuck ^1.7.2 (1.13.1)
→ bytemuck_derive ^1.4 (1.4.1)
→ syn ^2.0.1 (2.0.28)

now lock has bytemuck_derive 1.4.0
→ syn ^1.0.99 (1.0.103)

* fix duplicate versions lint by disabling egui-winit/links

(we don’t need support for hyperlinks in our use of egui)

* squelch duplicate versions lint by excluding clipboard-win

* winit: fix compile warnings

* winit: make gleam an optional dependency under /minibrowser

* winit: remove cargo feature, since it’s not really optional

* winit: extract Minibrowser and related code to separate module

* winit: remove unnecessary trailing comma

* winit: simplify the ServoUrl serialisation optimisation

---------

Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2023-08-15 08:08:50 +00:00
Martin Robinson
78c7011240
Make native-bluetooth a default feature (#30097)
This features is turned on unconditionally by `./mach build`.
2023-08-14 14:44:47 +00:00
Martin Robinson
170cd44fa4
Clean up some unused code after switching to rustls (#30081)
The SSL certificate resource is no longer used as these certificates are
loaded via the webpki-roots crate.
2023-08-09 01:02:02 +00:00
Ngo Iok Ui (Wu Yu Wei)
3fea90a231
Use raw handles to create surfman context instead (#29871) 2023-08-03 10:54:30 +00:00
Martin Robinson
f3c7db7d0f
Set the MacOS rpath in the build script (#30054)
Use the build script to set the rpath in MacOS instead of mach. This is
another step toward allowing building servo without mach.
2023-08-01 14:46:28 +00:00
Martin Robinson
2ecdb8f45e
Embed git hash using vergen instead of mach (#30030)
Embed the git hash into the servo binary using vergen instead of using
custom Python code in mach. The benefit here is ones less difference
between a normal cargo run and building via mach in addition to removing
a bunch of code.
2023-07-28 05:03:06 +00:00
Delan Azabani
dfeced5a8e
[NFC] winit: document event handling and improve naming (#30016)
* compositing: rename WindowEvent to EmbedderEvent

* winit: rename winit_event_to_{servo → embedder}_event

* winit: rename ServoEvent::Awakened to WakerEvent

* winit: document App::handle_events and rename locals

* servo: rename Servo.embedder_events to messages_for_embedder

* winit: rustdoc link to EmbedderEvent

* winit: use new name queue_embedder_events_for_winit_event
2023-07-24 05:30:18 +00:00
Martin Robinson
d31cdb682f
Make the choice of layout runtime setting
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2023-07-06 14:49:24 +02:00
bors-servo
ed72efa154
Auto merge of #29956 - mrobinson:update-mozangle, r=jdm
Update mozangle

This should allow servo to take advantage of faster compilation times on Windows.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-07-02 02:23:26 +02:00
Martin Robinson
96eeb5865c Update mozangle
This should allow servo to take advantage of faster compilation speeds
on Windows.
2023-07-01 18:41:54 +02:00
Martin Robinson
e681e2b3f3 Set the Windows subsystem using a rust directive
This is one less thing that mach has to do now.
2023-07-01 15:04:26 +02:00
Michael Grigoryan
a1e9f55bba
Update ports/winit/headed_window.rs
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2023-05-21 09:49:51 +04:00
michaelgrigoryan25
b3ce330398 Fix: Fixed a namespacing error 2023-05-21 00:18:46 +04:00
michaelgrigoryan25
93819dc542 Patch: Applied code patches for clippy warnings 2023-05-19 08:01:38 +04:00
Martin Robinson
2f4c47bfe7 Start the transition to workspace dependencies
This will ultimately make it simpler to update crate dependencies and
reduce duplicate when specifying requirements. Generally, this change
does not touch dependencies that are only used by a single crate. We
could consider moving them to workspace dependencies in the future.
2023-05-17 11:59:35 +02:00
sagudev
dffb75a4c6 cargo-fix for 2021 2023-05-07 15:45:56 +02:00
dependabot[bot]
a6b6b7cb41
Bump winit from 0.28.2 to 0.28.3
Bumps [winit](https://github.com/rust-windowing/winit) from 0.28.2 to 0.28.3.
- [Release notes](https://github.com/rust-windowing/winit/releases)
- [Changelog](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/winit/compare/v0.28.2...v0.28.3)

---
updated-dependencies:
- dependency-name: winit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-17 17:28:00 +00:00
dependabot[bot]
6cf8013b93
Bump winit from 0.28.1 to 0.28.2
Bumps [winit](https://github.com/rust-windowing/winit) from 0.28.1 to 0.28.2.
- [Release notes](https://github.com/rust-windowing/winit/releases)
- [Changelog](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/winit/compare/v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: winit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-07 11:06:10 +00:00
bors-servo
05c431f626
Auto merge of #29443 - delan:fix-thread-crash-output, r=jdm
Improve winit/mach segfault output

This patch improves the output that you see when the winit port segfaults, especially when the segfault happens on a layout or script thread, by making two changes to our crash handler and one change to mach.

* we make the crash handler use stderr instead of stdout, because [std::io::stdout](https://doc.rust-lang.org/std/io/fn.stdout.html) allocates when first called, which will often cause a second segfault
* we make the crash handler reraise the signal to terminate abnormally, allowing mach to distinguish it from exiting normally with the same status code as a signal number
* we make mach print different messages for whether the process terminated by signal or exited normally

You can try this yourself by running servo with the following patch:

```diff
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index ac1a7fe21e..77c4c9d087 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -589,6 +589,7 @@ impl LayoutThread {
             rw_data: &rw_data,
             possibly_locked_rw_data: &mut possibly_locked_rw_data,
         };
+        unsafe { std::ptr::read::<usize>(std::ptr::null()); }
         while self.handle_request(&mut rw_data) {
             // Loop indefinitely.
         }
```

Before:

```
$ ./mach run -d about:blank
[should print “Stack trace for "Layout(1,1)"” here, but segfaults]
Servo exited with return value 11
```

After:

```
$ ./mach run -d about:blank
Caught signal 11 in thread "Layout(1,1)"
[should ideally print backtrace here, but segfaults]
Servo was terminated by signal 11
```

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29442

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it would be impractical to test them

(r? @jdm, @SimonSapin based on git log for crash handler)
2023-02-28 15:29:50 +01:00
Delan Azabani
07c1286334 Improve winit/mach segfault output 2023-02-28 21:54:48 +08:00
Josh Matthews
a99dd55584 Ensure winit windows are cleaned up before TLS disappears. 2023-02-27 10:10:17 -05:00
Thomas Gardner
140dda9968 Bump surfman to 0.6
Update to the new release of surfman, and consume it without using the
`patches` section in Cargo.toml.
2023-02-24 19:00:57 +11:00
Josh Matthews
f64814f249 Fix macOS extensions in winit. 2023-02-21 19:15:32 +11:00
Thomas Gardner
f89602948e Bump winit to 0.28.1
This fixes the following wayland-client error:

	Attempted to dispatch unknown opcode 0 for wl_shm, aborting.
2023-02-21 19:15:32 +11:00
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
2023-01-26 08:59:21 +01:00
Josh Matthews
369a5c0370 Update image/png. 2022-04-01 02:07:17 -04:00
Josh Matthews
471650ba90 Update keyboard-types. 2022-04-01 00:35:22 -04:00
s-maurice
4784564d5c move servo_version from config crate to ports/libsimpleservo/api/src/lib.rs and duplicate in ports/winit/main2.rs
Signed-off-by: s-maurice <51819025+s-maurice@users.noreply.github.com>
2022-03-06 01:43:46 +01:00
Josh Matthews
898f66bcd0 Update rustc. 2021-12-02 17:05:19 -05:00
Josh Matthews
6b50d7025c Create initial browser id for compositor on startup. 2021-10-18 09:58:32 -04:00
yvt
41b3726271 feat: shorten thread names
The Linux kernel imposes a 15-byte limit on thread names[1]. This means
information that does not fit in this limit, e.g., the pipeline ID of
layout and script threads, is lost in a debugger and profiler (see the
first column of the table below).

This commit shortens the thread names used in Servo to maximize the
amount of information conveyed. It also rectifies some inconsistencies
in the names.

|       Before      |       After       |
|-------------------|-------------------|
| `BluetoothThread` | `Bluetooth`       |
| `CanvasThread`    | `Canvas`          |
| `display alert d` | `AlertDialog`     |
| `FontCacheThread` | `FontCache`       |
| `GLPlayerThread`  | `GLPlayer`        |
| `HTML Parser`     | `Parse:www.examp` |
| `LayoutThread Pi` | `Layout(1,1)`     |
| `Memory profiler` | `MemoryProfiler`  |
| `Memory profiler` | `MemoryProfTimer` |
| `OfflineAudioCon` | `OfflineACResolv` |
| `PullTimelineMar` | `PullTimelineDat` |
| `ScriptThread Pi` | `Script(1,1)`     |
| `WebWorker for h` | `WW:www.example.` |
| `ServiceWorker f` | `SW:www.example.` |
| `ServiceWorkerMa` | `SvcWorkerManage` |
| `Time profiler t` | `TimeProfTimer`   |
| `Time profiler`   | `TimeProfiler`    |
| `WebGL thread`    | `WebGL`           |
| `Choose a device` | `DevicePicker`    |
| `Pick a file`     | `FilePicker`      |
| `Pick files`      | `FilePicker`      |

[1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars
2021-07-19 00:57:48 +09:00
Philip Lamb
b8a74e89cf Improve IME messaging to embedder with insertion point index and multiline flag. 2021-03-29 17:55:54 +13:00
Josh Matthews
21e31547ea Don't use headless winit event loop on macOS. 2021-03-14 17:24:30 -04:00
Paulo E. Castro
84b06ab6d1 Work around absense of winit::event_loop in headless case. 2021-03-11 00:24:13 +00:00
Josh Matthews
49ddc5ea3d Only request synchronous repaint when a resize will actually occur. 2021-03-05 20:00:30 -05:00
Josh Matthews
10231573be Update to winit 0.24.
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Paulo E. Castro <pecastro@wormholenet.com>
2021-03-05 20:00:30 -05:00
Simon Sapin
2dd3c05479 Manually reformat ports/winit/**/*.rs
`cargo fmt` misses these files, possibly because of `include!` or `#[cfg]` in `main.rs`. This commit runs `rustfmt` directly.
2021-02-25 20:31:42 +01:00
Simon Sapin
a0d9f97c8e Fix warnings introduced in newer Rust Nightly
This does not (yet) upgrade ./rust-toolchain

The warnings:

* dead_code "field is never read"
* redundant_semicolons "unnecessary trailing semicolon"
* non_fmt_panic "panic message is not a string literal, this is no longer accepted in Rust 2021"
* unstable_name_collisions "a method with this name may be added to the standard library in the future"
* legacy_derive_helpers "derive helper attribute is used before it is introduced" https://github.com/rust-lang/rust/issues/79202
2021-02-25 15:36:03 +01:00
Michael Mc Donnell
304fe775b3
Extract crash handler
Moved the crash handler code into its own file since it is a distinct concept.  It
simplifies the main method a little.
2021-02-16 09:49:41 -08:00
YUAN LYU
e15bc7516c Fix mouse button handling 2020-12-06 00:21:21 -05:00
Alan Jeffrey
50e168a688 Gstreamer plugin support for streaming from webxr 2020-07-16 14:16:32 -05:00
Alan Jeffrey
a2142d7dbd Add support for webxr cubemap and spherical 360 rendering 2020-07-09 14:02:23 -05:00
Paul Rouget
34265c872e UWP: support virtual keyboard 2020-07-02 10:57:34 +02:00
bors-servo
b7e1a9ae8b
Auto merge of #27118 - atouchet:icon, r=jdm
Update Servo logo files

<!-- Please describe your changes on the following line: -->
Update of #25846. Add new Servo logo files and remove some old versions.

Closes #25846

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-06-30 10:45:11 -04:00
Alex Touchet
c379b65307
Update Servo logo files 2020-06-29 23:20:54 -07:00
Paul Rouget
7653c6c9fc update keyboard-types crate 2020-06-29 10:27:54 +02:00
Alan Jeffrey
349619ed2d Support for webxr layer management 2020-06-28 16:37:45 -05:00
Paul Rouget
8cf2f14baa Allow embedder to bypass devtools prompt 2020-06-22 11:47:03 +02:00
Josh Matthews
87724ec9a4 Generate keyup events for printable keys. 2020-06-12 18:25:28 -04:00