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

macos: floating window support #4567

Merged
merged 31 commits into from
Jan 21, 2024
Merged

macos: floating window support #4567

merged 31 commits into from
Jan 21, 2024

Conversation

rawnly
Copy link
Contributor

@rawnly rawnly commented Nov 12, 2023

Added ToggleFloatingWindow on macos.
Tested on macOS Sonoma (14.0)

Demo

CleanShot.2023-11-12.at.16.14.33.mp4

fixes #4566

Signed-off-by: rawnly <rawnly@users.noreply.github.com>
Signed-off-by: rawnly <rawnly@users.noreply.github.com>
removed wrong values and implemented `From<T>` trait

Signed-off-by: rawnly <rawnly@users.noreply.github.com>
@rawnly rawnly marked this pull request as ready for review November 12, 2023 15:18
Signed-off-by: rawnly <rawnly@users.noreply.github.com>
@rawnly rawnly changed the title Floating window support macos: floating window support Nov 19, 2023
@rawnly
Copy link
Contributor Author

rawnly commented Nov 23, 2023

any feedback on this? @wez

Copy link
Owner

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for diving in!

I think this PR needs to consider all platforms; both X11 and Windows have an AlwaysOnTop concept, so the configuration and actions need to expand and be ready for that, even if you're not in a position to implement and test for those platforms yourself.

I've made some suggestions with that in mind for your macOS implementation.

I think you could probably get close to making this work on windows and perhaps also X11 if you took a peek at the equivalent functionality in the winit crate. I'm not going to require that you do both of these in this PR, but it would be very helpful if you could take a crack at making it compile there via the CI as a kind of first-pass at that.

config/src/keyassignment.rs Outdated Show resolved Hide resolved
window/src/lib.rs Outdated Show resolved Hide resolved
window/src/os/macos/window.rs Outdated Show resolved Hide resolved
window/src/os/macos/window.rs Outdated Show resolved Hide resolved
window/src/os/macos/window.rs Outdated Show resolved Hide resolved
@rawnly
Copy link
Contributor Author

rawnly commented Nov 24, 2023

Thanks for the review I'll have a look at it asap!

"The only place where the behavior should vary by os is inside the window crate"
config/src/keyassignment.rs Outdated Show resolved Hide resolved
wezterm-gui/src/commands.rs Outdated Show resolved Hide resolved
@rawnly rawnly requested a review from wez November 30, 2023 02:09
config/src/keyassignment.rs Outdated Show resolved Hide resolved
wezterm-gui/src/commands.rs Outdated Show resolved Hide resolved
wezterm-gui/src/commands.rs Outdated Show resolved Hide resolved
wezterm-gui/src/termwindow/mod.rs Outdated Show resolved Hide resolved
wezterm-gui/src/termwindow/mod.rs Outdated Show resolved Hide resolved
window/src/lib.rs Outdated Show resolved Hide resolved
@rawnly
Copy link
Contributor Author

rawnly commented Dec 1, 2023

Thanks for the feedback, I applied the changes as you suggested, now there are 3 ways to set levels, via SetLevel and via ToggleAlwaysOn...

I moved the WindowLevel inside the config crate on a separate mod (window) to be more clean

@rawnly
Copy link
Contributor Author

rawnly commented Dec 1, 2023

i left docs for the so i don't have to write them again every time 😅

wezterm-gui/src/termwindow/mod.rs Outdated Show resolved Hide resolved
wezterm-gui/src/termwindow/mod.rs Outdated Show resolved Hide resolved
wezterm-gui/src/termwindow/mod.rs Outdated Show resolved Hide resolved
window/src/os/macos/window.rs Show resolved Hide resolved
config/src/window.rs Outdated Show resolved Hide resolved
window/src/os/macos/window.rs Outdated Show resolved Hide resolved
window/src/os/macos/window.rs Show resolved Hide resolved
window/src/os/macos/window.rs Outdated Show resolved Hide resolved
config/src/window.rs Outdated Show resolved Hide resolved
docs/config/lua/keyassignment/ToggleAlwaysOnBottom.md Outdated Show resolved Hide resolved
docs/config/lua/keyassignment/ToggleAlwaysOnTop.md Outdated Show resolved Hide resolved
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
rawnly and others added 8 commits December 2, 2023 18:14
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
@rawnly rawnly requested a review from wez December 2, 2023 17:51
@rawnly
Copy link
Contributor Author

rawnly commented Dec 3, 2023

it should be everything fine for the CI :)

Copy link
Owner

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks; just a couple of minor things remain here for macOS!

window/src/os/macos/window.rs Outdated Show resolved Hide resolved
window/src/os/macos/window.rs Show resolved Hide resolved
@rawnly rawnly requested a review from wez December 3, 2023 23:18
Co-authored-by: Mike Duminy <4092035+mikeduminy@users.noreply.github.com>
rawnly and others added 2 commits December 4, 2023 19:08
@rawnly rawnly requested review from wez and mikeduminy December 4, 2023 18:51
@rawnly
Copy link
Contributor Author

rawnly commented Dec 15, 2023

any feedback so far?

@rawnly
Copy link
Contributor Author

rawnly commented Jan 4, 2024

@wez ?

@wez wez merged commit 521b7fb into wez:main Jan 21, 2024
15 checks passed
@wez
Copy link
Owner

wez commented Jan 21, 2024

Thanks!

wez added a commit that referenced this pull request Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

top level (floating) window on macos
3 participants