Skip to content

Commit

Permalink
Merge pull request #1203 from Smithay/feature/activation-client
Browse files Browse the repository at this point in the history
xdg-activation: Add client_id to token data
  • Loading branch information
Drakulix authored Nov 6, 2023
2 parents fc2dfda + b27b9d7 commit a8f3c46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/wayland/xdg_activation/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ where
{
fn request(
state: &mut D,
_: &Client,
client: &Client,
token: &xdg_activation_token_v1::XdgActivationTokenV1,
request: xdg_activation_token_v1::Request,
data: &ActivationTokenData,
Expand Down Expand Up @@ -146,6 +146,7 @@ where
let mut guard = data.build.lock().unwrap();

XdgActivationTokenData::new(
client.id(),
guard.serial.take(),
guard.app_id.take(),
guard.surface.take(),
Expand Down
6 changes: 5 additions & 1 deletion src/wayland/xdg_activation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use std::{

use wayland_protocols::xdg::activation::v1::server::xdg_activation_v1;
use wayland_server::{
backend::GlobalId,
backend::{ClientId, GlobalId},
protocol::{wl_seat::WlSeat, wl_surface::WlSurface},
Dispatch, DisplayHandle, GlobalDispatch,
};
Expand Down Expand Up @@ -103,6 +103,8 @@ impl From<XdgActivationToken> for String {
#[derive(Debug, Clone)]
pub struct XdgActivationTokenData {
/// Client that requested the token
pub client_id: ClientId,
/// Provides information about the seat and serial event that requested the token.
///
/// The serial can come from an input or focus event.
Expand All @@ -129,13 +131,15 @@ pub struct XdgActivationTokenData {

impl XdgActivationTokenData {
fn new(
client_id: ClientId,
serial: Option<(Serial, WlSeat)>,
app_id: Option<String>,
surface: Option<WlSurface>,
) -> (XdgActivationToken, XdgActivationTokenData) {
(
XdgActivationToken::new(),
XdgActivationTokenData {
client_id,
serial,
app_id,
surface,
Expand Down

0 comments on commit a8f3c46

Please sign in to comment.