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

WIP wl_fixes #477

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
76 changes: 29 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,16 @@ inherits = "release"
lto = "fat"

[patch."https://github.com/Smithay/smithay.git"]
smithay = {git = "https://github.com/smithay//smithay", rev = "64356be"}
# smithay = {git = "https://github.com/smithay//smithay", rev = "f7638e8"}
smithay = {git = "https://github.com/ids1024/smithay", branch = "wl_fixes"}

[patch.crates-io]
wayland-egl = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-protocols = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-protocols-wlr = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-protocols-misc = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-server = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-client = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-sys = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-backend = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
wayland-scanner = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" }
6 changes: 6 additions & 0 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ use smithay::{
wayland::{
compositor::{CompositorClientState, CompositorState},
dmabuf::{DmabufFeedback, DmabufGlobal, DmabufState},
fixes::FixesState,
fractional_scale::{with_fractional_scale, FractionalScaleManagerState},
idle_inhibit::IdleInhibitManagerState,
idle_notify::IdleNotifierState,
Expand Down Expand Up @@ -93,6 +94,7 @@ use smithay::{
virtual_keyboard::VirtualKeyboardManagerState,
xdg_activation::XdgActivationState,
xwayland_keyboard_grab::XWaylandKeyboardGrabState,
xwayland_shell::XWaylandShellState,
},
xwayland::XWaylandClientData,
};
Expand Down Expand Up @@ -219,6 +221,7 @@ pub struct Common {
pub xdg_activation_state: XdgActivationState,
pub workspace_state: WorkspaceState<State>,
pub xwayland_state: Option<XWaylandState>,
pub xwayland_shell_state: XWaylandShellState,
}

#[derive(Debug)]
Expand Down Expand Up @@ -427,13 +430,15 @@ impl State {
let session_lock_manager_state =
SessionLockManagerState::new::<Self, _>(&dh, client_is_privileged);
XWaylandKeyboardGrabState::new::<Self>(&dh);
let xwayland_shell_state = XWaylandShellState::new::<Self>(&dh);
PointerConstraintsState::new::<Self>(&dh);
PointerGesturesState::new::<Self>(&dh);
TabletManagerState::new::<Self>(&dh);
SecurityContextState::new::<Self, _>(&dh, client_has_no_security_context);
InputMethodManagerState::new::<Self, _>(&dh, client_is_privileged);
TextInputManagerState::new::<Self>(&dh);
VirtualKeyboardManagerState::new::<State, _>(&dh, client_is_privileged);
FixesState::new::<Self>(&dh);

let idle_notifier_state = IdleNotifierState::<Self>::new(&dh, handle.clone());
let idle_inhibit_manager_state = IdleInhibitManagerState::new::<State>(&dh);
Expand Down Expand Up @@ -533,6 +538,7 @@ impl State {
xdg_activation_state,
workspace_state,
xwayland_state: None,
xwayland_shell_state,
},
backend: BackendData::Unset,
ready: Once::new(),
Expand Down
2 changes: 1 addition & 1 deletion src/wayland/handlers/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl CompositorHandler for State {
}

fn commit(&mut self, surface: &WlSurface) {
X11Wm::commit_hook::<State>(surface);
X11Wm::commit_hook::<State>(self, surface);
// first load the buffer for various smithay helper functions (which also initializes the RendererSurfaceState)
on_commit_buffer_handler::<Self>(surface);

Expand Down
6 changes: 6 additions & 0 deletions src/wayland/handlers/fixes.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only

use crate::state::State;
use smithay::delegate_fixes;

delegate_fixes!(State);
2 changes: 2 additions & 0 deletions src/wayland/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub mod decoration;
pub mod dmabuf;
pub mod drm;
pub mod drm_lease;
pub mod fixes;
pub mod fractional_scale;
pub mod idle_inhibit;
pub mod idle_notify;
Expand Down Expand Up @@ -38,3 +39,4 @@ pub mod workspace;
pub mod xdg_activation;
pub mod xdg_shell;
pub mod xwayland_keyboard_grab;
pub mod xwayland_shell;
15 changes: 15 additions & 0 deletions src/wayland/handlers/xwayland_shell.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only

use crate::state::State;
use smithay::{
delegate_xwayland_shell,
wayland::xwayland_shell::{XWaylandShellHandler, XWaylandShellState},
};

impl XWaylandShellHandler for State {
fn xwayland_shell_state(&mut self) -> &mut XWaylandShellState {
&mut self.common.xwayland_shell_state
}
}

delegate_xwayland_shell!(State);
1 change: 0 additions & 1 deletion src/xwayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ impl State {

let mut wm = match X11Wm::start_wm(
data.common.event_loop_handle.clone(),
data.common.display_handle.clone(),
x11_socket,
client.clone(),
) {
Expand Down