-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add dragging window with cursor feature #1840
Conversation
Could you use a more descriptive PR title? |
That was an accident :/, can't think of a better formulation, suggestions welcome. |
I don't think the currently proposed API is a good fit for the Windows backend. For a given mouse action, the Note that I haven't tested this, but there was a similar issue I had to solve in #1807. |
@maroider I've used |
I wanna thank @maroider and @vberger, they were a lot of help with this PR. If no more concerns are raised I believe the implementation is complete, we are just waiting for an update from |
Wayland implementation split off to #1854. EDIT: just rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bikeshed: I don't feel like set_drag_window
is a particularly good name. The other set_*
methods on Window
either manipulate some piece of retained state, or aren't quite as restricted in when they can be called successfully. Perhaps begin_drag
would be better.
EDIT: the Wayland implementation uses |
Co-authored-by: Markus Røyset <maroider@protonmail.com>
Agreed. I intend to merge the Wayland implementation, which needs to upgrade SCTK to 0.13, this adds |
These are actually transitive dependencies of the new dependency on |
This mostly looks good regarding the macOS implementation. There is something strange I experienced though. Start the example, bring another application to the front, and while the other application is in the front, click the close button on one of the winit windows. They won't close, not even if I bring them back to the front after this. I put some if HANDLER.should_exit() { Turns out that somehow the application gets stuck in a state where neither of the two windows is the "main window". The source of this dialog handling code is #1581. I didn't dig deeper, I don't really have an idea what causes this or if it's normal. |
@ArturKovacs I am assuming this has nothing to do with |
That's what I'm suspecting as well, but I couldn't reproduce it with the |
@vberger Do you know what the builds issue is? Apparently |
An option would be to just install fontconfig in the CI environment, and avoid having the -sys crates build their own versions of the system libs they are associated with (which is apparently something servo likes to do?). |
So do I have to add a new Winit crate feature that activates |
Ah wait, looks like the lib was already installed. Looks like the issue I had with my CI: is pkgconfig installed in the CI environment? Without it the build scripts cannot find the libraries. |
Definitely installed: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#installed-apt-packages. |
Hmm, given the error log says |
I don't even know what to do with this error message now. |
Hmm, I guess servo-fontconfig-sys is unhappy because it cannot find an i686 version of libfontconfig, and then tries to build its own which fails horribly... I myself am not opposed to using An other option would be to completely disable writing the title in SCTK fallback decorations, I guess. Having text rendering in SCTK always struck me as quite an heavy dependency for so little gain. |
Should I ping the rest of the Linux maintainers for this?
Personally, I agree with that, do we need to aquire consensus for that, or can you decide that? |
@daxpedda To avoid blocking this further on unrelated stuff, I've released version 0.12.3 which only contains the change you need on top of 0.12.2, so you can just use that. All the stuff about fontconfig is unrelated an should be tackled elsewhere. |
Alright, thats great. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wayland part looks good.
@ArturKovacs I got my hands on a Apple machine just now and tried it, I wasn't able to reproduce the issue 😞. Potentially we could also just document not to use this function with multiple windows on MacOS? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, I could reproduce the faulty behavior on the master
branch, so it's in fact completely unrelated. This can be merged as far as I'm concerned.
Considering that there hasn't been Windows related changes since @msiglreith approved, it seems that everyone required approved these changes. I'm merging this now. |
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to usersPartially fixes #221.
Still working on the other platforms, see #221 (comment) for details.Would really appreciate somebody looking at the Wayland implementation, any bikeshedding is welcome too.
I've successfully tried all implementations, currently stuck at trying to fix the Windows implementation deadlock.cargo run --example drag_window
Blocked on Smithay/client-toolkit#174.Blocked onsmithay-client-toolkit
releasing a new version.Wayland implementation at #1854.