Commit Graph
1033 Commits
Author SHA1 Message Date
Thayne McCombs ccb7270dd7 Upgrade smithay-client-toolkit to 0.19
closes: https://github.com/wez/wezterm/pull/5781
2024-07-13 10:49:45 -07:00
Michael Baird af4f5edb50 Fix notch avoidance padding in full screen mode
Fixes https://github.com/wez/wezterm/issues/3807

The values returned by [`safeAreaInsets`][0] need to be multipled by the
scale factor of the display (in case of the MacBook Pro 14-inch, 2021, a
value of 2.0).

There's a code comment referencing [#1737 (comment)][1], where an extra
`2` was added to this number, but something must have changed since then
because I cannot see a need for this now.

[0]: https://developer.apple.com/documentation/appkit/nsscreen/3882821-safeareainsets
[1]: https://github.com/wez/wezterm/issues/1737#issuecomment-1085923867
2024-06-07 17:40:11 -07:00
Wez Furlong f1a0842608 windows: fix warning 2024-05-13 19:07:55 -07:00
Wez Furlong a597803c13 windows: fixup for newer libloading 2024-05-13 15:54:14 -07:00
Wez Furlong 421ce4f0e1 deps: update zbus 2024-05-13 09:56:11 -07:00
Wez Furlong c6ffe92853 deps: remove a duplicate version of libloading 2024-05-13 09:45:45 -07:00
Wez Furlong 6c890c3995 update metrics to latest version (0.22) 2024-05-13 09:41:12 -07:00
Jeffrey Knockel 79ce027d38 x11: fix exposures on child window
We should watch the child window for exposure events, not the parent
window (the parent window is just a background color and we never paint
to it).

This was a regression from commit 809bcc55.

Fixes #5405.
2024-05-10 13:39:48 -07:00
Daniel Berlin 5b0b657b30 Update wayland keymap handling for protocol 7+.
Newer wayland protocol expects us to mmap the keymap file
descriptor (and do so with certain mmap flags).

The current code tries to handle both normal files and pipes,
but neither will work in some cases.

This updates the code to use xkbcommon's new_from_fd,
which is what the toolkit uses, and mmap's the file.

This fixes #5393, which was caused by hanging when
trying to read the file as if it was a pipe.
2024-05-10 05:49:09 -07:00
Jeffrey Knockel 814857cd69 x11: fix positioning with --position arg
The child window should always have position 0,0.

This was a regression from commit 809bcc55.

Fixes #5395.
2024-05-09 16:48:06 -07:00
Thayne McCombs 0b50725f67 Handle missing data device manager more gracefully 2024-05-06 14:52:55 -07:00
Wez Furlong 265b85be1d update image to 0.25
This improves how non-conforming jpegs are decoded and displayed.

refs: https://github.com/wez/wezterm/issues/5365
2024-05-05 16:14:46 -07:00
Jeffrey Knockel 809bcc55a5 x11: fix window contents jumping on async resize
We can't hope to keep the renderer's idea of the window size consistent
with the actual window size when the user can asynchronously change its
size at any moment. Therefore, we create a child window which we render
to and which we synchronously resize in response to async resizes. Since
by default the contents of X11 windows are undefined on resize, we take
the additional steps of setting our windows' X11 background color and
bit gravity as appropriate.
2024-05-05 14:06:46 -07:00
Martin Nowak d70624b169 fix #4985 - reimplement get_appearance for wayland
- was dropped with wayland reimplementation (#4777, 3eaba4e3d6)
- get appearance from xdg desktop portal
- advise all windows of appearance changes to reload config
2024-05-05 13:50:45 -07:00
Kushagra Gupta d9455a45fe fixed the issue #5348 and a typo
Fixed the issue #5348 for windows by setting margins check for window decoration instead and using value 0 margin for only the TITLE style
2024-05-05 13:09:14 -07:00
Wez Furlong 1598579551 x11: refactor x11 dnd a little
Reduce some nesting and make it a little easier to follow.

refs: https://github.com/wez/wezterm/pull/5316
2024-05-05 13:02:40 -07:00
Stefan Siegel 3d511bbd67 Accept drag and drop of URLs from browsers and plain text on X11
For filenames and urls an additional space is inserted after the last
item to enable adding more files and urls with another drag-and-drop
operation without the need to manually enter the space in between.
2024-05-05 12:48:09 -07:00
Stefan Siegel b888c547db Implement drag and drop for X11
This is the last platform to resolve #640
2024-05-05 12:48:06 -07:00
Wez Furlong d8154bc450 avoid unwrap when detaching seat
refs: https://github.com/wez/wezterm/pull/5276
2024-05-04 16:17:31 -07:00
V 48fa4ca497 Fix crash when setting cursor on non-existent pointer 2024-05-04 16:09:38 -07:00
V 369fcb9928 Fix crash when switching TTYs 2024-05-04 16:09:38 -07:00
V b1069576b7 Drop old primary selection code 2024-05-04 16:09:37 -07:00
V 004bfd3d9e Unwrap wayland fd acquisition rather than erroring without a message 2024-05-04 16:09:37 -07:00
V 84e8c966a1 Use PrimarySelectionHandler provided by SCTK
Also converts other DataDevice-handling code to use Read/WritePipe
instead of the FileDescriptor API.
2024-05-04 16:09:37 -07:00
V b23a424e21 Improve error messages for set_cursor 2024-05-04 16:09:37 -07:00
V 2dd2a541ce Clean up delegates 2024-05-04 16:09:37 -07:00
V 5654bbff47 Use the existing CursorShapeManager provided by SCTK 2024-05-04 16:09:37 -07:00
V 5b0e7bca93 Remove/rename unused stuff 2024-05-04 16:09:37 -07:00
V f5a69b8746 Fix copy & paste 2024-05-04 16:09:37 -07:00
V 423859cef7 Fix drag & drop 2024-05-04 16:09:36 -07:00
V ba18d0590c Fix drag/selection offer retrieval 2024-05-04 16:09:36 -07:00
V 8ed444cffc Fix window todos 2024-05-04 16:09:36 -07:00
V a7b122a2e1 Fix pointer todos 2024-05-04 16:09:36 -07:00
V 42e47ad920 It runs! (pointer now has a surface) 2024-05-04 16:09:36 -07:00
V ccbdd4da6a Fix cursor setting 2024-05-04 16:09:36 -07:00
V fdc805bb2e Fix compilation 2024-05-04 16:09:36 -07:00
fioncat 42d62faf6c doc(wayland): update comments 2024-04-29 10:26:07 -07:00
fioncat b21c3f6b3d doc(wayland): update comment in show 2024-04-29 10:26:07 -07:00
fioncat 1266912629 fix(wayland): ensure repaint event is sent in show
Fix: https://github.com/wez/wezterm/issues/5103
2024-04-29 10:26:07 -07:00
Wez Furlong e5ac32f297 Revert SCTK changes
panics on startup under weston with no obvious fix.

This reverts commit 3938d1a7db.
This reverts commit aab3835f1a.
This reverts commit 0c97ace3cb.

refs: https://github.com/wez/wezterm/pull/5044
2024-03-25 09:35:07 -07:00
Wez Furlong 3938d1a7db Update window/src/os/wayland/window.rs 2024-03-25 08:59:28 -07:00
Thayne McCombs aab3835f1a Update SCTK to 0.18 2024-03-25 08:59:28 -07:00
Thayne McCombs 0c97ace3cb Better decorations 2024-03-25 08:59:28 -07:00
Wez Furlong 67bdc06d73 macos: speculative fix to drag-n-drop crash
refs: https://github.com/wez/wezterm/issues/4771
2024-02-10 17:32:28 -07:00
Wez Furlong 2fee694bcc wayland: avoid panic when closing/destroying window
refs: https://github.com/wez/wezterm/issues/4983
2024-02-08 05:01:55 -07:00
Wez Furlong 4f123a461b macos (mostly): try harder to get initial dpi
There are a number of open issues that relate to getting the dpi
wrong when spawning a window. In theory it shouldn't matter because
we will immediately realize the difference and synthesize the correct
information, but evidence shows this isn't quite true.

What this commit does is:

* Override Connection::default_dpi() on macOS to return the
  effective_dpi from the active screen instead of the default
  non-retina dpi
* Adjust the Config::initial_size() method to accept an optional
  cell pixel dimension
* Add a helper function to wezterm-gui to compute the cell pixel
  dimensions given the config and the (usually default) dpi, and
  feed that through to Config::initial_size
* in the macos window impl, scale the computed geometry based on
  the ratio of the Connection::default_dpi and the default non-retina
  dpi.

This helps to avoid needing to do a fixup in the
https://github.com/wez/wezterm/issues/4966 case, and may help with
the various other macos quirky issues.

refs: https://github.com/wez/wezterm/issues/2958
refs: https://github.com/wez/wezterm/issues/3575
refs: https://github.com/wez/wezterm/issues/3900
refs: https://github.com/wez/wezterm/issues/4250
refs: https://github.com/wez/wezterm/issues/4285
refs: https://github.com/wez/wezterm/issues/4447
refs: https://github.com/wez/wezterm/issues/4851
refs: https://github.com/wez/wezterm/issues/4966
2024-02-06 22:57:05 -07:00
Wez Furlong 36ff6d5f44 deps: update glium 2024-02-06 16:52:02 -07:00
Jeffrey Knockel b03b833a4d windows: account for dpi in window size
On Windows, to set a window's size, in addition to the size of the
client area, the width and height of the window's "frame" must be
included in the dimensions passed to SetWindowPos() which burdens us in
needing to know the exact size of the window frame so that we can
properly account for its dimensions.  Previously, we used
AdjustWindowRect() to account for the frame's dimensions, but the size
of a window's frame can change depending on the DPI of the monitor on
which it is placed, and it appears that neither AdjustWindowRect() nor
AdjustWindowRectEx() account for this automatically.  Instead, we use
AdjustWindowRectExForDpi(), passing in the window's DPI, so that we
properly calculate the window's size.
2024-02-04 21:32:33 -07:00
Jeffrey Knockel a0974a2537 Implement SetInnerSizeCompleted events
These are used to signal, after a set_inner_size() call, at what point
we can expect any and all of its related Resized events to have already
been dispatched.  SetInnerSizeCompleted events are currently used to fix
a race condition in rescaling the terminal in which the number of cells
of the terminal (e.g., 80x24) can change when quickly rescaling the
terminal.
2024-02-04 09:40:54 -07:00
Wez Furlong 38dbd8db5e wayland: hook up some resize handling
refs: https://github.com/wez/wezterm/pull/4906
2024-02-03 23:18:55 -07:00