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

Simplify wayland configure event #5780

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion window/src/os/wayland/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use mio::unix::SourceFd;
use mio::{Events, Interest, Poll, Token};
use wayland_client::backend::WaylandError;
use wayland_client::globals::registry_queue_init;
use wayland_client::{Connection as WConnection, EventQueue};
use wayland_client::{Connection as WConnection, EventQueue, QueueHandle};

use crate::screen::{ScreenInfo, Screens};
use crate::spawn::SPAWN_QUEUE;
Expand All @@ -25,6 +25,7 @@ pub struct WaylandConnection {
pub(super) connection: WConnection,
pub(super) event_queue: RefCell<EventQueue<WaylandState>>,
pub(super) wayland_state: RefCell<WaylandState>,
queue_handle: QueueHandle<WaylandState>,
}

impl WaylandConnection {
Expand All @@ -41,6 +42,7 @@ impl WaylandConnection {
gl_connection: RefCell::new(None),
event_queue: RefCell::new(event_queue),
wayland_state: RefCell::new(wayland_state),
queue_handle: qh,
};

Ok(wayland_connection)
Expand Down Expand Up @@ -155,6 +157,11 @@ impl WaylandConnection {

future
}

pub(super) fn queue_handle() -> QueueHandle<WaylandState> {
let conn = Connection::get().unwrap().wayland();
conn.queue_handle.clone()
}
}

impl ConnectionOps for WaylandConnection {
Expand Down
Loading
Loading