Skip to content

X11 & Wayland api update#1

Merged
mitchmindtree merged 2 commits into
mitchmindtree:winit_api_updatefrom
elinorbgr:winit_api_update
Mar 16, 2017
Merged

X11 & Wayland api update#1
mitchmindtree merged 2 commits into
mitchmindtree:winit_api_updatefrom
elinorbgr:winit_api_update

Conversation

@elinorbgr
Copy link
Copy Markdown

I've updated the X11 and Wayland glutin backends to new winit api

  • X11 actually needed almost nothing changed
  • for Wayland, I took a large inspiration to your works on the macos backend, as the issue regarding resize is very similar

I also fixed some examples that didn't compile any more.

@mitchmindtree
Copy link
Copy Markdown
Owner

Nice one!

I just finished testing the examples with wayland and they mostly seem great, only two issues popped up:

  • window and grabbing work well now, however the triangle does not resize when the window is resized, as is the case on macOS.
  • multiwindow seems to show a window for a split second before immediately closing without any error messages or anything.

Any idea what might be going on with either of these? No worries if not, I'll merge this either way as it's still a big improvement over master 👍

@elinorbgr
Copy link
Copy Markdown
Author

Right now I don't know exactly what's the issue with these.

I cannot test it right now, but are these a regression with relation to the current released glutin? If not, it's probably a more profound issue with the backend that I'll investigate independently of the API refactor.

@mitchmindtree
Copy link
Copy Markdown
Owner

On the current master, both the window and grabbing examples immediately panic with:

thread 'main' panicked at 'Failed to call XPeekEvent: XError { description: "BadMatch (invalid parameter attributes)", error_code: 8, request_code: 42, minor_code: 0 }'

and multiwindow panics with:

thread 'main' panicked at 'Failed to get root window: XError { description: "BadMatch (invalid parameter attributes)", error_code: 8, request_code: 42, minor_code: 0 }'

So no, these don't seem to be regressions but are probably some other deeper issue with the backend as you mention.

Going to merge this, thanks a lot!

@mitchmindtree mitchmindtree merged commit 97da982 into mitchmindtree:winit_api_update Mar 16, 2017
@mitchmindtree
Copy link
Copy Markdown
Owner

Agh I just realised that I was testing an older version of master.

After updating master and running the tests:

window and grabbing run well but behave the same in that resizing the window does not resize the triangle

multiwindow seems to work OK on master (all three windows appear and stay open), while it exits immediately in this branch. So it does seem to have something to do with the changes in this PR. I'll have a look into it and see if I can find anything.

@mitchmindtree
Copy link
Copy Markdown
Owner

I'm also noticing a bug on macos when running the updated multiwindow example. The example immediately segfaults and exits which looks suspiciously similar to the behaviour on wayland (however wayland gives no indication of a segfault occuring). So this could have something to do with my changes prior to this PR! I'm wondering if it has something to do with the fact that all windows are now run from the same thread (rather than each on unique threads as was originally the case) - perhaps this is causing the support/mod.rs logic to behave differently?

@elinorbgr elinorbgr deleted the winit_api_update branch March 16, 2017 15:21
@elinorbgr
Copy link
Copy Markdown
Author

That's entirely possible that the issue comes from the opengl code. AFAIK having multiple contextes / multiple threads require some care, but I'm not very knowledgeable in this tbh.

@elinorbgr elinorbgr restored the winit_api_update branch March 16, 2017 17:53
@elinorbgr
Copy link
Copy Markdown
Author

I tried to multiwindow example, and it dies with a SIGSEGV on my system, both under X11 and wayland.

And the "the triangle is not resized" but occurs for both X11 and Wayland too for me.

But, I'm being curious: the examples of glutin have a bug, causing them to be stuck before even displaying the window (they enter the event loop without drawing at least once, and on wayland the window does not appear if it has not be drawn yet, and thus the examples receive no events at all, and thus the event loop remains stuck). Didn't you have to correct for this to run the examples on wayland?

@mitchmindtree
Copy link
Copy Markdown
Owner

Didn't you have to correct for this to run the examples on wayland?

I was aware of this before testing on wayland as it happens on macOS too, however on macOS the windows still open but remain gray until an event is received. I must have been moving my mouse or something each time I ran the wayland examples as I didn't notice it when running them. I think the behaviour is the same as it was prior to the api-update.

@elinorbgr
Copy link
Copy Markdown
Author

Hmm, what wayland compositor are you using?

Because, for me, using weston, the windows don't appear at all, and cannot receive input events before it has appeared. I guess your compositor must be sending some event to the window anyway. ^^

@mitchmindtree
Copy link
Copy Markdown
Owner

Ahh interesting, I'm using the default fedora v25 setup which uses GNOME.

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.

2 participants