-
Notifications
You must be signed in to change notification settings - Fork 12
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
simple_window example immediately crashes [Arch+Gnome] #16
Comments
The crash seems to occur immediately after a call to the If I change the if width <= 0 || height <= 0 {
return;
} The window seems to run relatively normally. It initially appears far offscreen to the left (this might have something to do with the different DPIs on each of my displays, though I'm unsure) but if I enter Gnome's "Activities" HUD I can move it back onto my other display and see it appearing normally: The invlid dimensions don't seem to appear again after that first call in the second pass of the main The window still seems to ignore resizing and dragging, despite the resize cursor showing correctly when hovering the mouse over each of the edges. I can also see that the event_queue is actually dispatching events during resize, however I'll continue to dig deeper, though would still love to hear your thoughts in the meantime as I'm still a newbie when it comes to linux and wayland! Thanks for all your efforts on wayland btw! I'm running an Arch+Gnome+Wayland system as my main development machine now so I'm keen to do my best to help get this into shape 👍 |
Yes, actually the example implementation should be something like impl wayland_window::Handler for Window {
fn configure(&mut self, _: &mut EventQueueHandle, _: wl_shell_surface::Resize, width: i32, height: i32) {
use std::cmp::max;
self.newsize = Some((max(width,1), max(height,1)))
}
} So that the window refuses to be resized smaller than Regarding the fact that the window does not behave well... In your logs, when you try resizing it by grabbing a border, do you see the client sending a PS: I will be quite busy today and the next two days, son won't be able to answer a lot, sorry. |
@vberger yes, but only at the very beginning of the resize - does that sound correct? Here is an annotated log from the moment I press the left mouse button and begin the attempt to resize from the right edge of the window: Press the resizable edge:
Drag the resizable edge to the right, attempting to make it wider (window desn't actually resize):
Release the mouse button:
Alt-tab back to the Terminal
Should it be continually receiving resize events? Or only the very first? I also tried dragging the window by grabbing the top bar with the left mouse button and moving it slightly to the right. Here are the logs for that: Left-press the top title bar of the window:
Attempt to drag the cursor to the right by moving the mouse (window doesn't actually move):
Release the mouse button
|
I may be missing something, but to me it looks like Gnome is not behaving correctly as a compositor here.
The expected behavior (and what weston does) is that the client should send a single "resize" or "move" request, to initiate the interactive resize or move, and then the compositor should handle the rest : move the window around, or continually send "configure" events to notify the client about its new size. Until the mouse button is released.
Now, it's entirely possible that the gnome developers did not bother implementing wl_shell fully because they are focusing on xdg_shell, and ideally we'd be using it too. But we can't before rust 1.17, as it requires the "recursive_static" feature gate which will only be stabilized then.
Le 24 avril 2017 08:00:37 GMT+02:00, mitchmindtree <notifications@github.com> a écrit :
…
@vberger yes, but only at the very beginning of the resize - does that
sound correct?
Here is an annotated log from the moment I press the left mouse button
and begin the attempt to resize from the right edge of the window:
Press the resizable edge:
```
[814139.649] ***@***.***(20109, 10070859, 272, 1)
[814139.727] -> ***@***.******@***.***, 20109, 8)
```
Drag the resizable edge to the right, attempting to make it wider
(window desn't actually resize):
```
[815561.237] ***@***.***(10072280, 4.179688, 85.035156)
[815578.364] ***@***.***(10072295, 4.351562, 85.035156)
[815593.633] ***@***.***(10072311, 4.527344, 85.035156)
[815610.814] ***@***.***(10072326, 4.710938, 85.035156)
[815627.786] ***@***.***(10072342, 4.894531, 85.035156)
[815644.873] ***@***.***(10072357, 5.085938, 85.035156)
[815660.386] ***@***.***(10072372, 5.277344, 85.035156)
[815680.182] ***@***.***(10072395, 5.613281, 85.035156)
[815695.733] ***@***.***(10072411, 5.968750, 85.035156)
[815712.571] ***@***.***(10072426, 6.324219, 85.035156)
[815728.408] ***@***.***(10072441, 6.496094, 85.035156)
[815746.070] ***@***.***(10072464, 7.011719, 85.035156)
[815761.964] ***@***.***(10072480, 7.355469, 85.035156)
[815780.930] ***@***.***(10072488, 7.527344, 85.203125)
[815796.711] ***@***.***(10072511, 7.527344, 85.367188)
[815870.186] ***@***.***(10072587, 7.675781, 85.367188)
[817066.688] ***@***.***(10073786, 7.785156, 85.367188)
[817765.569] ***@***.***(10074484, 7.867188, 85.367188)
[818236.053] ***@***.***(10074953, 7.953125, 85.367188)
```
Release the mouse button:
```
[818401.878] ***@***.***(20110, 10075122, 272, 0)
[818420.178] ***@***.***(20111, ***@***.***)
[818420.266] -> ***@***.******@***.***, 0, 0)
[818420.282] -> ***@***.***(0, 0, 24, 24)
[818420.290] -> ***@***.***()
[818420.294] -> ***@***.***_cursor(20111, ***@***.***, 4, 4)
```
Alt-tab back to the Terminal
```
[826417.962] ***@***.***(0, 272, 152)
[826418.011] -> ***@***.***()
[826418.018] -> ***@***.***()
[826418.022] -> ***@***.***()
[826418.025] -> ***@***.***()
[826434.931] -> ***@***.***_buffer(new id ***@***.***, 0,
272, 24, 1088, 0)
[826435.139] -> ***@***.******@***.***, 0, 0)
[826435.171] -> ***@***.***_position(-8, -24)
[826435.185] -> ***@***.***_buffer(new id ***@***.***, 0,
8, 120, 32, 0)
[826435.210] -> ***@***.******@***.***, 0, 0)
[826435.230] -> ***@***.***_position(256, 0)
[826435.245] -> ***@***.***_buffer(new id ***@***.***, 0,
272, 8, 1088, 0)
[826435.278] -> ***@***.******@***.***, 0, 0)
[826435.288] -> ***@***.***_position(-8, 120)
[826435.294] -> ***@***.***_buffer(new id ***@***.***, 0,
8, 120, 32, 0)
[826435.318] -> ***@***.******@***.***, 0, 0)
[826435.327] -> ***@***.***_position(-8, 0)
[826435.335] -> ***@***.***()
[826435.339] -> ***@***.***()
[826435.341] -> ***@***.***()
[826435.343] -> ***@***.***()
[826435.350] -> ***@***.***()
[826435.356] -> ***@***.***_buffer(new id ***@***.***, 0,
256, 120, 1024, 0)
[826435.373] -> ***@***.******@***.***, 0, 0)
[826435.382] -> ***@***.***()
```
Should it be continually receiving resize events? Or only the very
first?
I also tried dragging the window by grabbing the top bar with the left
mouse button and moving it slightly to the right. Here are the logs for
that:
Left-press the top title bar of the window:
```
[1142431.986] ***@***.***(21483, 10399152, 272, 1)
[1142432.020] -> ***@***.******@***.***, 21483)
```
Attempt to drag the cursor to the right by moving the mouse (window
doesn't actually move):
```
[1144728.157] ***@***.***(10401447, 154.250000, 8.613281)
[1144744.943] ***@***.***(10401462, 154.421875, 8.613281)
[1144761.082] ***@***.***(10401478, 154.597656, 8.613281)
[1144777.543] ***@***.***(10401493, 154.871094, 8.613281)
[1144795.330] ***@***.***(10401508, 155.152344, 8.613281)
[1144810.354] ***@***.***(10401524, 155.445312, 8.613281)
[1144826.021] ***@***.***(10401539, 155.843750, 8.613281)
[1144843.374] ***@***.***(10401555, 156.261719, 8.613281)
[1144858.800] ***@***.***(10401578, 157.531250, 8.613281)
[1144881.282] ***@***.***(10401593, 158.261719, 8.613281)
[1144896.999] ***@***.***(10401608, 158.753906, 8.613281)
[1144917.378] ***@***.***(10401631, 159.457031, 8.613281)
[1144933.127] ***@***.***(10401647, 159.914062, 8.613281)
[1144952.112] ***@***.***(10401670, 160.550781, 8.613281)
[1145003.190] ***@***.***(10401716, 160.734375, 8.613281)
[1145206.336] ***@***.***(10401923, 160.878906, 8.613281)
[1145223.372] ***@***.***(10401938, 161.113281, 8.613281)
[1145242.660] ***@***.***(10401954, 161.343750, 8.613281)
[1145276.560] ***@***.***(10401992, 162.031250, 8.613281)
[1145294.371] ***@***.***(10402007, 162.265625, 8.613281)
[1145310.132] ***@***.***(10402023, 162.500000, 8.613281)
[1145329.631] ***@***.***(10402046, 162.953125, 8.613281)
[1145345.538] ***@***.***(10402061, 163.320312, 8.613281)
[1145364.904] ***@***.***(10402069, 163.507812, 8.613281)
[1145380.779] ***@***.***(10402084, 163.687500, 8.613281)
[1145996.511] ***@***.***(10402713, 163.824219, 8.613281)
[1146080.881] ***@***.***(10402798, 163.925781, 8.613281)
[1146250.205] ***@***.***(10402967, 164.023438, 8.613281)
[1147148.209] ***@***.***(10403865, 164.113281, 8.613281)
[1147207.543] ***@***.***(10403926, 164.195312, 8.613281)
```
Release the mouse button
```
[1147207.601] ***@***.***(21484, 10403926, 272, 0)
```
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#16 (comment)
|
Would you mind elaborating on this a little? Do you have plans to move to xdg_shell once 1.17 is released in a few days? Do you have a fork/feature/issue that I might be able to track somewhere? I'd be happy to test/help if there's a possibility it could solve this issue. I asked in the wayland IRC about wl_shell:
After explaining my exact issues a little further, this was suggested:
Could this be a possibility? There's probably a better place I could ask for support than the wayland IRC I suppose. I guess it is |
I have nothing working yet, apart from the API bindings to the xdg_shell protocol extension in the wayland-protocols crate.
My goal for wayland-window would be to have xdg_shell support as a cargo feature enabled by default (to remain pre-1.17 compatible) and try to use it at runtime, fallbacking to wl_shell (the current implementation) if it is not available.
But all this means quite some work tbh, and with the other wayland libs and smithay, I don't have a huge amount of time. So this got relatively low priority as the current backend seemed "good enough", especially considering xdg_shell is still an experimental protocol that has not reached a stable release (but wl_shell is already deprecated so everybody uses xdg_shell anyway, I guess...)
Le 24 avril 2017 11:38:25 GMT+02:00, mitchmindtree <notifications@github.com> a écrit :
…> But we can't before rust 1.17, as it requires the "recursive_static"
feature gate which will only be stabilized then.
Would you mind elaborating on this a little? Do you have plans to move
to xdg_shell once 1.17 is released in a few days? Do you have a
fork/feature/issue that I might be able to track somewhere? I'd be
happy to test/help if there's a possibility it could solve this issue.
I asked in the wayland IRC about wl_shell:
> < mindtree> hey folks, is `wl-shell` still (or was it ever fully)
supported in the latest stable Gnome release?
> < ANON> mindtree, I'd be surprised if it was not, since so many
programs use it in lack of a stable alternative. That said, I don't
actually know.
After explaining my exact issues a little further, this was suggested:
> Maybe there is an issue with input event serials, if the resize or
move is dismissed immediately?
Could this be a possibility? There's probably a better place I could
ask for support than the wayland IRC I suppose. I guess it is `mutter`
that does not seem to be behaving as expected in this case - would I be
correct in saying that?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#16 (comment)
|
@vberger out of curiosity, what system do you run that uses wayland that runs this example successfully (including allowing to resize and move the window)? |
I just ran the |
I do most of my testing using weston currently.
Le 24 avril 2017 13:17:10 GMT+02:00, mitchmindtree <notifications@github.com> a écrit :
…
@vberger out of curiosity, what system do you run that uses wayland
that runs this example successfully (including allowing to resize and
move the window)?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#16 (comment)
|
@vberger After doing a bit more research and talking to the gnome IRC it seems like Gnome's priority switched from supporting wl_shell to xdg_shell around 2014, so I feel my time might be best spent helping implement the xdg_shell feature for wayland-rs. Could you possibly provide a small overview (perhaps a new issue at wayland-rs) of the work that needs to be done to make this happen and any recommended steps for approaching it? Could I perhaps use the existing wl_shell implementation as a rough guide for how to implement this in wayland-rs? |
Well, sure. Actually no work needs to be done on wayland-rs itself, only here, on wayland-window. The bindings for xdg_shell are provided by the wayland-protocols crate: http://vberger.github.io/wayland-rs/wayland_protocols/unstable/xdg_shell/client/index.html They are hidden behind the cargo features On this protocol, the entry point is the |
@vberger what would be the best way to access the unstable |
The way the crates from wayland-rs are designed is that |
Hey there!
I thought I'd have a go at running the
wayland-window
example after your comment at rust-windowing/winit#163 to test whether or not resizing or window works on this, however the example crashes as soon as it is run. Here is the output withRUST_BACKTRACE=1 WAYLAND_DEBUG=1 cargo run --example simple_window
:simple_window_debug.txt
Any ideas what might be going on here?
The text was updated successfully, but these errors were encountered: