-
Notifications
You must be signed in to change notification settings - Fork 948
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
Shares the XConnection between all event pools instead of just all event pools on the same thread. #572
Shares the XConnection between all event pools instead of just all event pools on the same thread. #572
Conversation
7881f1b
to
0f6a1fd
Compare
This doesn't look like it segfaults on The segfault seems to happen most often when moving the cursor around, and especially across monitors... anyway, since it's not a regression, I don't expect you to fix that. |
CHANGELOG.md
Outdated
@@ -14,6 +14,7 @@ | |||
- HiDPI support for Wayland. | |||
- `EventsLoop::get_available_monitors` and `EventsLoop::get_primary_monitor` now have identical counterparts on `Window`, so this information can be acquired without an `EventsLoop` borrow. | |||
- `AvailableMonitorsIter` now implements `Debug`. | |||
- In X11, all events loops will now share the same XConnection. |
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.
"events loops" -> "event loops" (I know that's the actual type name, but it's a very awkward type name).
The other entries don't use the future tense.
Need backticks around XConnection
.
src/platform/linux/mod.rs
Outdated
@@ -26,6 +26,8 @@ use self::x11::{XConnection, XError}; | |||
use self::x11::ffi::XVisualInfo; | |||
pub use self::x11::XNotSupported; | |||
|
|||
use parking_lot::Mutex; |
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.
This should be on line 9, above the sctk
import.
src/platform/linux/mod.rs
Outdated
.map_err(|err| err.clone()) | ||
}) | ||
let xconn = X11_BACKEND.lock(); | ||
xconn |
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.
You can just call lock()
as part of this method chain, which looks cooler.
src/platform/linux/mod.rs
Outdated
*xconn.latest_error.lock() = Some(error); | ||
} | ||
}); | ||
let xconn = X11_BACKEND.lock(); |
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.
This variable name should be suffixed with _lock
.
loops on the same thread. This is needed for adding shared context support to glutin, as contexts must be made with the same native display (and therefore the same connection.) Signed-off-by: Hal Gentz <[email protected]>
0f6a1fd
to
3f91c2d
Compare
Thanks! I tested this again, and now my impression is that this does segfault more often than on master. Are you seeing that too? |
No, I tested with this script:
Results:
|
Fixed the table, sorry for that, github is weird |
Shares the XConnection between all event loops instead of just all event
loops on the same thread.
This is needed for adding shared context support to tomaka/glutin, as contexts
must be made with the same native display (and therefore the same
connection.)
Signed-off-by: Hal Gentz [email protected]
CHANGELOG.md
if knowledge of this change could be valuable to users